dimforge / dimforge/nalgebra

Possible documentation clarification needed for nalgebra::zero

Open
#317 2 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

As a newcomer to nalgebra, I was a bit confused about the various `zero()` and `zeros()` functions for constructing matrices.

I was originally disappointed that I would need to repeat the dimensions for each construction like
```
#[derive(Debug)]
struct S {
x:MatrixMN,
}
fn main() {
let s = S { x:MatrixMN::::zeros() };
println!("{:?}", s);
}
```

I eventually came across `http://nalgebra.org/rustdoc/nalgebra/fn.zero.html`, which allows me to just write
```
let s = S { x:zero() };
```

I'm still not entirely clear on the reasons for both `zero()` and `zeros`, so maybe an explanation could be added to the otherwise excellent documentation?

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.