Skip to content

Commit 6879eb2

Browse files
Merge branch 'master' into yt/way-to-turnoff-blas
2 parents 6b9181e + 373192d commit 6879eb2

File tree

12 files changed

+71
-109
lines changed

12 files changed

+71
-109
lines changed

.github/workflows/gh-pages.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,21 @@ jobs:
3333
runs-on: ubuntu-latest
3434
steps:
3535
- name: Checkout
36-
uses: actions/checkout@v3
36+
uses: actions/checkout@v4
3737

3838
# Generate cargo-doc
39-
- uses: actions-rs/cargo@v1
40-
with:
41-
command: doc
42-
args: --no-deps
39+
- name: Generate documentation
40+
run: cargo doc --no-deps
4341

4442
- name: Setup Pages
45-
uses: actions/configure-pages@v2
43+
uses: actions/configure-pages@v5
4644

4745
# Upload target/doc directory
4846
- name: Upload artifact
49-
uses: actions/upload-pages-artifact@v1
47+
uses: actions/upload-pages-artifact@v3
5048
with:
5149
path: 'target/doc'
5250

5351
- name: Deploy to GitHub Pages
5452
id: deployment
55-
uses: actions/deploy-pages@v1
53+
uses: actions/deploy-pages@v4

.github/workflows/intel-mkl.yml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,16 @@ on:
55
branches:
66
- master
77
pull_request: {}
8+
workflow_dispatch:
89

910
jobs:
10-
windows:
11-
runs-on: windows-2019
11+
intel-mkl:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
system: [ubuntu-22.04, windows-latest]
16+
runs-on: ${{ matrix.system }}
1217
steps:
13-
- uses: actions/checkout@v1
14-
- uses: actions-rs/cargo@v1
15-
with:
16-
command: test
17-
args: >
18-
--manifest-path=ndarray-linalg/Cargo.toml
19-
--no-default-features
20-
--features=intel-mkl-static
21-
22-
linux:
23-
runs-on: ubuntu-22.04
24-
steps:
25-
- uses: actions/checkout@v1
26-
- uses: actions-rs/cargo@v1
27-
name: cargo test
28-
with:
29-
command: test
30-
args: >
31-
--manifest-path=ndarray-linalg/Cargo.toml
32-
--no-default-features
33-
--features=intel-mkl-static
34-
35-
linux-container:
36-
runs-on: ubuntu-22.04
37-
container:
38-
image: ghcr.io/rust-math/rust-mkl:1.63.0-2020.1
39-
steps:
40-
- uses: actions/checkout@v1
41-
- uses: actions-rs/cargo@v1
42-
name: cargo test
43-
with:
44-
command: test
45-
args: >
46-
--manifest-path=ndarray-linalg/Cargo.toml
47-
--no-default-features
48-
--features=intel-mkl-system
18+
- uses: actions/checkout@v4
19+
- name: cargo test
20+
run: cargo test --manifest-path=ndarray-linalg/Cargo.toml --no-default-features --features=intel-mkl-static --verbose

.github/workflows/netlib.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- master
77
pull_request: {}
8+
workflow_dispatch:
89

910
jobs:
1011
linux:
@@ -15,15 +16,10 @@ jobs:
1516
- static
1617
runs-on: ubuntu-22.04
1718
steps:
18-
- uses: actions/checkout@v1
19+
- uses: actions/checkout@v4
1920
- name: apt install gfortran
2021
run: |
2122
sudo apt update
2223
sudo apt install -y gfortran
23-
- uses: actions-rs/cargo@v1
24-
with:
25-
command: test
26-
args: >
27-
--manifest-path=ndarray-linalg/Cargo.toml
28-
--no-default-features
29-
--features=netlib-${{ matrix.feature }}
24+
- name: cargo test
25+
run: cargo test --manifest-path=ndarray-linalg/Cargo.toml --no-default-features --features=netlib-${{ matrix.feature }}

.github/workflows/openblas.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,27 @@ on:
55
branches:
66
- master
77
pull_request: {}
8+
workflow_dispatch:
89

910
jobs:
1011
linux:
1112
runs-on: ubuntu-22.04
12-
container:
13-
image: rust
1413
strategy:
1514
fail-fast: false
1615
matrix:
1716
feature:
1817
- static
1918
- system
2019
steps:
21-
- uses: actions/checkout@v1
20+
- uses: actions/checkout@v4
2221
- name: apt install gfortran
2322
run: |
24-
apt update
25-
apt install -y gfortran
23+
sudo apt update
24+
sudo apt install -y gfortran
2625
- name: Install OpenBLAS by apt
2726
run: |
28-
apt update
29-
apt install -y libopenblas-dev
27+
sudo apt update
28+
sudo apt install -y libopenblas-dev
3029
if: ${{ contains(matrix.feature, 'system') }}
31-
- uses: actions-rs/cargo@v1
32-
with:
33-
command: test
34-
args: >
35-
--manifest-path=ndarray-linalg/Cargo.toml
36-
--no-default-features
37-
--features=openblas-${{ matrix.feature }}
30+
- name: cargo test
31+
run: cargo test --manifest-path=ndarray-linalg/Cargo.toml --no-default-features --features=openblas-${{ matrix.feature }}

.github/workflows/rust.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,50 @@ on:
55
branches:
66
- master
77
pull_request: {}
8+
workflow_dispatch:
89

910
jobs:
1011
check-format:
1112
runs-on: ubuntu-22.04
1213
steps:
13-
- uses: actions/checkout@v1
14-
- uses: actions-rs/cargo@v1
15-
with:
16-
command: fmt
17-
args: -- --check
14+
- uses: actions/checkout@v4
15+
- name: fmt
16+
run: cargo fmt -- --check
1817

1918
check:
2019
runs-on: ubuntu-22.04
2120
steps:
22-
- uses: actions/checkout@v1
23-
- uses: actions-rs/cargo@v1
24-
with:
25-
command: check
26-
args: --all-targets
21+
- uses: actions/checkout@v4
22+
- name: cargo check
23+
run: cargo check --all-targets
2724

2825
check-doc:
2926
runs-on: ubuntu-22.04
3027
steps:
31-
- uses: actions/checkout@v1
32-
- uses: actions-rs/cargo@v1
33-
with:
34-
command: doc
35-
args: --no-deps
28+
- uses: actions/checkout@v4
29+
- name: cargo doc
30+
run: cargo doc --no-deps
3631

3732
clippy:
3833
runs-on: ubuntu-22.04
3934
steps:
40-
- uses: actions/checkout@v1
41-
- uses: actions-rs/cargo@v1
42-
with:
43-
command: clippy
35+
- uses: actions/checkout@v4
36+
- name: cargo clippy
37+
run: cargo clippy
4438

4539
coverage:
4640
runs-on: ubuntu-22.04
4741
container:
48-
image: ghcr.io/rust-math/rust-mkl:1.63.0-2020.1
42+
image: xd009642/tarpaulin:develop-nightly
4943
options: --security-opt seccomp=unconfined
5044
steps:
51-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v4
46+
- uses: dtolnay/rust-toolchain@nightly
47+
- name: Install Cross
48+
uses: taiki-e/install-action@v2
49+
with:
50+
tool: cargo-tarpaulin
5251
- name: Generate code coverage
53-
run: |
54-
cargo tarpaulin --features=intel-mkl-system --out Xml
52+
run: cargo +nightly tarpaulin --features=intel-mkl-static --out xml
5553
- name: Upload to codecov.io
56-
uses: codecov/codecov-action@v1
54+
uses: codecov/codecov-action@v5

ndarray-linalg/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@ rand = "0.8.3"
3838
thiserror = "1.0.24"
3939

4040
[dependencies.ndarray]
41-
version = "0.15.2"
41+
version = "0.16.0"
4242
features = ["approx", "std"]
4343
default-features = false
4444

4545
[dependencies.lax]
46-
version = "0.16.0-rc.0"
46+
version = "0.16.0"
4747
path = "../lax"
4848
default-features = false
4949

5050
[dev-dependencies]
5151
paste = "1.0.5"
52-
criterion = "0.3.4"
52+
criterion = "0.5.1"
5353
# Keep the same version as ndarray's dependency!
54-
approx = { version = "0.4.0", features = ["num-complex"] }
54+
approx = { version = "0.5", features = ["num-complex"] }
5555
rand_pcg = "0.3.1"
5656

5757
[[bench]]

ndarray-linalg/src/convert.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ where
1212
S: Data,
1313
{
1414
let n = a.len();
15-
a.into_shape((n, 1)).unwrap()
15+
a.into_shape_with_order((n, 1)).unwrap()
1616
}
1717

1818
pub fn into_row<S>(a: ArrayBase<S, Ix1>) -> ArrayBase<S, Ix2>
1919
where
2020
S: Data,
2121
{
2222
let n = a.len();
23-
a.into_shape((1, n)).unwrap()
23+
a.into_shape_with_order((1, n)).unwrap()
2424
}
2525

2626
pub fn flatten<S>(a: ArrayBase<S, Ix2>) -> ArrayBase<S, Ix1>
2727
where
2828
S: Data,
2929
{
3030
let n = a.len();
31-
a.into_shape(n).unwrap()
31+
a.into_shape_with_order(n).unwrap()
3232
}
3333

3434
pub fn into_matrix<A, S>(l: MatrixLayout, a: Vec<A>) -> Result<ArrayBase<S, Ix2>>
@@ -99,9 +99,9 @@ where
9999
// https://github.com/bluss/rust-ndarray/issues/325
100100
let strides: Vec<isize> = a.strides().to_vec();
101101
let new = if a.is_standard_layout() {
102-
ArrayBase::from_shape_vec(a.dim(), a.into_raw_vec()).unwrap()
102+
ArrayBase::from_shape_vec(a.dim(), a.into_raw_vec_and_offset().0).unwrap()
103103
} else {
104-
ArrayBase::from_shape_vec(a.dim().f(), a.into_raw_vec()).unwrap()
104+
ArrayBase::from_shape_vec(a.dim().f(), a.into_raw_vec_and_offset().0).unwrap()
105105
};
106106
assert_eq!(
107107
new.strides(),

ndarray-linalg/tests/det.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fn det_zero_nonsquare() {
9494
assert!(a.sln_det_into().is_err());
9595
};
9696
}
97-
for &shape in &[(1, 2).into_shape(), (1, 2).f()] {
97+
for &shape in &[(1, 2).into_shape_with_order(), (1, 2).f()] {
9898
det_zero_nonsquare!(f64, shape);
9999
det_zero_nonsquare!(f32, shape);
100100
det_zero_nonsquare!(c64, shape);
@@ -186,7 +186,7 @@ fn det_nonsquare() {
186186
};
187187
}
188188
for &dims in &[(1, 0), (1, 2), (2, 1), (2, 3)] {
189-
for &shape in &[dims.into_shape(), dims.f()] {
189+
for &shape in &[dims.into_shape_with_order(), dims.f()] {
190190
det_nonsquare!(f64, shape);
191191
det_nonsquare!(f32, shape);
192192
det_nonsquare!(c64, shape);

ndarray-linalg/tests/deth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn deth_zero_nonsquare() {
6060
assert!(a.sln_deth_into().is_err());
6161
};
6262
}
63-
for &shape in &[(1, 2).into_shape(), (1, 2).f()] {
63+
for &shape in &[(1, 2).into_shape_with_order(), (1, 2).f()] {
6464
deth_zero_nonsquare!(f64, shape);
6565
deth_zero_nonsquare!(f32, shape);
6666
deth_zero_nonsquare!(c64, shape);
@@ -138,7 +138,7 @@ fn deth_nonsquare() {
138138
};
139139
}
140140
for &dims in &[(1, 0), (1, 2), (2, 1), (2, 3)] {
141-
for &shape in &[dims.into_shape(), dims.f()] {
141+
for &shape in &[dims.into_shape_with_order(), dims.f()] {
142142
deth_nonsquare!(f64, shape);
143143
deth_nonsquare!(f32, shape);
144144
deth_nonsquare!(c64, shape);

ndarray-linalg/tests/inv.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ fn inv_into_random_complex() {
106106
#[should_panic]
107107
fn inv_error() {
108108
// do not have inverse
109-
let a = Array::<f64, _>::zeros(9).into_shape((3, 3)).unwrap();
109+
let a = Array::<f64, _>::zeros(9)
110+
.into_shape_with_order((3, 3))
111+
.unwrap();
110112
let a_inv = a.inv().unwrap();
111113
println!("{:?}", a_inv);
112114
}

ndarray-linalg/tests/opnorm.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ fn gen(i: usize, j: usize, rev: bool) -> Array2<f64> {
1414
let n = (i * j + 1) as f64;
1515
if rev {
1616
Array::range(1., n, 1.)
17-
.into_shape((j, i))
17+
.into_shape_with_order((j, i))
1818
.unwrap()
1919
.reversed_axes()
2020
} else {
21-
Array::range(1., n, 1.).into_shape((i, j)).unwrap()
21+
Array::range(1., n, 1.)
22+
.into_shape_with_order((i, j))
23+
.unwrap()
2224
}
2325
}
2426

ndarray-linalg/tests/solve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ fn rcond_hilbert() {
254254
macro_rules! rcond_hilbert {
255255
($elem:ty, $rows:expr, $atol:expr) => {
256256
let a = Array2::<$elem>::from_shape_fn(($rows, $rows), |(i, j)| {
257-
1. / (i as $elem + j as $elem - 1.)
257+
1. / (i as $elem + j as $elem + 1.)
258258
});
259259
assert_aclose!(a.rcond().unwrap(), 0., $atol);
260260
assert_aclose!(a.rcond_into().unwrap(), 0., $atol);

0 commit comments

Comments
 (0)