Comments (2)
I wouldn't mind giving this one a try. Would it be preferred that they generate identity matrices or 0 matrices as defaults?
from nalgebra.
I just picked up this library and came across this issue as well.
Just running the following line:
let x = nalgebra::SVector::<f64, 37>::default();
fails with the following:
error[E0599]: the function or associated item `default` exists for struct `Matrix<f64, Const<37>, Const<1>, ArrayStorage<f64, 37, 1>>`, but its trait bounds were not satisfied
--> src\bin\main.rs:136:51
|
136 | let x = nalgebra::SVector::<f64, 37>::default();
| ^^^^^^^ function or associated item cannot be called due to unsatisfied trait bounds
|
::: C:\Users\acxz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\nalgebra-0.32.3\src\base\array_storage.rs:46:1
|
46 | pub struct ArrayStorage<T, const R: usize, const C: usize>(pub [[T; R]; C]);
| ---------------------------------------------------------- doesn't satisfy `ArrayStorage<f64, 37, 1>: Default`
|
::: C:\Users\acxz\.cargo\registry\src\index.crates.io-6f17d22bba15001f\nalgebra-0.32.3\src\base\matrix.rs:175:1
|
175 | pub struct Matrix<T, R, C, S> {
| ----------------------------- doesn't satisfy `_: Default`
|
= note: the following trait bounds were not satisfied:
`ArrayStorage<f64, 37, 1>: Default`
which is required by `Matrix<f64, Const<37>, Const<1>, ArrayStorage<f64, 37, 1>>: Default`
Values up to 32 do work however, looks like for static vectors, default
isn't implemented for sizes up to 64.
Would implementing this be feasible and part of the roadplan?
Edit: going through the code I see that values up to 127 are included:
nalgebra/src/base/dimension.rs
Lines 325 to 334 in f404bcb
Is there a reason or has it been simply overlooked that sizes above 32 do not implement the default
trait?
from nalgebra.
Related Issues (20)
- Floating point truncation in IsometryMatrix inverse HOT 4
- `a.norm_squared()` and `a.dot(&a)` generates different code for vectors of real floats
- Implement `bytemuck::Pod` and `bytemuck::Zeroable` for statically known transformations such as `Isometry`
- Incorrect docs for `nalgebra_sparse::factorization::CscCholesky::{solve, solve_mut}`
- Failed proptest on CI: linalg::eigen::proptest_tests::f64::symmetric_eigen_static_square_3x3 HOT 1
- Make the lapack SVD struct public? HOT 10
- Sparse COO Matrix `try_from_triplets` could have `from_iterator` HOT 1
- eigenvalues() hangs with all 0's
- Does nalgebra provide a linspace function? HOT 1
- `Rotation3::from_euler_angles_ordered`
- Rotation3 angle from 2 vectors
- How to compute determinant of an SMatrix? HOT 2
- Use the SemVer trick
- numpy solve/scipy solve/ LAPACK GESV HOT 1
- Nalgebra compile error in release mode only HOT 1
- [feature request] Add pseudo determinant HOT 1
- add symmetric_eigen_unordered
- Macros for RowVector and RowDVector
- Alga traits not implemented by statically-sized matrices/vectors? HOT 5
- Incorrect results from pseudo_inverse HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nalgebra.