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 that to run an example, you must specify the desired backend (as described below).
14
+ For example, you can run the the ` solve ` example with the OpenBLAS backend like this:
15
+
16
+ ``` sh
17
+ cargo run --example solve --features=openblas
18
+ ```
19
+
20
+ and test of ndarray-linalg:
9
21
10
- LAPACKE Backend
11
- ----------------
22
+ ``` sh
23
+ cargo test --features=openblas
24
+ ```
12
25
13
- Currently three LAPACKE implementations are supported and tested:
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)
@@ -19,9 +35,6 @@ Currently three LAPACKE implementations are supported and tested:
19
35
- [ Intel MKL] ( https://github.com/termoshtt/rust-intel-mkl ) (non-free license, see the linked page)
20
36
- needs ` curl `
21
37
22
- There are two ways to link LAPACKE backend:
23
-
24
- ### backend features (recommended)
25
38
There are three features corresponding to the backend implementations (` openblas ` / ` netlib ` / ` intel-mkl ` ):
26
39
27
40
``` toml
@@ -30,7 +43,16 @@ ndarray = "0.12"
30
43
ndarray-linalg = { version = " 0.10" , features = [" openblas" ] }
31
44
```
32
45
33
- ### link backend crate manually
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"
53
+ ```
54
+
55
+ ### Link backend crate manually
34
56
For the sake of linking flexibility, you can provide LAPACKE implementation (as an ` extern crate ` ) yourself.
35
57
You should link a LAPACKE implementation to a final crate (like binary executable or dylib) only, not to a Rust library.
36
58
@@ -49,35 +71,3 @@ extern crate ndarray;
49
71
extern crate ndarray_linalg;
50
72
extern crate openblas_src; // or another backend of your choice
51
73
```
52
-
53
- ### For librarian
54
- If you creating a library depending on this crate, we encourage you not to link any backend for flexibility:
55
-
56
- ``` toml
57
- [dependencies ]
58
- ndarray = " 0.12"
59
- ndarray-linalg = { version = " 0.10" , default-features = false }
60
- ```
61
-
62
- However, if you hope simplicity instead of the flexibility, you can link your favorite backend in the way described above.
63
-
64
- ### Tests and Examples
65
-
66
- To run tests or examples for ` ndarray-linalg ` , you must specify the desired
67
- backend. For example, you can run the tests with the OpenBLAS backend like
68
- this:
69
-
70
- ``` sh
71
- cargo test --features=openblas
72
- ```
73
-
74
- Examples
75
- ---------
76
- See [ examples] ( https://github.com/termoshtt/ndarray-linalg/tree/master/examples ) directory.
77
-
78
- Note that to run an example, you must specify the desired backend. For example,
79
- you can run the the ` solve ` example with the OpenBLAS backend like this:
80
-
81
- ``` sh
82
- cargo run --example solve --features=openblas
83
- ```
0 commit comments