getting no method named `svd` found for reference `&ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start by comparing the issue's Cargo.toml dependency configuration with ndarray-linalg's Cargo.toml and the repository's SVD tests. Run the reported example and the mentioned cargo test --features=openblas svd command; done means the SVD method is available for the shown ndarray type under the documented dependency setup.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Not sure if this is the write place to ask such questions but I couldn't find anywhere else more specific. I am trying to implement the (Moore-Penrose) pseudo-inverse of a matrix[1]. My code currently looks like
use ndarray::prelude::*;
use ndarray_linalg::*;
use std::cmp::min;
use thiserror::Error;
#[non_exhaustive]
#[derive(Error, Debug)]
pub enum Error {
#[error("svd failed")]
SvdFailed,
}
pub fn pinv(a: &Array2<f64>) -> Result<Array2<f64>, Error> {
//a.conjugate()
let (n, m) = a.dim();
let result: (Option<Array1<f64>>, Array1<f64>, Option<Array1<f64>>) =
a.svd(true, true).map_err(Error::SvdFailed)?;
I am running into issues getting
error[E0599]: no method named `svd` found for reference `&ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>` in the current scope
--> numrs/src/linalg.rs:16:43
|
16 | let (u, s, vt): (_, Array1<_>, _) = a.svd(true, true).unwrap();
| ^^^ help: there is an associated function with a similar name: `std`
the dependencies part of my Cargo.toml file is the same versions as the ndarray-linalg crate on github[2]
[dependencies]
num-complex = "0.4.0"
num-traits = "0.2.14"
rand = "0.8.3"
thiserror = "1.0.24"
[dependencies.ndarray]
version = "0.15.1"
features = ["blas", "approx", "std"]
default-features = false
#ndarray-linalg = { version = "0.13.1", features = ["openblas-static"] }
[dependencies.ndarray-linalg]
github = "https://github.com/rust-ndarray/ndarray-linalg/ndarray-linalg"
version = "0.13.1"
features = ["openblas-static"]
[dependencies.lax]
version = "0.1.0"
github = "https://github.com/rust-ndarray/ndarray-linalg/lax"
default-features = false
Any idea's what is going on here. I downloaded the ndarray-linalg source from github and the test run fine with
$ cargo test --features=openblas svd
- Ngôn ngữ chính
- Rust
- Star
- 452
- Fork
- 95
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của rust-ndarray/ndarray-linalg
-
Thin SVDĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
rust-ndarray/ndarray-linalg#413 · 1 bình luận ·
-
Cyclically Tridiagonal Matrices?Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
rust-ndarray/ndarray-linalg#404 ·
-
SIGSEGV on qr decompositionĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rust-ndarray/ndarray-linalg#402 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
rust-ndarray/ndarray-linalg#401 · 2 reaction ·
Tất cả issue của rust-ndarray/ndarray-linalg
Issue tương tự
-
`sysknife history --help` says --since takes ISO-8601, and the parser refuses offsets and bare datesĐang mởbug easy good first issue help wanted
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 94/100
lacs-project/sysknife#519 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
area:breg bug criticality:p3 triage:needs-implementation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
registrystack/registry-stack#1699 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
lbjlaq/Antigravity-Manager#3539 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày