Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

`lax::UPLO` references column-major layout

オープン
#394 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust
領域
backend

調査の方向性

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 はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-ndarray/ndarray-linalg のほかの issue

rust-ndarray/ndarray-linalg の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。