Add RQ decomposition
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 452
- Forks
- 95
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-ndarray/ndarray-linalg
-
Thin SVDAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
rust-ndarray/ndarray-linalg#414 ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
rust-ndarray/ndarray-linalg#413 · 1 comentario ·
-
Cyclically Tridiagonal Matrices?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
rust-ndarray/ndarray-linalg#404 ·
-
SIGSEGV on qr decompositionAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rust-ndarray/ndarray-linalg#402 · 1 comentario ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
rust-ndarray/ndarray-linalg#401 · 2 reacciones ·
Todos los issues de rust-ndarray/ndarray-linalg
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
vercel-labs/agent-browser#2017 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
tursodatabase/turso#9405 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
PolyMeilex/Neothesia#447 ·
Los mantenedores suelen responder en 1 día
-
backend::vllm diffusion multimodal
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
trezor/trezor-firmware#7985 ·
Los mantenedores suelen responder en 2 días