Developer Reference for Intel® oneAPI Math Kernel Library for Fortran
?getrf
Computes the LU factorization of a general m-by-n matrix.
Syntax
call sgetrf ( m , n , a , lda , ipiv , info )
call dgetrf ( m , n , a , lda , ipiv , info )
call cgetrf ( m , n , a , lda , ipiv , info )
call zgetrf ( m , n , a , lda , ipiv , info )
call getrf ( a [ , ipiv ] [ , info ] )
Include Files
mkl.fi , mkl_lapack.f90
Description
sgetrf dgetrf cgetrf zgetrf getrf
The routine computes the LU factorization of a general m -by- n matrix A as
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 ). The routine uses partial pivoting, with row interchanges.
This routine supports the Progress Routine feature. See Progress Function for details.
Input Parameters
m
INTEGER. The number of rows in the matrix A ( m ≥ 0 ).
n
INTEGER . The number of columns in A ; n ≥ 0 .
a
REAL for sgetrfDOUBLE PRECISION for dgetrfCOMPLEX for cgetrfDOUBLE COMPLEX for zgetrf .
Array, size lda by * . Contains the matrix A . The second dimension of a must be at least max(1, n) .
lda
INTEGER . The leading dimension of array a .
Output Parameters
a
Overwritten by L and U . The unit diagonal elements of L are not stored.
ipiv
INTEGER .
Array, size at least max(1,min(m, n)) . Contains the pivot indices; for 1 ≤i≤ min(m, n) , row i was interchanged with row ipiv(i) .
info
INTEGER .
If info = -i , the i -th parameter had an illegal value.
If info = i, u_{ii} is 0. The factorization has been completed, but U is exactly singular. Division by 0 will occur if you use the factor U for solving a system of linear equations.
Return Values
No return value, info is an Output Parameter.
LAPACK 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see LAPACK 95 Interface Conventions .
Specific details for the routine getrf interface are as follows:
a
Holds the matrix A of size ( m,n ).
ipiv
Holds the vector of length min( m,n ).
Application Notes
The computed \(L\) and \(U\) are the exact factors of a perturbed matrix \(A\) + \(E\) , where
\[|E| \leq c(min(m,n))\varepsilon P|L||U|\]
c(n) is a modest linear function of n , and \(\varepsilon\) is the machine precision.
The approximate number of floating-point operations for real flavors is
\((2/3)n^{3}\) if m = n,
\((1/3)n^{2}(3m - n)\) if m>n, or
\((1/3)m^{2}(3n - m)\) if m<n.
The number of operations for complex flavors is four times greater.
After calling this routine with m = n , you can call the following:
?getrs (Solves a system of linear equations with an LU-factored square coefficient matrix, with multiple right-hand sides.)
to solve \(A X = B\) or \(A^{T}X = B\) or \(A^{H}X = B\)
?gecon (Estimates the reciprocal of the condition number of a general matrix in the 1-norm or the infinity-norm.)
to estimate the condition number of \(A\)
?getri (Computes the inverse of an LU-factored general matrix.)
to compute the inverse of \(A\) .