From 7c11c3ff93cef12aae0c790dc0032c380b6d531a Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sun, 2 Sep 2018 03:00:43 +0900 Subject: [PATCH 1/4] Drop type annotation from example --- examples/eigh.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/eigh.rs b/examples/eigh.rs index 622d82d3..c9bcc941 100644 --- a/examples/eigh.rs +++ b/examples/eigh.rs @@ -6,7 +6,7 @@ use ndarray_linalg::*; fn main() { let a = arr2(&[[3.0, 1.0, 1.0], [1.0, 3.0, 1.0], [1.0, 1.0, 3.0]]); - let (e, vecs): (Array1<_>, Array2<_>) = a.clone().eigh(UPLO::Upper).unwrap(); + let (e, vecs) = a.clone().eigh(UPLO::Upper).unwrap(); println!("eigenvalues = \n{:?}", e); println!("V = \n{:?}", vecs); let av = a.dot(&vecs); From 9d1b0f839e004b8cf4082032212af33d6330cc70 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sun, 2 Sep 2018 03:01:27 +0900 Subject: [PATCH 2/4] ndarray-linalg = "0.10" --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6ba61a2..fc054ce7 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Currently three LAPACKE implementations are supported and tested: - needs `cmake` and `gfortran` - [Intel MKL](https://github.com/termoshtt/rust-intel-mkl) (non-free license, see the linked page) - needs `curl` + There are two ways to link LAPACKE backend: ### backend features (recommended) @@ -26,7 +27,7 @@ There are three features corresponding to the backend implementations (`openblas ```toml [dependencies] ndarray = "0.12" -ndarray-linalg = { version = "0.9", features = ["openblas"] } +ndarray-linalg = { version = "0.10", features = ["openblas"] } ``` ### link backend crate manually @@ -36,7 +37,7 @@ You should link a LAPACKE implementation to a final crate (like binary executabl ```toml [dependencies] ndarray = "0.12" -ndarray-linalg = "0.9" +ndarray-linalg = "0.10" openblas-src = "0.5" # or another backend of your choice ``` @@ -55,7 +56,7 @@ If you creating a library depending on this crate, we encourage you not to link ```toml [dependencies] ndarray = "0.12" -ndarray-linalg = { version = "0.9", default-features = false } +ndarray-linalg = { version = "0.10", default-features = false } ``` However, if you hope simplicity instead of the flexibility, you can link your favorite backend in the way described above. From 3628739607aadff765c128a83e0db7b39702dcb7 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sun, 2 Sep 2018 03:13:10 +0900 Subject: [PATCH 3/4] Sort sections --- README.md | 74 ++++++++++++++++++++++++------------------------------- 1 file changed, 32 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index fc054ce7..23eff659 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,32 @@ ndarray-linalg =============== +[![CircleCI](https://circleci.com/gh/termoshtt/ndarray-linalg.svg?style=shield)](https://circleci.com/gh/termoshtt/ndarray-linalg) [![Crate](http://meritbadge.herokuapp.com/ndarray-linalg)](https://crates.io/crates/ndarray-linalg) [![docs.rs](https://docs.rs/ndarray-linalg/badge.svg)](https://docs.rs/ndarray-linalg) -[![CircleCI](https://circleci.com/gh/termoshtt/ndarray-linalg.svg?style=shield)](https://circleci.com/gh/termoshtt/ndarray-linalg) -[![Gitter chat](https://badges.gitter.im/termoshtt-scirust/ndarray-linalg.png)](https://gitter.im/termoshtt-scirust/ndarray-linalg) -Linear algebra package for Rust with [rust-ndarray](https://github.com/bluss/rust-ndarray). +Linear algebra package for Rust with [ndarray](https://github.com/bluss/ndarray) based on external LAPACK implementations. + +Examples +--------- +See [examples](https://github.com/termoshtt/ndarray-linalg/tree/master/examples) directory. + +Note that to run an example, you must specify the desired backend (as described below). +For example, you can run the the `solve` example with the OpenBLAS backend like this: + +```sh +cargo run --example solve --features=openblas +``` + +and test of ndarray-linalg: -LAPACKE Backend ----------------- +```sh +cargo test --features=openblas +``` -Currently three LAPACKE implementations are supported and tested: +BLAS/LAPACK Backend +------------------- + +Three BLAS/LAPACK implementations are supported: - [OpenBLAS](https://github.com/cmr/openblas-src) - needs `gfortran` (or other Fortran compiler) @@ -19,9 +35,6 @@ Currently three LAPACKE implementations are supported and tested: - [Intel MKL](https://github.com/termoshtt/rust-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`): ```toml @@ -30,7 +43,16 @@ ndarray = "0.12" ndarray-linalg = { version = "0.10", features = ["openblas"] } ``` -### link backend crate manually +### For librarian +If you creating a library depending on this crate, we encourage you not to link any backend: + +```toml +[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. @@ -49,35 +71,3 @@ 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: - -```toml -[dependencies] -ndarray = "0.12" -ndarray-linalg = { version = "0.10", 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: - -```sh -cargo test --features=openblas -``` - -Examples ---------- -See [examples](https://github.com/termoshtt/ndarray-linalg/tree/master/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: - -```sh -cargo run --example solve --features=openblas -``` From 2b3e0b90a0c803f69fb59f9d9ffc5c1e8f842f86 Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Sun, 2 Sep 2018 03:15:46 +0900 Subject: [PATCH 4/4] Minor --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 23eff659..e2974186 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,14 @@ Examples --------- See [examples](https://github.com/termoshtt/ndarray-linalg/tree/master/examples) directory. -Note that to run an example, you must specify the desired backend (as described below). -For example, you can run the the `solve` example with the OpenBLAS backend like this: +**Note**: To run examples, you must specify which backend will be used (as described below). +For example, you can execute the [solve](examples/solve.rs) example with the OpenBLAS backend like this: ```sh cargo run --example solve --features=openblas ``` -and test of ndarray-linalg: +and run all tests of ndarray-linalg with OpenBLAS ```sh cargo test --features=openblas