.. image:: https://travis-ci.org/vbarrielle/sprs.svg?branch=master :target: https://travis-ci.org/vbarrielle/sprs
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 :)
Structures ..........
Operations ..........
Algorithms ..........
Matrix construction
.. code-block:: rust
use sprs::{CsMat, CsMatOwned, CsVec};
let eye : CsMatOwned
Matrix vector multiplication
.. code-block:: rust
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
.. code-block:: rust
use sprs::{CsMat, CsVec}; let eye = CsMat::eye(3); let a = CsMat::newcsc((3, 3), vec![0, 2, 4, 5], vec![0, 1, 0, 2, 2], vec![1., 2., 3., 4., 5.]); let b = &eye * &a; asserteq!(a, b.to_csr());
For a more comple example, be sure to check out the heat diffusion
_ example.
.. _heat diffusion
: examples/heat.rs
Documentation is available at docs.rs_.
.. _docs.rs: https://docs.rs/sprs
See the changelog_.
.. _changelog: changelog.rst
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.