Sukker - Linear Algebra library written in rust

Build Status Documentation Crates.io Coverage Status Maintenance License

Linear algebra in Rust!

Parallelized using rayon with support for many common datatypes, sukker tries to make matrix operations easier for the user, while still giving you as the user the performance you deserve.

Basic operations on sparse matrices are also supported now

Need a feature? Please let me/us know!

Why V2 already?

With added error handling and a good amount of rewriting, a major version was due to avoid any confusion.

Examples

Dens Matrices

```rust use sukker::{LinAlgFloats, Matrix};

fn main() { let a = Matrix::::randomize((8, 56)); let b = Matrix::::randomize((56, 8));

let c = a.matmul(&b).unwrap();

let res = c.sin().exp(3).unwrap().pow(2).add_val(4.0).abs();

// To print this beautiful matrix:
res.print(5);

} ```

Sparse Matrices

```rust use std::collections::HashMap; use sukker::{SparseMatrix, SparseMatrixData};

fn main() { let mut indexes: SparseMatrixData = HashMap::new();

indexes.insert((0, 1), 2.0);
indexes.insert((1, 0), 4.0);
indexes.insert((2, 3), 6.0);
indexes.insert((3, 3), 8.0);

let sparse = SparseMatrix::<f64>::init(indexes, (4, 4));

sparse.print(3);

} ```

More examples can be found here

Documentation

Full API documentation can be found here.

Features