We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bd8206 commit 008eecbCopy full SHA for 008eecb
tests/ixdyn.rs
@@ -51,6 +51,25 @@ fn test_ixdyn_iterate() {
51
}
52
53
54
+#[test]
55
+fn test_ixdyn_index_iterate() {
56
+ for &rev in &[false, true] {
57
+ let mut a = Array::zeros((2, 3, 4).set_f(rev));
58
+ let dim = a.shape().to_vec();
59
+ for ((i, j, k), elt) in a.indexed_iter_mut() {
60
+ *elt = i + 10 * j + 100 * k;
61
+ }
62
+ let a = a.into_shape(dim).unwrap();
63
+ println!("{:?}", a.dim());
64
+ let mut c = 0;
65
+ for (i, elt) in a.indexed_iter() {
66
+ assert_eq!(a[i], *elt);
67
+ c += 1;
68
69
+ assert_eq!(c, a.len());
70
71
+}
72
+
73
#[test]
74
fn test_ixdyn_uget() {
75
// check that we are out of bounds
0 commit comments