-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Default for all matrix types in nalgebra
and nalgebra-sparse
#1204
Comments
This commit solves dimforge#1204 and implements the Default trait for CsMatrix, CscMatrix, SparsityPattern, VecStorage.
I wouldn't mind giving this one a try. Would it be preferred that they generate identity matrices or 0 matrices as defaults? |
I just picked up this library and came across this issue as well. let x = nalgebra::SVector::<f64, 37>::default(); fails with the following:
Values up to 32 do work however, looks like for static vectors, 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 |
Hello! I haven't checked back on this since the pull request, but yes I implemented the |
Currently,
VecStorage
has noDefault
impl, andCsrMatrix
,CscMatrix
etc. have no default impls.The text was updated successfully, but these errors were encountered: