4 ms·
Did you not check out `nalgebra`? https://docs.rs/nalgebra/0.10.1/nalgebra/ https://docs.rs/nalgebra/0.10.1/nalgebra/
by mmstick 10y ago
Did you not check out `nalgebra`?
https://docs.rs/nalgebra/0.10.1/nalgebra/ https://docs.rs/nalgebra/0.10.1/nalgebra/
- Animats 10y agoThat's mostly a library for small vectors for 3D graphics and such. (I once did one of those myself, for C++.[1]) There's some support for 2D matrices in "nalgebra", but with heavy use of "unsafe".[2] Every matrix package I've seen so far in Rust turns off subscript checking with unsafe code. [1] http://graphics.stanford.edu/courses/cs148-10-summer/algebra3.h http://graphics.stanford.edu/courses/cs148-10-summer/algebra... [2] https://docs.rs/crate/nalgebra/0.10.1/source/src/linalg/decompositions.rs https://docs.rs/crate/nalgebra/0.10.1/source/src/linalg/deco...
- mmstick 10y agoIs there a problem with doing that with unsafe code? You have to remember that unsafe doesn't mean unsafe in Rust. If a developer is choosing to use the unsafe keyword, it's merely telling the compiler that they know what they are doing and what they are doing is safe. One shouldn't automatically infer that unsafe code is bad or negative. It doesn't deserve the negative stigmatism that it's given.
- Animats 10y agoNo, it means the developer thinks they know that they are doing. Often, they don't. Read some CERT advisories for buffer overflows. There are hundreds of them. The whole point of Rust is to put an end to that.