nalgebra icon indicating copy to clipboard operation
nalgebra copied to clipboard

Debug output is broken for dynamic matrices

Open Andlon opened this issue 3 years ago • 0 comments

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.

Andlon avatar Jan 26 '22 10:01 Andlon