Skip to main content

full_piv_lu_matrix

Function full_piv_lu_matrix 

Source
pub fn full_piv_lu_matrix<T>(
    a: &Matrix<T>,
) -> Result<FullPivLuMatrixResult<T>, BackendLinalgError>
Expand description

Compute complete-pivoting LU for a column-major Matrix. This is a convenience wrapper over full_piv_lu_backend for callers that use Matrix as their dense boundary type.

§Errors

Returns an error when the backend does not support the input dtype (a /// dtype mismatch) or the factorization fails (a backend or /// non-convergence failure).

§Examples

use tensor4all_tensorbackend::{from_vec2d, full_piv_lu_matrix};
let matrix = from_vec2d(vec![vec![0.0_f64, 1.0], vec![2.0, 3.0]]);
let factors = full_piv_lu_matrix(&matrix).unwrap();
assert_eq!(factors.p.nrows(), 2);
assert_eq!(factors.q.ncols(), 2);