I have dynamic Matrix
let capital_a = nalgebra::DMatrix::from_column_slice(2, 4, &[1.0f32, 2.0, 1.0, 0.5, 1.0, 0.0, 0.0, 1.0]); and want to crate a a new matrix from the last two columns.
I succeeded in getting one slice with
let mut capital_b = lp.capital_a.column(basic_indexes);
But adding a new column with
capital_b.insert_column(1, 0.0); does not work and assigning the elements individually with
capital_b[(0,0)] = 3.0; leads to compile errors. Did I do something wrong there?
Is there a better way to construct a matrix out of several columns of another matrix?