Closed
Description
Given a [n0, n1, n2, n3]
array, I'd like an iterator going through the first two axis. Is this possible? I'd like to use this to parallely go through all components of a matrix-field, where n0 times n1 is the size of the matrix and n2 times n3 the number of grid points.
So kind of what
for mut ax0 in a.outer_iter_mut() {
for mut ax1 in ax0.outer_iter_mut() {
//...
}
}
gives me, but as a flat iterator.
So something along the lines of
a.outer_iter_mut().flat_map(|ax| ax.outer_iter_mut()).par_iter_mut().etc()
which does not work. I'm a bit lost here.
Metadata
Metadata
Assignees
Labels
No labels