Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

`lax::UPLO` references column-major layout

Aperta
#394 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Rust
Stelle
452
Fork
95
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-ndarray/ndarray-linalg

Tutte le issue di rust-ndarray/ndarray-linalg

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.