A stack-allocated, constant-size [Matrix<T, M, N>
] type implemented with const
generics.
This crate works on stable Rust from v1.51 onwards. It is pretty experimental right now and does not have the same level of features as others like it in the Rust ecosystem. But it useful for quick and dirty use cases, like Advent of Code. Contributions are welcome!
matrix!
/ vector!
macros that can be used in const
contexts.usize
and (usize, usize)
indexing..x
, .y
, etc.).The following demonstrates matrix multiplication.
```rust use vectrix::{matrix, row_vector, vector};
let v1 = vector![1, 2, 3]; // same as matrix![1; 2; 3]
let v2 = row_vector![4, 5, 6]; // same as matrix![4, 5, 6]
asserteq!( v1 * v2, matrix![ 4, 5, 6; 8, 10, 12; 12, 15, 18; ] ); asserteq!(v2 * v1, matrix![32]); ```
Licensed under either of
at your option.