Say, I have two Array2 objects: ```rust type M = Array2<f32>; let mut a = M::eye(2); let mut b = 2.0 * a; ``` I want to iterate over the rows of a and b in lockstep, but also have the row index simultaneously: for example: `(ridx, (row_a, row_b)) in Zip(a.rows(), b.rows()).enumerate()` ``` I should get (0, ([1.0, 0], [2.0, 0])) (1, ([0, 1.0], [0, 2.0])) ``` How can I do this efficiently? Also can i do the same thing in parallel (over row indices) ?
Activity
bluss commentedon May 9, 2021
Zip::indexed can do this