getting no method named `svd` found for reference `&ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>`
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Rust
- スター
- 452
- フォーク
- 95
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rust-ndarray/ndarray-linalg のほかの issue
-
Thin SVD オープン
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
rust-ndarray/ndarray-linalg#414 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
rust-ndarray/ndarray-linalg#413 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
rust-ndarray/ndarray-linalg#404 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-ndarray/ndarray-linalg#402 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
rust-ndarray/ndarray-linalg#401 · リアクション 2 件 ·
rust-ndarray/ndarray-linalg の issue をすべて見る
似ている issue
-
bug github_actions
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
registrystack/registry-stack#1393 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
rocky-data/rocky#2181 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. オープンbot:ai-assisted component:indexer QA-roadmap status:untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
midnightntwrk/midnight-indexer#1557 ·