Skip to main content

qr_pivoting

Function qr_pivoting 

Source
pub fn qr_pivoting<T: LinalgScalar>(
    a: &[T],
    batch: usize,
    m: usize,
    n: usize,
    full_matrices: bool,
) -> (Vec<T>, Vec<T>, Vec<i32>)
Expand description

The QR decomposition with column pivoting A P = Q R of each m x n matrix of a batch, as lax.linalg.qr(pivoting=True) computes it with LAPACK’s geqp3 (its unblocked laqp2): at each step, the column of largest remaining norm (the first one, if several) is moved forward, and the norms are downdated, or recomputed where the downdate loses accuracy.

Returns Q and R (as qr) and the permutations (n per matrix, 0-based: column j of A P is column p[j] of A; zeros for empty matrices, as JAX returns).

§Panics

Panics if a does not have batch * m * n elements, or if n does not fit in an i32.