Add RQ decomposition
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the existing qr API and its LAPACK bindings, then investigate how gerqf applies to row-major arrays and what the equivalent is for column-major storage. Done means a built-in RQ decomposition API handles the relevant array layouts and returns the R and Q factors described in the issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hello, and thanks for the great library. I would like to request the addition of RQ decomposition. Although it's fairly trivial to implement RQ in terms of QR (link), it still took me quite some time to figure this out even with AI help (which used extra unnecessary flips).
One thing that made this challenging for me was that qr does not accept arrays with negative strides, so any slice had to then be copied into another backing array. This is ultimately what I ended up with:
use ndarray::Data;
use ndarray::prelude::*;
use ndarray_linalg::error::Result;
use ndarray_linalg::{Lapack, QRInto, Scalar};
pub trait RQ {
type R;
type Q;
fn rq(&self) -> Result<(Self::R, Self::Q)>;
}
impl<A, S> RQ for ArrayBase<S, Ix2>
where
A: Scalar + Lapack,
S: Data<Elem = A>,
{
type R = Array2<A>;
type Q = Array2<A>;
fn rq(&self) -> Result<(Self::R, Self::Q)> {
let a = Array::from_shape_vec(
self.raw_dim(),
self.slice(s![..;-1,..]).t().iter().cloned().collect(),
)?;
let (q, r) = a.qr_into()?;
let q = Array::from_shape_vec(
q.raw_dim(),
q.t().slice(s![..;-1,..]).iter().cloned().collect(),
)?;
let r = Array::from_shape_vec(
r.raw_dim(),
r.t().slice(s![..;-1,..;-1]).iter().cloned().collect(),
)?;
Ok((r, q))
}
}
A built-in RQ would ideally use gerqf for row major arrays. Not sure what the equivalent would be for column major.
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-ndarray/ndarray-linalg
-
Thin SVD Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
rust-ndarray/ndarray-linalg#413 · 1 commento ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
rust-ndarray/ndarray-linalg#404 ·
-
SIGSEGV on qr decomposition Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rust-ndarray/ndarray-linalg#402 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
rust-ndarray/ndarray-linalg#401 · 2 reazioni ·
Tutte le issue di rust-ndarray/ndarray-linalg
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
longbridge/gpui-kit#3223 ·
-
bug engine
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
rocky-data/rocky#2181 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
[indexer] [QA] Add a focused test for the new NonRetryableError / assertSocketAlive() behavior. Apertabot:ai-assisted component:indexer QA-roadmap status:untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
midnightntwrk/midnight-indexer#1557 ·