| Crates.io | lin_algebra |
| lib.rs | lin_algebra |
| version | 0.2.0 |
| created_at | 2025-06-30 00:33:12.730934+00 |
| updated_at | 2025-07-01 14:41:55.537051+00 |
| description | A linear algebra package to compute image, kernel and rank of linear applications. |
| homepage | https://github.com/LucaBonamino/lin_algebra |
| repository | https://github.com/LucaBonamino/lin_algebra |
| max_upload_size | |
| id | 1731268 |
| size | 17,297 |
A Rust library for linear algebra.
All operations are currently implemented for matrices over GF(2):
Add the dependency to your Cargo.toml:
[dependencies]
lin_algebra = "0.2.0"
use lin_algebra::gf2_matrix::GF2Matrix;
use lin_algebra::matrix::MatrixTrait;
fn main() {
// Reduces echelon form
let gf2_mat = gf2_matrix::GF2Matrix::new(
vec![vec![1,0,0,0], vec![0,1,0,1], vec![0,1,0,1]]
)
let (educed_echelon_form, row_operations) = gf2_mat.echelon_form();
println!("Reduces echelon form {:?}", educed_echelon_form);
println!(
"Row operation applied to reach the reduces echelon form {:?}", row_operations
);
// Kernel
println!("Kenel {:?}", gf2_mat.kernel());
// Image
println!("Image {:?}", gf2_mat.image());
// Rank
println!("Rank {}", gf2_mat.rank());
}
MIT