feat: matrix math

mul: impl Mul for LHS: i32, RHS: Matrix
trait: trait MatrixMath definition for cofactor, minors, adjoint,
determinant
This commit is contained in:
Zhongheng Liu 2025-01-25 12:42:03 +02:00
commit 1166581975
Signed by: steven
GPG key ID: 805A28B071DAD84B
3 changed files with 87 additions and 44 deletions

View file

@ -9,7 +9,7 @@
//!
//! Examples:
//! ```
//! use matrix::Matrix;
//! use matrix::{Matrix, MatrixMath};
//! use std::str::FromStr;
//! let m = Matrix::from_str("1,2,3\n4,5,6\n7,8,9").expect("Expected this to work");
//! println!("Matrix string formatting:\n{}", m);
@ -24,8 +24,11 @@ pub mod error;
#[cfg(test)]
mod tests;
pub use matrix::Matrix;
pub use matrix::{Matrix, MatrixMath};
pub fn test() {
println!("Testing code here");
let m = Matrix::from(vec![1,2,3,4,5]);
m.transpose();
m.determinant();
}