Expand description
Linear algebra abstractions for Numra.
This crate provides matrix operations and linear solvers built on faer.
§Design
The Matrix trait provides a backend-agnostic interface for matrix operations.
The primary implementation wraps faer’s Mat<S> type.
§Example
use numra_linalg::{Matrix, DenseMatrix};
// Create a 3x3 matrix
let mut a: DenseMatrix<f64> = DenseMatrix::zeros(3, 3);
a.set(0, 0, 2.0);
a.set(1, 1, 3.0);
a.set(2, 2, 4.0);
// Solve Ax = b
let b = vec![1.0, 2.0, 3.0];
let x = a.solve(&b).unwrap();
assert!((x[0] - 0.5).abs() < 1e-10);
assert!((x[1] - 2.0/3.0).abs() < 1e-10);
assert!((x[2] - 0.75).abs() < 1e-10);Author: Moussa Leblouba Date: 9 February 2026 Modified: 2 May 2026
Re-exports§
pub use iterative::bicgstab;pub use iterative::cg;pub use iterative::gmres;pub use iterative::minres;pub use iterative::pcg;pub use iterative::IterativeOptions;pub use iterative::IterativeResult;pub use preconditioner::IdentityPreconditioner;pub use preconditioner::Ilu0;pub use preconditioner::Jacobi;pub use preconditioner::Preconditioner;pub use preconditioner::Ssor;
Modules§
- iterative
- Iterative (Krylov) linear solvers for sparse systems.
- preconditioner
- Preconditioners for iterative linear solvers.
Structs§
- Cholesky
Factorization - Cholesky factorization A = L L^T for symmetric positive-definite matrices.
- Dense
Matrix - Dense matrix backed by faer.
- Eigen
Decomposition - General eigendecomposition (complex eigenvalues for real matrices).
- LUFactorization
- LU factorization of a matrix.
- QRFactorization
- QR factorization of a matrix.
- Sparse
Cholesky - Sparse Cholesky factorization for SPD systems.
- SparseLU
- Sparse LU factorization for solving Ax = b.
- Sparse
Matrix - CSC sparse matrix wrapping faer’s
SparseColMat. - SvdDecomposition
- Full SVD decomposition: A = U * diag(S) * V^T.
- SymEigen
Decomposition - Symmetric/Hermitian eigendecomposition (real eigenvalues).
- Thin
SvdDecomposition - Thin SVD decomposition: A = U * diag(S) * V^T.
Enums§
- Linalg
Error - Linear algebra specific errors.