Developer Reference for Intel® oneAPI Math Kernel Library for C
?getrf2
Computes LU factorization using partial pivoting with row interchanges.
Syntax
lapack_intLAPACKE_sgetrf2 ( intmatrix_layout , lapack_intm , lapack_intn , float*a , lapack_intlda , lapack_int*ipiv );
lapack_intLAPACKE_dgetrf2 ( intmatrix_layout , lapack_intm , lapack_intn , double*a , lapack_intlda , lapack_int*ipiv );
lapack_intLAPACKE_cgetrf2 ( intmatrix_layout , lapack_intm , lapack_intn , lapack_complex_float*a , lapack_intlda , lapack_int*ipiv );
lapack_intLAPACKE_zgetrf2 ( intmatrix_layout , lapack_intm , lapack_intn , lapack_complex_double*a , lapack_intlda , lapack_int*ipiv );
Include Files
mkl.h
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
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
m
The number of rows of the matrix A. m >= 0.
n
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
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
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-1] .
Return Values
This function returns a value info .
= 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.