Skip to content

Commit 4aaa904

Browse files
authored
Merge pull request #28 from termoshtt/backend_switch
Backend switch
2 parents 9305fbf + bbb9e4a commit 4aaa904

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ os:
1212
cache: cargo
1313

1414
matrix:
15-
allow-failures:
15+
allow_failures:
1616
- rust: nightly
1717

1818
script:
@@ -26,3 +26,7 @@ addons:
2626
packages:
2727
- cmake
2828
- gfortran
29+
30+
env:
31+
- RUST_BACKTRACE=1 FEATURE=netlib
32+
- RUST_BACKTRACE=1 FEATURE=openblas

Cargo.toml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
[package]
2-
name = "ndarray-linalg"
2+
name = "ndarray-linalg"
33
version = "0.3.0"
44
authors = ["Toshiki Teramura <[email protected]>"]
55

6-
description = "Linear algebra package for rust-ndarray using LAPACK"
6+
description = "Linear algebra package for rust-ndarray using LAPACK"
77
documentation = "https://docs.rs/ndarray-linalg/"
8-
repository = "https://github.com/termoshtt/ndarray-linalg"
9-
keywords = ["ndarray", "lapack", "matrix"]
10-
license = "MIT"
8+
repository = "https://github.com/termoshtt/ndarray-linalg"
9+
keywords = ["ndarray", "lapack", "matrix"]
10+
license = "MIT"
11+
12+
[features]
13+
default = ["openblas"]
14+
openblas = ["blas/openblas", "lapack/openblas"]
15+
netlib = ["blas/netlib", "lapack/netlib"]
1116

1217
[dependencies]
13-
lapack = "0.11"
14-
blas = "0.15"
1518
num-traits = "0.1.36"
16-
17-
[dependencies.ndarray]
18-
version = "0.8"
19-
features = ["blas"]
19+
ndarray = { version = "0.8", default-features = false, features = ["blas"] }
20+
lapack = { version = "0.11", default-features = false }
21+
blas = { version = "0.15", default-features = false }
2022

2123
[dev-dependencies]
22-
ndarray-rand = "0.4"
24+
ndarray-rand = "0.4"
2325
ndarray-numtest = "0.2"

tests/inv.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ mod $modname {
2626
#[should_panic]
2727
fn inv_error() {
2828
// do not have inverse
29-
let a = Array::range(1., 10., 1.).into_shape((3, 3)).unwrap();
30-
let _ = a.$clone().inv().unwrap();
29+
let a = Array::<f64, _>::zeros(9).into_shape((3, 3)).unwrap();
30+
let a_inv = a.$clone().inv().unwrap();
31+
println!("{:?}", a_inv);
3132
}
3233
}
3334
}} // impl_test

0 commit comments

Comments
 (0)