A lightweight, high-performance linear algebra and tensor library built from scratch in Rust. NumRS provides an intuitive API, automatic parallelism for large matrices, and a clean modular design.
- 2D Matrix & N-D Tensor: Specialized
Matrixfor linear algebra and genericTensor<T>for multi-dimensional data. - Intuitive Syntax: Create matrices with the
ns_array!macro — just like Python/NumPy. - Automatic Parallelism: Silently scales across CPU cores using Rayon for large-scale computations.
- Robust Math: Transpose, Determinant, Inverse (Gauss-Jordan), Norm, and Hadamard product.
- Beautiful Output: Colored terminal display with automatic column alignment.
- Reference-First Operators: Clean arithmetic (
a + b,a * b) with zero unnecessary clones.
use numrs::{ns_array, Matrix};
fn main() {
let a = ns_array![[1, 2], [3, 4]];
let b = Matrix::eye(2);
let result = &a * &b;
println!("A x I =\n{}", result);
}- Usage Guide — Detailed API documentation for all modules.
- Examples — Practical recipes for solving linear systems, Markov chains, transformations, and more.
- Changelog — History of releases and recent changes.
- Matrix struct with colored Display
- Full operator support (Add, Sub, Mul, Scalar)
- Constructors (zeros, ones, eye, rand)
- Determinant and Inverse
- Automatic parallelism via Rayon
- Comprehensive error handling
- [/] Tensor Support (In Development)
- Eigenvalues and eigenvectors
- LU / QR decomposition
- ML layer: ReLU, softmax, gradient tracking
MIT