Unable to import traits implementation from ndarray
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 25/100
Research direction
Start by reproducing the imports and least_squares call from Cargo.toml and chow.rs:19 with the stated ndarray and ndarray-linalg versions. Check the trait implementations and method signatures for the shown Array types; done means identifying whether the example is incompatible or correcting the documented usage and adding a regression test if appropriate.
Written by the indexing model from the issue text.
Description
Question
- Hi I run in a problem related with
LeastSquare: I am trying to import thendarray_linalg:: {LeastSquaresSvd, LeastSquaresSvdInto, LeastSquaresSvdInPlace}. And calling fromndarray::Array1::least_squaresclass.- However the rust compiler unable to import it.
Cargo setup
- The OS environment is running in
WSL2in windows 10
#Cargo.toml
...
[dependencies]
openblas-src = { version = "*", features = ["static"] }
ndarray = "0.12"
ndarray-linalg = { version = "0.12.0", features = ["openblas"] }
ndarray-stats = "0.3"
...
- code snippets to
// mod.rs
extern crate ndarray_linalg;
extern crate ndarray;
extern crate openblas_src;
pub mod foo.
...
// foo.rs
use ndarray
use ndarray_linalg::{LeastSquaresSvd, LeastSquaresSvdInto, LeastSquaresSvdInPlace};
let a= array![
[1., 1., 1.],
[2., 3., 4.],
[3., 5., 2.],
[4., 2., 5.],
[5., 4., 3.]
];
// solving for a single right-hand
let b = array![-10., 12., 14., 16., 18.];
// let res = a.least_squares(&b);
// using `least_squares_in_place` which overwrites its arguments
// let mut a_3 = a.clone();
// let mut b_3 = b.clone();
let (m, n) = (a.shape()[0], a.shape()[1]);
let solution = b.slice(s![0..n]).to_owned();
let result = a.least_squares(&b); // unable to find least_squares
...
- The error outputs
--> keyboard-analyzer/src/models/structural_break_analysis/chow.rs:19:22
|
19 | use ndarray_linalg::{LeastSquaresSvd, LeastSquaresSvdInto, LeastSquaresSvdInPlace};
....
method not found in `ndarray::ArrayBase<models::structural_break_analysis::ndarray::OwnedRepr<{float}>,
models::structural_break_analysis::ndarray::Dim<[usize; 2]>>`
- Dominant language
- Rust
- Stars
- 452
- Forks
- 95
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray-linalg
-
Thin SVD Open
Difficulty 5/5 Over a week Newbie friendliness 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
rust-ndarray/ndarray-linalg#413 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
rust-ndarray/ndarray-linalg#404 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#402 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
rust-ndarray/ndarray-linalg#401 · 2 reactions ·
All issues in rust-ndarray/ndarray-linalg
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100