Skip to main content

Module matrixlu

Module matrixlu 

Source
Expand description

Rank-Revealing LU decomposition (rrLU) implementation.

Provides RrLU, a full-pivoting LU decomposition that reveals the numerical rank of a matrix. The decomposition is:

P_row * A * P_col = L * U

where P_row, P_col are permutation matrices. The rank is determined by the number of pivots exceeding the tolerance thresholds in RrLUOptions.

§Examples

use tensor4all_tcicore::{from_vec2d, matrixlu::rrlu};

let m = from_vec2d(vec![
    vec![1.0_f64, 2.0],
    vec![3.0, 4.0],
]);
let lu = rrlu(&m, None).unwrap();
assert_eq!(lu.npivots(), 2);

Structs§

RrLU
Rank-Revealing LU decomposition.
RrLUOptions
Options for rank-revealing LU decomposition.

Functions§

cols_to_l_matrix
Convert L matrix to solve L * X = B given pivot matrix P
rows_to_u_matrix
Convert R matrix to solve X * U = B given pivot matrix P
rrlu
Perform rank-revealing LU decomposition (non-destructive).
rrlu_inplace
Perform in-place rank-revealing LU decomposition.
solve_lu
Solve LU * x = b