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

InverseHInto returns incorrect results for row major arrays

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
rust
領域
data

調査の方向性

Reproduce the provided Rust example and inspect the invh_into entry point, especially its handling after the LAPACK routine and the triangular portion copied for row-major arrays. Done means the row-major example returns the expected matrix while the reversed-axes case continues to pass.

索引モデルが issue の本文から書いたものです。

説明

bug

This example

use approx::assert_abs_diff_eq;
use ndarray::*;
use ndarray_linalg::*;

fn main() {
    let arr = array![[1., 3.], [3., 1.]];
    assert_abs_diff_eq!(
        arr.invh_into().unwrap(),
        array![[-0.125, 0.375], [0.375, -0.125]],
        epsilon = 1e-9,
    );
}

fails with the following message

thread 'main' panicked at 'assert_abs_diff_eq!(arr.invh_into().unwrap(), array![[- 0.125, 0.375], [0.375, - 0.125]], epsilon = 1e-9)

    left  = [[-0.125, 3.0],
 [3.0, -0.125]], shape=[2, 2], strides=[2, 1], layout=Cc (0x5), const ndim=2
    right = [[-0.125, 0.375],
 [0.375, -0.125]], shape=[2, 2], strides=[2, 1], layout=Cc (0x5), const ndim=2

It seems that invh_into is copying the incorrect triangular portion to overwrite the other triangular portion of the matrix after calling the LAPACK routine. This bug is layout-dependent. Changing arr in the example to array![[1., 3.], [3., 1.]].reversed_axes() causes the assertion to pass.

主要言語
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 を短くまとめたダイジェスト。