diff --git a/ndarray-linalg/Cargo.toml b/ndarray-linalg/Cargo.toml index e06fa675..3d1c394d 100644 --- a/ndarray-linalg/Cargo.toml +++ b/ndarray-linalg/Cargo.toml @@ -37,7 +37,7 @@ rand = "0.8.3" thiserror = "1.0.24" [dependencies.ndarray] -version = "0.15.2" +version = "0.16.1" features = ["blas", "approx", "std"] default-features = false diff --git a/ndarray-linalg/src/convert.rs b/ndarray-linalg/src/convert.rs index 43002966..c4011d50 100644 --- a/ndarray-linalg/src/convert.rs +++ b/ndarray-linalg/src/convert.rs @@ -97,14 +97,14 @@ where { // FIXME // https://github.com/bluss/rust-ndarray/issues/325 - let strides: Vec = a.strides().to_vec(); + let strides: Vec = ArrayBase::strides(&a).to_vec(); let new = if a.is_standard_layout() { ArrayBase::from_shape_vec(a.dim(), a.into_raw_vec()).unwrap() } else { ArrayBase::from_shape_vec(a.dim().f(), a.into_raw_vec()).unwrap() }; assert_eq!( - new.strides(), + ArrayBase::strides(&new), strides.as_slice(), "Custom stride is not supported" ); diff --git a/ndarray-linalg/tests/det.rs b/ndarray-linalg/tests/det.rs index d14fc8d0..40dafd57 100644 --- a/ndarray-linalg/tests/det.rs +++ b/ndarray-linalg/tests/det.rs @@ -94,7 +94,7 @@ fn det_zero_nonsquare() { assert!(a.sln_det_into().is_err()); }; } - for &shape in &[(1, 2).into_shape(), (1, 2).f()] { + for &shape in &[(1, 2).into_shape_with_order(), (1, 2).f()] { det_zero_nonsquare!(f64, shape); det_zero_nonsquare!(f32, shape); det_zero_nonsquare!(c64, shape); @@ -186,7 +186,7 @@ fn det_nonsquare() { }; } for &dims in &[(1, 0), (1, 2), (2, 1), (2, 3)] { - for &shape in &[dims.into_shape(), dims.f()] { + for &shape in &[dims.into_shape_with_order(), dims.f()] { det_nonsquare!(f64, shape); det_nonsquare!(f32, shape); det_nonsquare!(c64, shape); diff --git a/ndarray-linalg/tests/deth.rs b/ndarray-linalg/tests/deth.rs index 4785aadc..9079c342 100644 --- a/ndarray-linalg/tests/deth.rs +++ b/ndarray-linalg/tests/deth.rs @@ -60,7 +60,7 @@ fn deth_zero_nonsquare() { assert!(a.sln_deth_into().is_err()); }; } - for &shape in &[(1, 2).into_shape(), (1, 2).f()] { + for &shape in &[(1, 2).into_shape_with_order(), (1, 2).f()] { deth_zero_nonsquare!(f64, shape); deth_zero_nonsquare!(f32, shape); deth_zero_nonsquare!(c64, shape); @@ -138,7 +138,7 @@ fn deth_nonsquare() { }; } for &dims in &[(1, 0), (1, 2), (2, 1), (2, 3)] { - for &shape in &[dims.into_shape(), dims.f()] { + for &shape in &[dims.into_shape_with_order(), dims.f()] { deth_nonsquare!(f64, shape); deth_nonsquare!(f32, shape); deth_nonsquare!(c64, shape); diff --git a/ndarray-linalg/tests/inv.rs b/ndarray-linalg/tests/inv.rs index 030773c1..b881c3ba 100644 --- a/ndarray-linalg/tests/inv.rs +++ b/ndarray-linalg/tests/inv.rs @@ -106,7 +106,7 @@ fn inv_into_random_complex() { #[should_panic] fn inv_error() { // do not have inverse - let a = Array::::zeros(9).into_shape((3, 3)).unwrap(); + let a = Array::::zeros((3, 3)); let a_inv = a.inv().unwrap(); println!("{:?}", a_inv); }