1
1
ndarray-linalg
2
2
===============
3
+ [ ![ CircleCI] ( https://circleci.com/gh/termoshtt/ndarray-linalg.svg?style=shield )] ( https://circleci.com/gh/termoshtt/ndarray-linalg )
3
4
[ ![ Crate] ( http://meritbadge.herokuapp.com/ndarray-linalg )] ( https://crates.io/crates/ndarray-linalg )
4
5
[ ![ 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 )
7
6
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:
9
15
10
- LAPACKE Backend
11
- ----------------
16
+ ``` sh
17
+ cargo run --example solve --features=openblas
18
+ ```
12
19
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:
14
30
15
31
- [ OpenBLAS] ( https://github.com/cmr/openblas-src )
16
32
- needs ` gfortran ` (or other Fortran compiler)
17
33
- [ Netlib] ( https://github.com/cmr/netlib-src )
18
34
- needs ` cmake ` and ` gfortran `
19
35
- [ Intel MKL] ( https://github.com/termoshtt/rust-intel-mkl ) (non-free license, see the linked page)
20
36
- needs ` curl `
21
- There are two ways to link LAPACKE backend:
22
37
23
- ### backend features (recommended)
24
38
There are three features corresponding to the backend implementations (` openblas ` / ` netlib ` / ` intel-mkl ` ):
25
39
26
40
``` toml
27
41
[dependencies ]
28
42
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"
30
53
```
31
54
32
- ### link backend crate manually
55
+ ### Link backend crate manually
33
56
For the sake of linking flexibility, you can provide LAPACKE implementation (as an ` extern crate ` ) yourself.
34
57
You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.
35
58
36
59
``` toml
37
60
[dependencies ]
38
61
ndarray = " 0.12"
39
- ndarray-linalg = " 0.9 "
62
+ ndarray-linalg = " 0.10 "
40
63
openblas-src = " 0.5" # or another backend of your choice
41
64
42
65
```
@@ -48,35 +71,3 @@ extern crate ndarray;
48
71
extern crate ndarray_linalg;
49
72
extern crate openblas_src; // or another backend of your choice
50
73
```
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
- ```
0 commit comments