dimforge / dimforge/nalgebra

Debug output is broken for dynamic matrices

Open
#1,071 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
4.8k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

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](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3e2232974ea698a3e018e66d99530642) ):

```rust
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.