Crates.io | mtrx |
lib.rs | mtrx |
version | 0.1.0 |
source | src |
created_at | 2021-03-19 23:47:08.965612 |
updated_at | 2021-03-19 23:47:08.965612 |
description | Provides type-safe matrix operations using const generics |
homepage | https://github.com/MayorMonty/mtrx |
repository | https://github.com/MayorMonty/mtrx |
max_upload_size | |
id | 371201 |
size | 19,590 |
Matrix operations using Rust's new const generics feature. Matrix sizes are determined at compile time, allowing better type checking.
Supported Operations
Note: currently, mtrx requires Nightly to work, as it makes use of the
#![feature(const_fn)]
let matrix_a = Matrix::new(
[[1, 2, 3],
[4, 5, 6]]
);
let matrix_b = Matrix::new(
[[7, 8],
[9, 10],
[11, 12]]
);
let result: Matrix<i32, 2, 2> = matrix_a.multiply(matrix_b);
assert_eq!(result.inner,
[[58, 64],
[139, 154]]
);