Triangular Factorization (trf)

trf (defined in namespace flens::lapack) computes an \(LU\) factorization of a general \(m \times n\) matrix \(A\) using partial pivoting with row interchanges.

The factorization has the form

\[ A = P L U \]

where \(P\) is a permutation matrix, \(L\) is lower triangular with unit diagonal elements (lower trapezoidal if \(m > n\)), and \(U\) is upper triangular (upper trapezoidal if \(m < n\)).



(input/output) real or complex valued GeMatrix
On entry, the \(m \times n\) matrix to be factored.
On exit, the factors \(L\) and \(U\) from the factorization \(A = PLU\). The unit diagonal elements of \(L\) are not stored.


(output) integer valued DenseVector
The pivot indices. For \(1 \leq i \leq \min\{m, n\}\), row \(i\) of the matrix was interchanged with row \(piv_i\).