Let’s suppose that I have a matrix like the following
let matrix = DMatrix::<f64>::zeros(10, 10);
I would like to update some part of the matrix in a very similar way of Eigen blocks. For instance, the upper right corner of the matrix.How can I do that in nalgebra?
Also, I know that there are the
set_row methods, but I am wondering if I can make a mutable slice of a matrix and replace it with something else. I have tried the following code but it does not work and I still don’t understand why
let mut matrix = DMatrix::<f64>::zeros(10, 10); let mut slice = matrix.index_mut((.., ..2)); let arr = DMatrix::<f64>::zeros(10, 2); slice = arr;
Thanks for your help!