3 ms·
I started writing a test case, and discovered that crate "algebloat" won't even compile on stable rust 1.14.0. (It uses features "rustc_private" and "test".) I
by Animats 10y ago
I started writing a test case, and discovered that crate "algebloat" won't even compile on stable rust 1.14.0. (It uses features "rustc_private" and "test".) It looks like this crate was never finished.
This is the other problem with not having built-in multidimensional arrays. There are so many implementations to choose from. Here's the list of all 34 Rust matrix math packages.[1]
Looking at crate "matrixmultiply", it's all unsafe code.[2] That's because it's C written in Rust:
pub unsafe fn sgemm(
m: usize, k: usize, n: usize,
alpha: f32,
a: *const f32, rsa: isize, csa: isize,
b: *const f32, rsb: isize, csb: isize,
beta: f32,
c: *mut f32, rsc: isize, csc: isize)
Arrays? What arrays? Raw pointers are good enough, right? What could possibly go wrong?
Still trying to find a package with a matrix multiply in safe Rust code with the subscript checks optimized out.
Update: checked crate "ndarray". Indexing is unsafe.[3]
Update: checked crate "matrices". Empty project.
Update: Checked "scirust" - more raw pointer manipulation.[4]
Not finding real-world matrix libraries in which all those fantastic checking optimizations are used and working. I'd like to see that stuff in action.
[1] https://libraries.io/search?keywords=matrix&languages=Rust https://libraries.io/search?keywords=matrix&languages=Rust
[2] https://docs.rs/crate/matrixmultiply/0.1.13/source/src/gemm.rs https://docs.rs/crate/matrixmultiply/0.1.13/source/src/gemm....
[3] https://github.com/bluss/rust-ndarray/blob/master/src/dimension/ndindex.rs https://github.com/bluss/rust-ndarray/blob/master/src/dimens...
[4] https://github.com/indigits/scirust/blob/master/src/matrix/matrix.rs https://github.com/indigits/scirust/blob/master/src/matrix/m...