Linear algebra package for rust-ndarray using LAPACK binding
Rust
Clone or download
Latest commit 4f273ac Jul 11, 2018
Permalink
Failed to load latest commit information.
.circleci Fix Jun 10, 2018
examples Format all May 6, 2018
src Use sample instead of ind_sample Jun 28, 2018
tests Format all May 6, 2018
.gitignore Migrate to lapacke library Dec 19, 2017
.gitmodules Remove doc submodule Nov 11, 2016
Cargo.toml Update procedurals Jul 10, 2018
LICENSE Initial commit Oct 3, 2016
README.md Update README.md Jun 10, 2018
rust-toolchain Use stable channel Jun 10, 2018
rustfmt.toml Use stable channel Jun 10, 2018

README.md

ndarray-linalg

Crate docs.rs CircleCI Gitter chat

Linear algebra package for Rust with rust-ndarray.

LAPACKE Backend

Currently three LAPACKE implementations are supported and tested:

  • 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 two ways to link LAPACKE backend:

backend features (recommended)

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

[depencdencies]
ndarray = "0.11"
ndarray-linalg = { version = "0.9", features = ["openblas"] }

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.

[depencdencies]
ndarray = "0.11"
ndarray-linalg = "0.9"
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

For librarian

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

[depencdencies]
ndarray = "0.11"
ndarray-linalg = { version = "0.9", default-features = false }

However, if you hope simplicity instead of the flexibility, you can link your favorite backend in the way described above.

Tests and Examples

To run tests or examples for ndarray-linalg, you must specify the desired backend. For example, you can run the tests with the OpenBLAS backend like this:

cargo test --features=openblas

Examples

See examples directory.

Note that to run an example, you must specify the desired backend. For example, you can run the the solve example with the OpenBLAS backend like this:

cargo run --example solve --features=openblas