Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?getrf2
Computes LU factorization using partial pivoting with row interchanges.
Syntax
call sgetrf2 ( m , n , a , lda , ipiv , info )
call dgetrf2 ( m , n , a , lda , ipiv , info )
call cgetrf2 ( m , n , a , lda , ipiv , info )
call zgetrf2 ( m , n , a , lda , ipiv , info )
Include Files
mkl.fi
Description
?getrf2 computes an LU factorization of a general m -by- n matrix A using partial pivoting with row interchanges.
The factorization has the form
\(A = PLU\)
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 ).
This is the recursive version of the algorithm. It divides the matrix into four submatrices:
\[A = \begin{pmatrix} A_{11} & A_{12} \\ A_{21} & A_{22} \end{pmatrix}\]
where \(A_{11}\) is n1 by n1 and \(A_{22}\) is n2 by n2 with n1 = min(m,n), and n2 = n-n1 .
The subroutine calls itself to factor \(\begin{pmatrix} A_{11} \\ A_{21} \end{pmatrix}\), do the swaps on \(\begin{pmatrix} A_{12} \\ A_{22} \end{pmatrix}\), solve A12 , update \(A_{22}\) , then it calls itself to factor \(A_{22}\) and do the swaps on \(A_{21}\) .
Input Parameters
m
INTEGER. The number of rows of the matrix A. m >= 0.
n
INTEGER. The number of columns of the matrix A. n >= 0.
- a
-
REAL for sgetrf2 DOUBLE PRECISION for dgetrf2 COMPLEX for cgetrf2 DOUBLE COMPLEX for zgetrf2
Array, size ( lda , n ) .
On entry, the m -by- n matrix to be factored.
lda
INTEGER. The leading dimension of the array a . lda >= max(1, m ).
Output Parameters
- a
-
On exit, the factors L and U from the factorization A = P * L * U ; the unit diagonal elements of L are not stored.
ipiv
INTEGER. Array, size (min( m , n )).
The pivot indices; for 1 <= i <= min( m , n ), row i of the matrix was interchanged with row ipiv(i) .
info
INTEGER.
= 0: successful exit.
< 0: if info = - i , the i -th argument had an illegal value.
> 0: if info = i , \(U_{ii}\) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.
Return Values
No return value, info is an Output Parameter.