vectrix

Crates.io Version Docs.rs Latest Build Status

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!

Features

Example usage

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]); ```

License

Licensed under either of

at your option.