Users guide  Documentation  Forum
Linear algebra library for the Rust programming language.
Click this button if you wish to donate to support the development of nalgebra:
Category: Rust / Computation 
Watchers: 53 
Star: 3.1k 
Fork: 379 
Last update: Mar 14, 2023 
Users guide  Documentation  Forum
Linear algebra library for the Rust programming language.
Click this button if you wish to donate to support the development of nalgebra:
https://github.com/rustsim/nalgebra/issues/520
First time contributing to library and relearning rust. Will take any and all advice.
Is there an equivalent to cgmath's Matrix4::look_at
function?
fn look_at(eye: &Point3<S>, center: &Point3<S>, up: &Vector3<S>) > Matrix4<S>
see https://github.com/kvark/mint
I am seriously considering transitioning from my cgmath
library to nalgebra, seeing as it is now insanely well polished, and it would allow me to use your collision and physics stuff without having to reinvent the wheel. Some of the things I love about cgmath
though is:
(*) : Point a > a > Point a
(/) : Point a > a > Point a
(+) : Point a > Vector a > Point a
() : Point a > Point a > Vector a
These things don't really make sense for a linear algebra library, but is it possible that we could have a separate library for these?
Currently, nalgebra
tends to use 3letter or 4letter names for all the algebraic entities (e.g. Vec, Mat, Rot, Quat, etc.) Unfortunately, this naming convention is not very (not at all actually) explicit for some structures like (direct) isometries Iso
and the recently added similarity transformations Sim
.
Thus, I now think that full names would be much better as they would make the code more readable, and would help users to find what he wants on the documentation. For example, I doubt that anyone reading the documentation would guess at first glance that Sim
is a transformation.
So I would like to know if current users would be in favor of full names instead of the current ones! Of course, if the majority seems to agree with this change, it would break every single project using nalgebra
.
Please, I would prefer that nobody make announcements on blogs about this (in reddit, hackernews, etc.) before the release on crates.io which will occur during the second half of august.
All the following are currently implemented on the linalg branch of nalgebra.
Since the last large release #218 of nalgebra, I've been working slowly but thoroughly on a few features that makes a step toward making nalgebra more useful for generalpurpose linear algebra. This includes three major features:
Of course, all those work on staticallysized matrices as well as dynamicallysized matrices! I alsow want to note that none of this would have been possible without the amazing typenum crate which allows addition/subtraction/minimum of typelevel integers.
This new version of nalgebra will include purerust implementations of the following factorization for real matrices ("general matrices" designates realvalued matrices that may be rectangular):
All those are implemented in the linalg folder. Note that as far as I know, the only other crate that implements those factorization in pureRust is rulinalg written by @AtheMathmo and @Andlon. Refer to the next post for benchmarks showing the performances of nalgebra compared to rulinalg.
I'd like to move the nalgebralapack crate to the main nalgebra github repository to simplify the task of keeping them in sync. The next nalgebralapack version has been updated and I intend to make it contain at least all the decompositions implemented in Rust and expose similar interfaces to the user. It is not finished. Currently, it contains: Cholesky, Hessenberg, LU, QR, Eigendecomposition of real matrices, SVD.
This adds the ability to resize a matrix or insert/remove rows and columns. For dynamicallysized matrices (allocated on the heap), the preexisting buffer is reallocated (i.e. the underlying Vec
is shrink or expanded.)
The ability to fill different parts of the matrices are added as well:
As a side note, I discovered Patreon only recently so I set up a page for my projects: https://www.patreon.com/sebcrozet Any financial aid is greatly appreciated.
The release is planed for the second half of august. Indeed, I still have to write documentations (including a new page on the nagebra users guide) and refine the API. Any feedback before the release would be very useful to improve the quality of the actual release.
I would be nice to implement matrix exponential for complex matrices as well :)
> src/main.rs:9:7

9  a.exp();
 ^^^ method not found in `nalgebra::Matrix<nalgebra::Complex<{float}>, nalgebra::U2, nalgebra::U2, nalgebra::ArrayStorage<nalgebra::Complex<{float}>, nalgebra::U2, nalgebra::U2>>`
https://docs.rs/nalgebra/0.21.0/nalgebra/geometry/struct.Isometry.html#method.look_at_lh
It says "right handed", but it should say "left handed".
Can we have argsort support please?
https://play.rustlang.org/?version=nightly&mode=debug&edition=2018&gist=6e82220f978f5d5fcf7e56d7375fcae4
I ported some ideas from LAPACK's QR implementation, more specifically from ?ORG2R
.
As a result I could increase all epsilons in the test by two order of magnitudes. Also the full computation of the Q
matrix is now supported, not only the first min(n, m)
columns. I added a new method q_columns
for this. The current q()
method stayed the same.
The main difference in the implementation seems to be that LAPACK applies the scaling of the Householder vectors at a different point in the code.
qr_internal
)R
and Q
.work
. This resulted in additional allocator bounds. See discussion below.q_tr_mul
borrows self mutably due to an implementation detail although the struct's state will only be changed temporarily inside the method. Ideas to resolve this:
gerc
and gemv
call (possible performance penalty)work
allocations could be done only once by storing a suitable vector in the struct and sharing it. This will result in &mut self
or interior mutability.I compared a few implementations of LAPACK and nalgebra. Often LAPACK does additional work for handling for exampe overflow or different scales. Would you be interested in having some of those ideas ported to nalgebra? This usually comes with a (potential) performance penalty.
Some examples:
norm_squared
vs DNRM2
DGEQR2
I could port something if you are interested? I would start with the QR implementation and the subroutines used.
Many operations expected the numeric type N
to implement ClosedAdd
and/or ClosedSub
.
This commit replaces some of these with the less restrictive Simple{Add,Sub}
, which does not require {Add,Sub}Assign
.
This partially addresses #719.