Hi there,
How can I get a unique element of a matrix? Currently, I use a DMatrix as a way to store fixed coefficients, cf this line.
I’m currently trying the following:
for j in 0..k.len() {
let a_ij = self.a_coeffs.slice((i, j), (1, 1)).0;
wi += a_ij * &k[j];
}
This fails because a_ij
is not an f64. How can I get a specific value from my DMatrix<f64>
as an f64?
Follow up question: would it be more memory efficient to store these values as an array of array? My reason for opting for a DMatrix is because different integrators will have a different number of values (e.g. an RK 54 can store all its coefficients in a 5x5, but an RK87 stores it in an 8x8 matrix – and I’ve defined any RK as a trait).
Thanks for your help