1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//
// GENERATED FILE
//
use super::*;
use crate::SpiceContext;
use f2rust_std::*;
/// Are two integer arrays the same?
///
/// Indicate whether two integer arrays are equal.
///
/// # Brief I/O
///
/// ```text
/// VARIABLE I/O DESCRIPTION
/// -------- --- --------------------------------------------------
/// A1 I First array to be compared.
/// A2 I Second array to be compared.
/// NDIM I Dimension of A1 and A2.
///
/// The function returns the value .TRUE. if and only if A1 = A2.
/// ```
///
/// # Detailed Input
///
/// ```text
/// A1,
/// A2 are two integer arrays to be compared. A1 and
/// A2 must have the same dimension.
///
/// NDIM is the common dimension of A1 and A2.
/// ```
///
/// # Detailed Output
///
/// ```text
/// The function takes the value .TRUE. if and only if A1 equals A2.
/// ```
///
/// # Exceptions
///
/// ```text
/// Error free.
/// ```
///
/// # Particulars
///
/// ```text
/// This function can be thought of as a macro. It replaces the
/// loop
///
/// SAME = .TRUE.
/// I = 1
///
/// DO WHILE ( ( I .LE. NDIM ) .AND. SAME )
///
/// IF ( A1(I) .NE. A2(I) )
/// SAME = .FALSE.
/// ELSE
/// I = I + 1
/// END IF
///
/// END DO
/// ```
///
/// # Examples
///
/// ```text
/// 1) Test two integer arrays A1 and A2 for equality, where both
/// arrays have declared length 10:
///
/// SAME = SAMEAI ( A1, A2, 10 )
/// ```
///
/// # Author and Institution
///
/// ```text
/// N.J. Bachman (JPL)
/// J. Diaz del Rio (ODC Space)
/// ```
///
/// # Version
///
/// ```text
/// - SPICELIB Version 1.1.0, 12-AUG-2021 (JDR)
///
/// Added IMPLICIT NONE statement.
///
/// Edited the header to comply with NAIF standard.
///
/// - SPICELIB Version 1.0.0, 19-DEC-1995 (NJB)
/// ```
pub fn sameai(a1: &[i32], a2: &[i32], ndim: i32) -> bool {
let ret = SAMEAI(a1, a2, ndim);
ret
}
//$Procedure SAMEAI ( Are two integer arrays the same? )
pub fn SAMEAI(A1: &[i32], A2: &[i32], NDIM: i32) -> bool {
let A1 = DummyArray::new(A1, 1..);
let A2 = DummyArray::new(A2, 1..);
let mut SAMEAI: bool = false;
//
// Local variables
//
//
// Executable code
//
SAMEAI = true;
for I in 1..=NDIM {
if (A1[I] != A2[I]) {
SAMEAI = false;
return SAMEAI;
}
}
SAMEAI
}