`lax::UPLO` references column-major layout
还没有人认领这个 Issue。
评估
调研方向
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
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rust-ndarray/ndarray-linalg 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
rust-ndarray/ndarray-linalg#420 ·
-
Thin SVD未关闭
难度 5/5 一周以上 新手友好度 38/100
rust-ndarray/ndarray-linalg#414 ·
-
难度 5/5 一周以上 新手友好度 30/100
rust-ndarray/ndarray-linalg#413 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
rust-ndarray/ndarray-linalg#404 ·
-
难度 4/5 3-5 天 新手友好度 35/100
rust-ndarray/ndarray-linalg#402 · 1 条评论 ·
查看 rust-ndarray/ndarray-linalg 的全部 Issue
相似的 Issue
-
arch-audit refactor
难度 2/5 1-3 小时 新手友好度 82/100
SocketDev/socket-patch#1011 ·
维护者通常 1 天内回复
-
L: github:actions L: php:composer
难度 2/5 1-3 小时 新手友好度 88/100
dependabot/dependabot-core#16493 ·
维护者通常 1 天内回复
-
agent-ready area:breg bug criticality:p3 triage:needs-implementation
难度 2/5 1-3 小时 新手友好度 78/100
registrystack/registry-stack#1941 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
joshstevens19/rindexer#483 ·
维护者通常 1 天内回复
-
VX_PRINT_DROPS prints each drop point twice on the default code generator, the second time at line 0未关闭
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复