?sytrf
?sytrf
Computes the Bunch-Kaufman factorization of a symmetric matrix.
Syntax
lapack_int
LAPACKE_ssytrf
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
float
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_dsytrf
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
double
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_csytrf
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_complex_float
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_zsytrf
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_complex_double
*
a
,
lapack_int
lda
,
lapack_int
*
ipiv
);
Include Files
- mkl.h
Description
The routine computes the
factorization of a real/complex
symmetric matrix
A
using
the Bunch-Kaufman diagonal pivoting method. The form of the
factorization is:- if,uplo='U'A=U*D*UT
- if,uplo='L'A=L*D*LT
where
A
is the input matrix, U
and L
are products of permutation and triangular matrices with unit diagonal (upper triangular for U
and lower triangular for L
), and D
is a symmetric block-diagonal matrix with 1-by-1 and 2-by-2 diagonal blocks. U
and L
have 2-by-2 unit diagonal blocks corresponding to the 2-by-2 blocks of D
.This routine supports the Progress Routine feature. See Progress Routine
for details.
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- uplo
- Must be'U'or'L'.Indicates whether the upper or lower triangular part ofAis stored and howAis factored:Ifuplo='U', the arrayastores the upper triangular part of the matrixA, andAis factored as.U*D*UTIfuplo='L', the arrayastores the lower triangular part of the matrixA, andAis factored as.L*D*LT
- n
- The order of matrixA;n≥0.
- a
- Array, sizemax(1,. The arraylda*n)acontains either the upper or the lower triangular part of the matrixA(seeuplo).
- lda
- The leading dimension ofa; at least.max(1,n)
Output Parameters
- a
- The upper or lower triangular part ofais overwritten by details of the block-diagonal matrixDand the multipliers used to obtain the factorU(orL).
- ipiv
- Array, size at leastmax(1,. Contains details of the interchanges and the block structure ofn)D. If, thenipiv[i-1] =k>0is a 1-by-1 block, and thediii-th row and column ofAwas interchanged with thek-th row and column.Ifuplo='U'andipiv[i] =ipiv[i-1] = -m< 0, thenDhas a 2-by-2 block in rows/columnsiand, andi+1i-th row and column ofAwas interchanged with them-th row and column.Ifuplo='L'andipiv[i] =ipiv[i-1] = -m< 0, thenDhas a 2-by-2 block in rows/columnsiandi+1, and (i+1)-th row and column ofAwas interchanged with them-th row and column.
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
D
i
i
D
is exactly singular. Division by 0 will occur if you use D
for solving a system of linear equations.Application Notes
The 2-by-2 unit diagonal blocks and the unit diagonal elements of
U
and L
are not stored. The remaining elements of U
and L
are stored in the corresponding columns of the array a
, but additional row interchanges are required to recover U
or L
explicitly (which is seldom necessary).If
, then all off-diagonal elements of
ipiv
[i
-1] = i
for all i
=1...n
U
(L
) are stored explicitly in the corresponding elements of the array a
.If , the computed factors , where
uplo
= 'U'
U
and D
are the exact factors of a perturbed matrix A
+ E
|E| ≤ c(n)ε P|U||D||UT|PT
c
(n
)n
, and ε
is the machine precision. A similar estimate holds for the computed L
and D
when uplo
= 'L'
The total number of floating-point operations is approximately
(1/3)
for real flavors or n
3
(4/3)
for complex flavors.n
3
After calling this routine, you can call the following routines:
If ,
then , where
uplo
= 'U'
A
= U
*D
*U'
U = P(n)*U(n)* ... *P(k)*U(k)*...,
that is,
U
is a product of terms P
(k
)*U
(k
), where- kdecreases fromnto 1 in steps of 1 and 2.
- Dis a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocksD(k).
- P(k) is a permutation matrix as defined by.ipiv[k-1]
- U(k) is a unit upper triangular matrix, such that if the diagonal blockD(k) is of orders(s= 1 or 2), then
If
s
= 1, D
(k
) overwrites A
(k
,k
), and v
overwrites A
(1:k
-1,k
).If
s
= 2, the upper triangle of D
(k
) overwrites A
(k
-1,k
-1), A
(k
-1,k
) and A
(k
,k
),
and v
overwrites A
(1:k
-2,k
-1:k
).If ,
then , where
uplo
= 'L'
A
= L
*D
*L'
L = P(1)*L(1)* ... *P(k)*L(k)*...,
that is,
L
is a product of terms P
(k
)*L
(k
), where- kincreases from 1 tonin steps of 1 and 2.
- Dis a block diagonal matrix with 1-by-1 and 2-by-2 diagonal blocksD(k).
- P(k) is a permutation matrix as defined byipiv(k).
- L(k) is a unit lower triangular matrix, such that if the diagonal blockD(k) is of orders(s= 1 or 2), then
If
s
= 1, D
(k
) overwrites A
(k
,k
), and v
overwrites A
(k
+1:n
,k
).If
s
= 2, the lower triangle of D
(k
) overwrites A
(k
,k
), A
(k
+1,k
), and A
(k
+1,k
+1),
and v
overwrites A
(k
+2:n
,k
:k
+1).