All Projects → vbarrielle → Sprs

vbarrielle / Sprs

Licence: other
sparse linear algebra library for rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Sprs

Gust
A small charting/visualization tool and partial vega implementation for Rust
Stars: ✭ 116 (-48.21%)
Mutual labels:  rust-library
Mtpng
A parallelized PNG encoder in Rust
Stars: ✭ 151 (-32.59%)
Mutual labels:  rust-library
Wither
An ODM for MongoDB built on the official MongoDB Rust driver.
Stars: ✭ 174 (-22.32%)
Mutual labels:  rust-library
Tera
A template engine for Rust based on Jinja2/Django
Stars: ✭ 1,873 (+736.16%)
Mutual labels:  rust-library
Sm
🚀 SM – a static State Machine library
Stars: ✭ 149 (-33.48%)
Mutual labels:  rust-library
Atty
are you or are you not a tty?
Stars: ✭ 153 (-31.7%)
Mutual labels:  rust-library
Rustplotlib
A pure Rust visualization library inspired by D3.js
Stars: ✭ 87 (-61.16%)
Mutual labels:  rust-library
Mocktopus
Mocking framework for Rust
Stars: ✭ 179 (-20.09%)
Mutual labels:  rust-library
Tentacle
A multiplexed p2p network framework that supports custom protocols
Stars: ✭ 150 (-33.04%)
Mutual labels:  rust-library
Duckscript
Simple, extendable and embeddable scripting language.
Stars: ✭ 169 (-24.55%)
Mutual labels:  rust-library
Kernel Roulette
A kernel module written in Rust
Stars: ✭ 124 (-44.64%)
Mutual labels:  rust-library
Roperator
Experimental Kubernetes Operator kit written in Rust
Stars: ✭ 146 (-34.82%)
Mutual labels:  rust-library
Pdb
A parser for Microsoft PDB (Program Database) debugging information
Stars: ✭ 156 (-30.36%)
Mutual labels:  rust-library
Bifrost
Pure rust building block for distributed systems
Stars: ✭ 118 (-47.32%)
Mutual labels:  rust-library
Rust S3
Rust library for interfacing with AWS S3 and other API compatible services
Stars: ✭ 177 (-20.98%)
Mutual labels:  rust-library
Grammers
(tele)gramme.rs - use Telegram's API from Rust
Stars: ✭ 109 (-51.34%)
Mutual labels:  rust-library
Neovim Lib
Rust library for Neovim clients
Stars: ✭ 152 (-32.14%)
Mutual labels:  rust-library
Spartan
Spartan: High-speed zkSNARKs without trusted setup
Stars: ✭ 211 (-5.8%)
Mutual labels:  rust-library
Rust Delegate
Rust method delegation with less boilerplate
Stars: ✭ 177 (-20.98%)
Mutual labels:  rust-library
Grex
A command-line tool and library for generating regular expressions from user-provided test cases
Stars: ✭ 4,847 (+2063.84%)
Mutual labels:  rust-library

sprs, sparse matrices for Rust

Build status crates.io

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

  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.42. 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

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].