`lax::UPLO` references column-major layout
まだ誰も着手していません。
評価
調査の方向性
Start with ndarray-linalg/src/eigh.rs around line 127 and reproduce the supplied Rust example using both UPLO variants. Read the UPLO documentation and compare the behavior for the array layouts described; done requires a decided, documented strategy for layout handling, including the tuple-of-arrays case.
索引モデルが issue の本文から書いたものです。
説明
Hello everyone, thanks for the great work.
Disclaimer: I'm new to LAPACK & scientific computing in general, apologies if what follows is not perfectly rigorous.
I've noticed that the UPLO flag does not necessarily do what we expect, in the sense that it references the column-major alignment of the data. In particular, I'm not sure this aligns with newcomers' expectations.
To wit, in the following example:
extern crate ndarray;
extern crate ndarray_linalg;
use ndarray::*;
use ndarray_linalg::*;
fn main() {
// A very clearly upper-diagonal matrix
let a = arr2(&[[3.0, 1.0, 1.0], [0.0, 3.0, 1.0], [0.0, 0.0, 3.0]]);
// Works with UPLO::Lower, not UPLO::Upper...
let (e, vecs) = a.eigh(UPLO::Lower).unwrap();
println!("eigenvalues = \n{:?}", e);
println!("V = \n{:?}", vecs);
let av = a.dot(&vecs);
println!("AV = \n{:?}", av);
}
Using UPLO::Upper does not work, even though the matrix is clearly upper-diagonal in ndarray-world.
It looks like this stems from this method, perhaps we should transpose uplo in that case? Note that in the case of a tuple of arrays, we should probably assert that both arrays have the same layout, otherwise it does not make sense to call uplo.t().
It might make sense to decide that UPLO is column-major only, and leave the responsibility to the caller. But in that case I think we should document that behaviour in UPLO's documentation.
I'm happy to propose a PR, let me know which strategy seems best to you.
- 主要言語
- 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
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
bug core
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
JIT-compiled number -> Decimal conversion silently overflows instead of raising DECIMAL_OVERFLOW オープンfuzz
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ClickHouse/ClickHouse#122114 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
linebender/vello_svg#90 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100