Replace array with ndarray

Example:

type A = [[isize; 10]; 10];
type B = [[A; 10]; 10];
let mut x: B = [[[[0; 10]; 10]; 10]; 10];
x[3][4] = [[3; 10]; 10];

Can we do this using ndarrays instead (for A and B)? It is suggestive from the documention that you can only modify elementwise (isize here) and not subarrays themselves.

You might check out nalgebra. It allows for mutable access to slices/rows/columns (see Slicing section).

Also, for ndarray, ArrayViewMut sounds like what you're looking for.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.