Crates.io | matriz |
lib.rs | matriz |
version | 0.0.2 |
source | src |
created_at | 2023-03-10 12:19:56.471077 |
updated_at | 2023-05-09 23:54:07.186188 |
description | Zero allocation Rust linear algebra library |
homepage | |
repository | https://github.com/reu/matriz |
max_upload_size | |
id | 806403 |
size | 21,078 |
Typesafe and simple linear algebra library, with no-std support.
Disclaimer: this library is intendend for educational porpouses. For production grade implementations just go with nalgebra.
Key feature is that matrices dimensions are encoded on the type, and transformations generate proper typed results.
use matriz::Matrix;
#[rustfmt::skip]
let m1 = Matrix::from_rows([
[1, -2, 4],
[5, 0, 3],
]);
#[rustfmt::skip]
let m2 = Matrix::from_rows([
[ 1],
[ 5],
[-1],
]);
let output = Matrix::from_rows([
[-13],
[ 2],
]);
assert_eq!(m1 * m2, output);