sprs
Library Featured
A sparse matrix library
- Downloads
- 974,572
- Dependents
- 107
- Stars
- 653
- Forks
- 51
- Contributors
- 30
- Commits
- 1,227
- Latest release
- 0.11.6 ·
About
sprs, sparse matrices for Rust
sprs implements some sparse matrix data structures and linear algebra algorithms in pure Rust.
The API is a work in progress, and feedback on its rough edges is highly appreciated :)
Features
Structures
- CSR/CSC matrix
- triplet matrix
- Sparse vector
Operations
- sparse matrix / sparse vector product
- sparse matrix / sparse matrix product
- sparse matrix / sparse matrix addition, subtraction
- sparse vector / sparse vector addition, subtraction, dot product
- sparse/dense matrix operations
Algorithms
- Outer iterator on compressed sparse matrices
- sparse vector iteration
- sparse vectors joint non zero iterations
- simple sparse Cholesky decomposition (requires opting into an LGPL license)
- sparse triangular solves with dense right-hand side
Examples
Matrix construction
use sprs::{CsMat, CsMatOwned, CsVec};
let eye : CsMatOwned<f64> = CsMat::eye(3);
let a = CsMat::new_csc((3, 3),
vec![0, 2, 4, 5],
vec![0, 1, 0, 2, 2],
vec![1., 2., 3., 4., 5.]);
Matrix vector multiplication
Read the full README
use sprs::{CsMat, CsVec};
let eye = CsMat::eye(5);
let x = CsVec::new(5, vec![0, 2, 4], vec![1., 2., 3.]);
let y = &eye * &x;
assert_eq!(x, y);
Matrix matrix multiplication, addition
use sprs::{CsMat, CsVec};
let eye = CsMat::eye(3);
let a = CsMat::new_csc((3, 3),
vec![0, 2, 4, 5],
vec![0, 1, 0, 2, 2],
vec![1., 2., 3., 4., 5.]);
let b = &eye * &a;
assert_eq!(a, b.to_csr());
For a more complete example, be sure to check out the heat diffusion example.
Documentation
Documentation is available at docs.rs.
Changelog
See the changelog.
Minimum Supported Rust Version
The minimum supported Rust version currently is 1.64. Prior to a 1.0 version, bumping the MSRV will not be considered a breaking change, but breakage will be avoided on a best effort basis.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Please see the contribution guidelines for additional information about contributing.
Compatibility
- Runs on
- GPU support unknown
What shows it
- no dependency or feature matches a backend row
- Native code
- None found
- No native code found
- Python bindings
- No Python binding crate found
- License
- Apache-2.0 OR MIT
Compare with similar projects
Order: strongest tier first, then most downloads, then name, with unmeasured values last. A library counts downloads over 30 days. An app counts binary downloads per release. An app with none counts its crate downloads over 30 days. ML Rust runs this catalogue, so its closest project always gets a row.
| Project | Downloads | Dependents | Stars | Latest release | Runs on (GPU) | Native code | License |
|---|---|---|---|---|---|---|---|
|
A sparse matrix library |
974,572 downloads over 30 days | 107 | 653 | 0.11.6 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
nalgebra Featured
General-purpose linear algebra library with transformations and statically-sized or dynamically-sized matrices. |
6,251,820 downloads over 30 days | 2,119 | 4,810 | 0.35.0 | GPU support unknown | Binds native code: blas-sys, lapack-sys, defmt (feature defmt) | Apache-2.0 |
|
statrs Featured
Statistical computing library for Rust |
4,515,476 downloads over 30 days | 444 | 839 | 0.19.1 | GPU support unknown | No native code found | MIT |
|
rustfft Featured
High-performance FFT library written in pure Rust. |
4,266,035 downloads over 30 days | 571 | 963 | 6.4.1 | GPU support unknown | No native code found | Apache-2.0 OR MIT |
|
faer Featured
linear algebra library |
633,735 downloads over 30 days | 327 | Not measured | 0.24.4 | GPU support unknown | No native code found | MIT |
|
peroxide Listed
Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with familiar syntax Python bindings |
56,548 downloads over 30 days | 9 | 732 | 0.43.1 | GPU support unknown | Binds native code: openblas-src (feature O3-openblas-system), blas-sys (feature O3), hdf5-metno-sys (feature nc), lapack-sys (feature O3), libz-sys (feature nc) and 1 more | Apache-2.0 OR MIT |
|
numr Listed
The base for numerical code in Rust, in the role NumPy has in Python: n-dimensional tensors, linear algebra, FFT, statistics and autograd on CPU, CUDA and WebGPU. The backends use native kernels, with no cuBLAS, MKL or other vendor math library. |
1,673 downloads over 30 days | 7 | 59 | 0.15.2 | CUDA, WebGPU | Binds native code: ring (feature distributed) | Apache-2.0 |
Why FeaturedIt passes every Featured gate.
What it meets
- It has 63 active dependents and 45 new dependents in 365 days. Featured needs 11 active dependents or 9 new dependents in 365 days.
- Active dependents are at 100% of their peak. Featured needs at least 50%.
- Docs are present. The release commit or a manifest ties the crate to the repository.
- No vulnerability advisory stays unpatched past the grace window. At least one version is neither a prerelease nor 0.0.x.
- The last activity is on 20 Oct 2026, 20 days ago. The rules expect an update within 1800 days. Dormancy rule
Exact rules: Featured library. The check on applied thresholds version 9.
Every rule outcome, as the check records it
expected-interval: version 0.11.6 base 450, doubled for 974572 downloads per month, doubled for 63.17 active users: E = 1800 daysdormancy: last activity 2026-10-20, 20 days ago, E = 1800: activefeatured: featured: active_users 63.17, new_adopters 45, former_glory 1
Measurements and sources
Each signal row shows the raw value, its source and the fetch date. The Sources list gathers every distinct source on this page. Movement needs more history.
Sources6 sources
- Description: the crates.io description
- crates.io database dump, fetched
- RustSec advisory database, fetched
- GitHub repository, fetched
- crates.io package, fetched
- GitHub contributors, fetched
Adoption63 active dependents, 45 new dependents in 365 days1 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Active dependents | 63.1667 | crates.io database dump | Yes | |
| New dependents (365 days) | 45 | crates.io database dump | Yes | |
| Peak active dependents | 62.1667 | crates.io database dump | Yes | |
| Active dependents as a share of the peak | 1 | crates.io database dump | Yes | |
| Binary downloads per release | Not measured | Yes |
MaintenanceLatest human commit: 20 days ago3 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Latest human commit | 2026-10-20 | GitHub repository | Yes | |
| Latest release | 2026-10-13 | crates.io database dump | Yes | |
| First release | 2015-07-03 | crates.io database dump | Yes | |
| Latest version | 0.11.6 | crates.io database dump | Yes | |
| Days the oldest outside issue waits for a reply | 1872 | GitHub repository | Yes | |
| Maintainer replies over 365 days | 5 | GitHub repository | Yes | |
| Repository archived | false | GitHub repository | Yes | |
| Repository gone | false | GitHub repository | Yes | |
| Release commit or manifest in the repo | true | crates.io package | Yes | |
| Published docs | true | crates.io database dump | Yes | |
| Latest release fails cargo check | Not measured | Yes | ||
| Build check date | Not measured | Yes | ||
| Build check toolchain | Not measured | Yes |
SecurityUnpatched vulnerabilities: none
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Unpatched vulnerabilities past the grace window | none | RustSec advisory database | Yes | |
| RustSec unmaintained advisory | none | RustSec advisory database | Yes | |
| Deprecation notice | none | crates.io database dump | Yes | |
| Deprecated requirement | none | crates.io database dump | Yes |
Distribution41 releases, 974,572 downloads over 30 days5 not measured
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| Releases | 41 | crates.io database dump | Yes | |
| Downloads over 30 days | 974572 | crates.io database dump | Yes | |
| Binary downloads over the last 3 releases | Not measured | Yes | ||
| Homebrew installs on request over 365 days | Not measured | Yes | ||
| Repology repository families | Not measured | Yes | ||
| Docker pull growth over 90 days | Not measured | Yes | ||
| Docker pulls at the growth baseline | Not measured | Yes | ||
| Every version a prerelease | false | crates.io database dump | Yes | |
| Every version 0.0.x | false | crates.io database dump | Yes | |
| Every version yanked | false | crates.io database dump | Yes | |
| Crate deleted from crates.io | false | crates.io database dump | Yes |
Repository653 stars, 51 forks, 30 contributors, 1,227 commits. Stars alone never qualify a project.
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| GitHub stars | 653 | GitHub repository | Yes — one part of the repository route | |
| GitHub forks | 51 | GitHub repository | Yes — one part of the repository route | |
| Contributors with a GitHub account | 30 | GitHub contributors | Yes — one part of the repository route | |
| Commits on the default branch | 1227 | GitHub repository | No | |
| Repository's main crate left out of the entry | none | crates.io database dump | Yes |
Facts that never count
| Signal | Value | Source | Fetched | Counts |
|---|---|---|---|---|
| License | Apache-2.0 OR MIT | crates.io database dump | No | |
| Runs on, from listed crates and their direct dependencies | GPU support unknown | crates.io database dump | No | |
| What shows each backend | no dependency or feature matches a backend row | crates.io database dump | No | |
| Native code, from listed crates and their dependencies | No native code found | crates.io database dump | No | |
| Python bindings, from direct dependencies of listed crates | No Python binding crate found | crates.io database dump | No | |
| Crates that depend on a listed crate directly | 107 | crates.io database dump | No |
Corrections and review history
No correction applies to this entry.
Judgments
A judgment enters only through an approved issue and a merged pull request.
No judgment applies to this entry.