MyMatrix
My simple matrix library that can perform fraction operations.
1. Attribute
- Name: MyMatrix.
- Language: Rust, requires version rustc >=
1.75.0
. - Goal: Write a simple matrix library that can perform fraction operations.
- Module: Vector, Matrix
- Style: Follow Rust's official recommended style.
- Test: Using rstest for unit testing and ensure that all tests passed.
- Security: There is no
unsafe
code block. - Document: Using
cargo doc --open
to open documents.
2. Usage
To use it, add the following lines to your Cargo.toml
file:
[]
= "0"
Some simple examples:
use *;
// Vector dot product
from * from; // 32
// Vector cross product
cross; // [-3 6 -3]
// Vector scalar product
from * from; // [2/5 4/5]
// Matrix rank
from.rank; // 2
// Matrix determinant
from.det; // 27
// Matrix inversion
from.inv;
/*
[[
-16/9 8/9 -1/9;
14/9 -7/9 2/9;
-1/9 2/9 -1/9;
]]
*/