Skip to content

solve_into method not found in Example code #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MrGibus opened this issue Jan 14, 2021 · 1 comment
Closed

solve_into method not found in Example code #259

MrGibus opened this issue Jan 14, 2021 · 1 comment

Comments

@MrGibus
Copy link

MrGibus commented Jan 14, 2021

Trying to run the following code:

Cargo.toml

[dependencies]
ndarray = "0.14.0"
ndarray-linalg = "0.12.1"
lapack-src = { version = "0.6", features = ["intel-mkl"] }

main.rs

#[macro_use]
extern crate ndarray;
extern crate ndarray_linalg;

use ndarray::prelude::*;
use ndarray_linalg::Solve;

fn main() {
  let a: Array2<f64> = array![[3., 2., -1.], [2., -2., 4.], [-2., 1., -2.]];
  let b: Array1<f64> = array![1., -2., 0.];
  let x = a.solve_into(b).unwrap();
  assert!(x.all_close(&array![1., -2., -2.], 1e-9));
}

error:

warning: unused `#[macro_use]` import
 --> src\main.rs:1:1
  |
1 | #[macro_use]
  | ^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error[E0599]: no method named `solve_into` found for struct `ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>` in the current scope
  --> src\main.rs:10:15
   |
10 |     let x = a.solve_into(b).unwrap();
   |               ^^^^^^^^^^ method not found in `ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>`

examples and tests:

PS C:\Users\Gibus\.git\ndarray-linalg\ndarray-linalg> cargo run --example solve --features intel-mkl
    Finished dev [unoptimized + debuginfo] target(s) in 0.15s
cargo test --features intel-mkl
...

All tests pass successfully.
Using Windows 10.

@jturner314
Copy link
Member

ndarray-linalg hasn't been updated to use ndarray 0.14 yet (PR #258). Changing your Cargo.toml to ndarray = "0.13" should fix the issue until a new version of ndarray-linalg is released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants