pub unsafe fn getrf2(
m: usize,
n: usize,
a: *mut f64,
lda: usize,
ipiv: &mut [i32],
) -> Result<(), String>
Expand description
Computes the LU factorization of a general M-by-N matrix using partial pivoting (unsafe version).
This function is an unsafe
variant of getrf
that operates on a raw pointer to the
matrix data. It performs an LU decomposition of a matrix A
, resulting in a
factorization of the form P * A = L * U
, where:
P
is a permutation matrix,L
is a lower triangular matrix with a unit diagonal,U
is an upper triangular matrix.
§Arguments
m
- The number of rows in the matrixA
.n
- The number of columns in the matrixA
.a
- A raw mutable pointer to the first element of theM
-by-N
matrixA
, which is assumed to be in column-major order. On successful exit, the memory region is overwritten with theL
andU
factors. The unit diagonal ofL
is not stored.lda
- The leading dimension ofA
. It specifies the stride between consecutive columns in memory and must be at leastmax(1, m)
.ipiv
- A mutable slice that will be filled with the pivot indices. Its length must be at leastmin(m, n)
. For eachi
from 0 tomin(m,n)-1
, rowi
was interchanged with rowipiv[i]
.
§Returns
Ok(())
- If the factorization completed successfully.Err(String)