const-alg and array-vec - a safe const generics implementation of N-D linear algebra
This library is very similar to aljabar (in fact it was inspired by it). It improves upon it by giving panic safety and elementwise access (edit: latest update of aljabar does have these properties, but it still leaks on panics, whereas const-alg does not leak on panics). Also it gives iterators over rows and columns!
This is backed by my second crate, array-vec, which is a minimal fixed capacity vector backed by an array.
https://crates.io/crates/const-alg
https://crates.io/crates/array-vec
You can create a matrix very simply, just do
use const_alg::Matrix;
Matrix(
[[0, 1, 2],
[3, 4, 5]]
)
and that will create a new 2x3 matrix!
I also have element access, iterators over both rows and columns of the matrix, as well as some functionality to do global operations on the matrix, like mapping to another matrix and combining two matricies together!
Posted Jun 29, 2019, 5:24 AM UTC · edited
Cool! Aljabar actually has element wise access by virtue of Vectors derefing their arrays. It also took me a bit but I managed to change the implementation to use MaybeUninit, so it should be panic safe now
Cool, last time I checked I didn't see that, but it's nice that it's there now!
I looked through your code again, and wow, much better than when I first saw it. One small thing, you will still leak memory on panics, but I don't think that matters much because mostly matrices deal with
Copytypes