?getrf
?getrf
Computes the LU factorization of a general m-by-n matrix.
Syntax
lapack_int
LAPACKE_sgetrf
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
float
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_dgetrf
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
double
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_cgetrf
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
lapack_complex_float
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_zgetrf
(
int
matrix_layout
,
lapack_int
m
,
lapack_int
n
,
lapack_complex_double
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
Include Files
- mkl.h
Description
The routine computes the
LU
factorization of a general m
-by-n
matrix A
as A = P*L*U,
where ) and ). The routine uses partial pivoting, with row interchanges.
P
is a permutation matrix, L
is lower triangular with unit diagonal elements (lower trapezoidal if m
> n
U
is upper triangular (upper trapezoidal if m
< n
This routine supports the Progress Routine feature. See Progress Function
for details.
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 in the matrixA().m≥0
- n
- The number of columns inA;.n≥0
- a
- Array, size at least max(1,lda*n) for column-major layout or max(1,lda*m) for row-major layout. Contains the matrixA.
- lda
- The leading dimension of arraya, which must be at least max(1,m) for column-major layout or max(1,n) for row-major layout.
Output Parameters
- a
- Overwritten byLandU. The unit diagonal elements ofLare not stored.
- ipiv
- Array, size at leastmax(1,min(. Contains the pivot indices; form,n))1, row≤i≤min(m,n)iwas interchanged with row.ipiv(i)
Return Values
This function returns a value
info
.If , the execution is successful.
info
=0If , parameter
info
= -i
i
had an illegal value.If is 0. The factorization has been completed, but
info
= i
, u
i
i
U
is exactly singular. Division by 0 will occur if you use the factor U
for solving a system of linear equations.Application Notes
The computed
L
and U
are the exact factors of a perturbed matrix A
+ E
, where |E| ≤ c(min(m,n))ε P|L||U|
c
(n
)n
, and ε
is the machine precision.The approximate number of floating-point operations for real flavors is
- (2/3)n3
- If,m=n
- (1/3)n2(3m-n)
- If,m>n
- (1/3)m2(3n-m)
- If.m<n
The number of operations for complex flavors is four times greater.
After calling this routine with , you can call the following:
m
= n