use mathru::{ algebra::linear::{ matrix::{General, LUDec, Solve}, vector::Vector, }, matrix, vector, }; /// Solves a system of linear equations fn main() { let a: General = matrix![ 6.0, 2.0, -1.0; -3.0, 5.0, 3.0; -2.0, 1.0, 3.0]; let b: Vector = vector![48.0; 49.0; 24.0]; // Decompose a into a lower and upper matrix let lu_dec: LUDec = a.dec_lu().unwrap(); // Solve the system of linear equations with the decompose matrix let _x1: Vector = lu_dec.solve(&b).unwrap(); // Solve it directly let _x2: Vector = a.solve(&b).unwrap(); }