nalgebra
nalgebra copied to clipboard
Debug output is broken for dynamic matrices
In #986 the Debug formatting of matrices was changed to forward to the storage. This works reasonably well for static matrices, but unfortunately it does not work well for dynamic matrices.
Given this code (Playground link ):
let a = dmatrix![1.0, 2.0; 3.0, 4.0];
println!("{:#?}", a);
the output is
VecStorage {
data: [
1.0,
3.0,
2.0,
4.0,
],
nrows: Dynamic {
value: 2,
},
ncols: Dynamic {
value: 2,
},
}
Clearly, we don't want a matrix to be represented directly as a "VecStorage". I think the "fix" here is to go with the proposal in #898 and apply it uniformly across static or dynamic matrices.