Skip to content

Commit 2f0466b

Browse files
committed
Merge branch 'lobpcg-fix' of github.com:bytesnake/ndarray-linalg into lobpcg-fix
2 parents 0ee9f56 + c889908 commit 2f0466b

File tree

13 files changed

+31
-27
lines changed

13 files changed

+31
-27
lines changed

.github/workflows/intel-mkl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
3535
linux-container:
3636
runs-on: ubuntu-18.04
37-
container: rustmath/mkl-rust:1.43.0
37+
container: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.49.0
3838
steps:
3939
- uses: actions/checkout@v1
4040
- uses: actions-rs/cargo@v1

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
coverage:
2828
runs-on: ubuntu-18.04
2929
container:
30-
image: rustmath/mkl-rust:1.43.0
30+
image: ghcr.io/rust-math/intel-mkl-src/mkl-rust:1.49.0
3131
options: --security-opt seccomp=unconfined
3232
steps:
3333
- uses: actions/checkout@v2

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Unreleased
22
-----------
33

4+
Updated dependencies
5+
---------------------
6+
- ndarray 0.15 https://github.com/rust-ndarray/ndarray-linalg/pull/273
7+
- cauchy 0.4 (num-complex 0.4, rand 0.8), lapack 0.18 https://github.com/rust-ndarray/ndarray-linalg/pull/276
8+
49
0.13.1 - 13 March 2021
510
=====================
611

lax/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ intel-mkl-static = ["intel-mkl-src/mkl-static-lp64-seq", "intel-mkl-src/download
2929
intel-mkl-system = ["intel-mkl-src/mkl-dynamic-lp64-seq"]
3030

3131
[dependencies]
32-
thiserror = "1.0.23"
33-
cauchy = "0.3.0"
32+
thiserror = "1.0.24"
33+
cauchy = "0.4.0"
3434
num-traits = "0.2.14"
35-
lapack = "0.17.0"
35+
lapack = "0.18.0"
3636

3737
[dependencies.intel-mkl-src]
3838
version = "0.6.0"
@@ -46,7 +46,7 @@ features = ["cblas"]
4646
default-features = false
4747

4848
[dependencies.openblas-src]
49-
version = "0.10.2"
49+
version = "0.10.4"
5050
optional = true
5151
default-features = false
5252
features = ["cblas"]

ndarray-linalg/Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ intel-mkl-static = ["lax/intel-mkl-static"]
2929
intel-mkl-system = ["lax/intel-mkl-system"]
3030

3131
[dependencies]
32-
cauchy = "0.3.0"
33-
num-complex = "0.3.1"
34-
num-traits = "0.2.11"
35-
rand = "0.7.3"
36-
thiserror = "1.0.20"
32+
cauchy = "0.4.0"
33+
num-complex = "0.4.0"
34+
num-traits = "0.2.14"
35+
rand = "0.8.3"
36+
thiserror = "1.0.24"
3737

3838
[dependencies.ndarray]
39-
version = "0.14"
40-
features = ["blas", "approx"]
39+
version = "0.15.1"
40+
features = ["blas", "approx", "std"]
4141
default-features = false
4242

4343
[dependencies.lax]
@@ -46,8 +46,8 @@ path = "../lax"
4646
default-features = false
4747

4848
[dev-dependencies]
49-
paste = "1.0"
50-
criterion = "0.3"
49+
paste = "1.0.5"
50+
criterion = "0.3.4"
5151
# Keep the same version as ndarray's dependency!
5252
approx = { version = "0.4", features = ["num-complex"] }
5353
rand_xoshiro = "0.4"

ndarray-linalg/src/cholesky.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
//!
2727
//! // Obtain `L`
2828
//! let lower = a.cholesky(UPLO::Lower).unwrap();
29-
//! assert!(lower.all_close(&array![
29+
//! assert!(lower.abs_diff_eq(&array![
3030
//! [ 2., 0., 0.],
3131
//! [ 6., 1., 0.],
3232
//! [-8., 5., 3.]
@@ -39,7 +39,7 @@
3939
//! // Solve `A * x = b`
4040
//! let b = array![4., 13., -11.];
4141
//! let x = a.solvec(&b).unwrap();
42-
//! assert!(x.all_close(&array![-2., 1., 0.], 1e-9));
42+
//! assert!(x.abs_diff_eq(&array![-2., 1., 0.], 1e-9));
4343
//! # }
4444
//! ```
4545

ndarray-linalg/src/eigh.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::layout::*;
88
use crate::operator::LinearOperator;
99
use crate::types::*;
1010
use crate::UPLO;
11-
use std::iter::FromIterator;
1211

1312
/// Eigenvalue decomposition of Hermite matrix reference
1413
pub trait Eigh {

ndarray-linalg/src/lobpcg/eig.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ impl<A: Float + Scalar + ScalarOperand + Lapack + PartialOrd + Default> Iterator
222222
// add the new eigenvector to the internal constrain matrix
223223
let new_constraints = if let Some(ref constraints) = self.eig.constraints {
224224
let eigvecs_arr: Vec<_> = constraints
225-
.gencolumns()
225+
.columns()
226226
.into_iter()
227-
.chain(vecs.gencolumns().into_iter())
227+
.chain(vecs.columns().into_iter())
228228
.collect();
229229

230230
stack(Axis(1), &eigvecs_arr).unwrap()

ndarray-linalg/src/lobpcg/lobpcg.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ fn apply_constraints<A: Scalar + Lapack>(
8181
let gram_yv = y.t().dot(&v);
8282

8383
let u = gram_yv
84-
.gencolumns()
84+
.columns()
8585
.into_iter()
8686
.map(|x| {
8787
let res = cholesky_yy.solvec(&x).unwrap();
@@ -222,7 +222,7 @@ pub fn lobpcg<
222222

223223
// calculate L2 norm of error for every eigenvalue
224224
let residual_norms = r
225-
.gencolumns()
225+
.columns()
226226
.into_iter()
227227
.map(|x| x.norm())
228228
.collect::<Vec<A::Real>>();

ndarray-linalg/src/lobpcg/svd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<A: Float + PartialOrd + DivAssign<A> + 'static + MagnitudeCorrection> Trunc
6464
let mut ularge = self.problem.dot(&vlarge);
6565

6666
ularge
67-
.gencolumns_mut()
67+
.columns_mut()
6868
.into_iter()
6969
.zip(values.iter())
7070
.for_each(|(mut a, b)| a.mapv_inplace(|x| x / *b));
@@ -75,7 +75,7 @@ impl<A: Float + PartialOrd + DivAssign<A> + 'static + MagnitudeCorrection> Trunc
7575

7676
let mut vlarge = self.problem.t().dot(&ularge);
7777
vlarge
78-
.gencolumns_mut()
78+
.columns_mut()
7979
.into_iter()
8080
.zip(values.iter())
8181
.for_each(|(mut a, b)| a.mapv_inplace(|x| x / *b));

ndarray-linalg/src/solve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! let a: Array2<f64> = array![[3., 2., -1.], [2., -2., 4.], [-2., 1., -2.]];
1717
//! let b: Array1<f64> = array![1., -2., 0.];
1818
//! let x = a.solve_into(b).unwrap();
19-
//! assert!(x.all_close(&array![1., -2., -2.], 1e-9));
19+
//! assert!(x.abs_diff_eq(&array![1., -2., -2.], 1e-9));
2020
//!
2121
//! # }
2222
//! ```

ndarray-linalg/src/solveh.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//! ];
2424
//! let b: Array1<f64> = array![11., -12., 1.];
2525
//! let x = a.solveh_into(b).unwrap();
26-
//! assert!(x.all_close(&array![1., 3., -2.], 1e-9));
26+
//! assert!(x.abs_diff_eq(&array![1., 3., -2.], 1e-9));
2727
//!
2828
//! # }
2929
//! ```

ndarray-linalg/tests/cholesky.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ macro_rules! cholesky_det {
140140
.eigvalsh(UPLO::Upper)
141141
.unwrap()
142142
.mapv(|elem| elem.ln())
143-
.scalar_sum();
143+
.sum();
144144
let det = ln_det.exp();
145145
assert_aclose!(a.factorizec(UPLO::Upper).unwrap().detc(), det, $atol);
146146
assert_aclose!(a.factorizec(UPLO::Upper).unwrap().ln_detc(), ln_det, $atol);

0 commit comments

Comments
 (0)