#ndarray #lapack #matrix

ndarray-linalg

Linear algebra package for rust-ndarray using LAPACK

25 unstable releases (9 breaking)

0.10.0 Sep 1, 2018
0.9.0 Jan 12, 2018
0.8.0 Dec 20, 2017
0.7.1 Oct 26, 2017
0.1.5 Nov 28, 2016

#57 in Algorithms

Download history 39/week @ 2019-01-19 27/week @ 2019-01-26 42/week @ 2019-02-02 48/week @ 2019-02-09 63/week @ 2019-02-16 55/week @ 2019-02-23 196/week @ 2019-03-02 26/week @ 2019-03-09 86/week @ 2019-03-16 416/week @ 2019-03-23 15/week @ 2019-03-30 141/week @ 2019-04-06 22/week @ 2019-04-13 52/week @ 2019-04-20 35/week @ 2019-04-27

386 downloads per month
Used in 13 crates (10 directly)

MIT license

113KB
3K SLoC

ndarray-linalg

CircleCI Crate docs.rs

Linear algebra package for Rust with ndarray based on external LAPACK implementations.

Examples

See examples directory.

Note: To run examples, you must specify which backend will be used (as described below). For example, you can execute the solve example with the OpenBLAS backend like this:

cargo run --example solve --features=openblas

and run all tests of ndarray-linalg with OpenBLAS

cargo test --features=openblas

BLAS/LAPACK Backend

Three BLAS/LAPACK implementations are supported:

  • OpenBLAS
    • needs gfortran (or other Fortran compiler)
  • Netlib
    • needs cmake and gfortran
  • Intel MKL (non-free license, see the linked page)
    • needs curl

There are three features corresponding to the backend implementations (openblas / netlib / intel-mkl):

[dependencies]
ndarray = "0.12"
ndarray-linalg = { version = "0.10", features = ["openblas"] }

For librarian

If you creating a library depending on this crate, we encourage you not to link any backend:

[dependencies]
ndarray = "0.12"
ndarray-linalg = "0.10"

Link backend crate manually

For the sake of linking flexibility, you can provide LAPACKE implementation (as an extern crate) yourself. You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.

[dependencies]
ndarray = "0.12"
ndarray-linalg = "0.10"
openblas-src = "0.5" # or another backend of your choice

You must add extern crate to your code in this case:

extern crate ndarray;
extern crate ndarray_linalg;
extern crate openblas_src; // or another backend of your choice

Dependencies

~33MB
~721K SLoC