Skip to content

Commit 21138bb

Browse files
Merge pull request #117 from termoshtt/release-0.10
2 parents 1b72e4b + 2b3e0b9 commit 21138bb

File tree

2 files changed

+35
-44
lines changed

2 files changed

+35
-44
lines changed

README.md

Lines changed: 34 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,65 @@
11
ndarray-linalg
22
===============
3+
[![CircleCI](https://circleci.com/gh/termoshtt/ndarray-linalg.svg?style=shield)](https://circleci.com/gh/termoshtt/ndarray-linalg)
34
[![Crate](http://meritbadge.herokuapp.com/ndarray-linalg)](https://crates.io/crates/ndarray-linalg)
45
[![docs.rs](https://docs.rs/ndarray-linalg/badge.svg)](https://docs.rs/ndarray-linalg)
5-
[![CircleCI](https://circleci.com/gh/termoshtt/ndarray-linalg.svg?style=shield)](https://circleci.com/gh/termoshtt/ndarray-linalg)
6-
[![Gitter chat](https://badges.gitter.im/termoshtt-scirust/ndarray-linalg.png)](https://gitter.im/termoshtt-scirust/ndarray-linalg)
76

8-
Linear algebra package for Rust with [rust-ndarray](https://github.com/bluss/rust-ndarray).
7+
Linear algebra package for Rust with [ndarray](https://github.com/bluss/ndarray) based on external LAPACK implementations.
8+
9+
Examples
10+
---------
11+
See [examples](https://github.com/termoshtt/ndarray-linalg/tree/master/examples) directory.
12+
13+
**Note**: To run examples, you must specify which backend will be used (as described below).
14+
For example, you can execute the [solve](examples/solve.rs) example with the OpenBLAS backend like this:
915

10-
LAPACKE Backend
11-
----------------
16+
```sh
17+
cargo run --example solve --features=openblas
18+
```
1219

13-
Currently three LAPACKE implementations are supported and tested:
20+
and run all tests of ndarray-linalg with OpenBLAS
21+
22+
```sh
23+
cargo test --features=openblas
24+
```
25+
26+
BLAS/LAPACK Backend
27+
-------------------
28+
29+
Three BLAS/LAPACK implementations are supported:
1430

1531
- [OpenBLAS](https://github.com/cmr/openblas-src)
1632
- needs `gfortran` (or other Fortran compiler)
1733
- [Netlib](https://github.com/cmr/netlib-src)
1834
- needs `cmake` and `gfortran`
1935
- [Intel MKL](https://github.com/termoshtt/rust-intel-mkl) (non-free license, see the linked page)
2036
- needs `curl`
21-
There are two ways to link LAPACKE backend:
2237

23-
### backend features (recommended)
2438
There are three features corresponding to the backend implementations (`openblas` / `netlib` / `intel-mkl`):
2539

2640
```toml
2741
[dependencies]
2842
ndarray = "0.12"
29-
ndarray-linalg = { version = "0.9", features = ["openblas"] }
43+
ndarray-linalg = { version = "0.10", features = ["openblas"] }
44+
```
45+
46+
### For librarian
47+
If you creating a library depending on this crate, we encourage you not to link any backend:
48+
49+
```toml
50+
[dependencies]
51+
ndarray = "0.12"
52+
ndarray-linalg = "0.10"
3053
```
3154

32-
### link backend crate manually
55+
### Link backend crate manually
3356
For the sake of linking flexibility, you can provide LAPACKE implementation (as an `extern crate`) yourself.
3457
You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.
3558

3659
```toml
3760
[dependencies]
3861
ndarray = "0.12"
39-
ndarray-linalg = "0.9"
62+
ndarray-linalg = "0.10"
4063
openblas-src = "0.5" # or another backend of your choice
4164

4265
```
@@ -48,35 +71,3 @@ extern crate ndarray;
4871
extern crate ndarray_linalg;
4972
extern crate openblas_src; // or another backend of your choice
5073
```
51-
52-
### For librarian
53-
If you creating a library depending on this crate, we encourage you not to link any backend for flexibility:
54-
55-
```toml
56-
[dependencies]
57-
ndarray = "0.12"
58-
ndarray-linalg = { version = "0.9", default-features = false }
59-
```
60-
61-
However, if you hope simplicity instead of the flexibility, you can link your favorite backend in the way described above.
62-
63-
### Tests and Examples
64-
65-
To run tests or examples for `ndarray-linalg`, you must specify the desired
66-
backend. For example, you can run the tests with the OpenBLAS backend like
67-
this:
68-
69-
```sh
70-
cargo test --features=openblas
71-
```
72-
73-
Examples
74-
---------
75-
See [examples](https://github.com/termoshtt/ndarray-linalg/tree/master/examples) directory.
76-
77-
Note that to run an example, you must specify the desired backend. For example,
78-
you can run the the `solve` example with the OpenBLAS backend like this:
79-
80-
```sh
81-
cargo run --example solve --features=openblas
82-
```

examples/eigh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use ndarray_linalg::*;
66

77
fn main() {
88
let a = arr2(&[[3.0, 1.0, 1.0], [1.0, 3.0, 1.0], [1.0, 1.0, 3.0]]);
9-
let (e, vecs): (Array1<_>, Array2<_>) = a.clone().eigh(UPLO::Upper).unwrap();
9+
let (e, vecs) = a.clone().eigh(UPLO::Upper).unwrap();
1010
println!("eigenvalues = \n{:?}", e);
1111
println!("V = \n{:?}", vecs);
1212
let av = a.dot(&vecs);

0 commit comments

Comments
 (0)