?hetrf_rk
?hetrf_rk
Computes the factorization of a complex Hermitian indefinite matrix using the bounded Bunch-Kaufman (rook) diagonal pivoting method (BLAS3 blocked algorithm).
lapack_int
LAPACKE_chetrf_rk
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_complex_float
*
A
,
lapack_int
lda
,
lapack_complex_float
*
e
,
lapack_int
*
ipiv
);
lapack_int
LAPACKE_zhetrf_rk
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_complex_double
*
A
,
lapack_int
lda
,
lapack_complex_double
*
e
,
lapack_int
*
ipiv
);
Description
?hetrf_rk
computes the factorization of a complex Hermitian matrix A using the bounded Bunch-Kaufman (rook) diagonal pivoting method: A = P*U*D*(UH
)*(PT
) or A = P*L*D*(LH
)*(PT
), where U (or L) is unit upper (or lower) triangular matrix, UH
(or LH
) is the conjugate of U (or L), P is a permutation matrix, PT
is the transpose of P, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.This is the blocked version of the algorithm, calling Level 3 BLAS.
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- uplo
- Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored:
- ='U': Upper triangular.
- ='L': Lower triangular.
- n
- The order of the matrix A.n≥ 0.
- A
- Array of size max(1,On entry, the Hermitian matrix A. Iflda*n).uplo='U': The leadingn-by-nupper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. Ifuplo='L': The leadingn-by-nlower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
- lda
- The leading dimension of the arrayA.
Output Parameters
- A
- On exit, contains:
- Onlydiagonal elements of the Hermitian block diagonal matrix D on the diagonal of A; that is, D(k,k) = A(k,k). Superdiagonal (or subdiagonal) elements of D are stored on exit in arraye.—and—
- Ifuplo='U', factor U in the superdiagonal part of A. Ifuplo='L', factor L in the subdiagonal part of A.
- e
- Array of sizeOn exit, contains the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks. Ifn.uplo='U', e(i) = D(i-1,i),i=2:N, and e(1) is set to 0. Ifuplo='L', e(i) = D(i+1,i),i=1:N-1, and e(n) is set to 0.For 1-by-1 diagonal block D(k), where 1 ≤ k ≤n, the elemente[k-1] is set to 0 in both theuplo='U'anduplo='L'cases.
- ipiv
- Array of sizen.ipivdescribes the permutation matrix P in the factorization of matrix A as follows: The absolute value ofipiv[k-1] represents the index of row and column that were interchanged with thekthrow and column. The value ofuplodescribes the order in which the interchanges were applied. Also, the sign ofipivrepresents the block structure of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks that correspond to 1 or 2 interchanges at each factorization step. Ifuplo='U'(in factorization order,kdecreases fromnto 1):
- A single positive entry ipiv(k) > 0 means that D(k,k) is a 1-by-1 diagonal block. If ipiv(k) !=k, rows and columnskand ipiv(k) were interchanged in the matrix A(1:N,1:N). If ipiv(k) =k, no interchange occurred.
- A pair of consecutive negative entries ipiv(k) < 0 and ipiv(k-1) < 0 means that D(k-1:k,k-1:k) is a 2-by-2 diagonal block. (Note that negative entries inipivappearonlyin pairs.)
- If-ipiv(k) !=k, rows and columnskand-ipiv(k) were interchanged in the matrix A(1:N,1:N). If-ipiv(k) =k, no interchange occurred.
- If-ipiv(k-1) !=k-1, rows and columnsk-1 and-ipiv(k-1) were interchanged in the matrix A(1:N,1:N). If-ipiv(k-1) =k-1, no interchange occurred.
- In both cases 1 and 2, always ABS( ipiv(k) ) ≤k.
Any entry ipiv(k) is always nonzero on output.Ifuplo='L'(in factorization order,kincreases from 1 ton):- A single positive entry ipiv(k) > 0 means that D(k,k) is a 1-by-1 diagonal block. If ipiv(k) !=k, rows and columnskand ipiv(k) were interchanged in the matrix A(1:N,1:N). If ipiv(k) =k, no interchange occurred.
- A pair of consecutive negative entries ipiv(k) < 0 and ipiv(k+1) < 0 means that D(k:k+1,k:k+1) is a 2-by-2 diagonal block. (Note that negative entries inipivappearonlyin pairs.)
- If-ipiv(k) !=k, rows and columnskand-ipiv(k) were interchanged in the matrix A(1:N,1:N). If-ipiv(k) =k, no interchange occurred.
- If-ipiv(k+1) !=k+1, rows and columnsk-1 and-ipiv(k-1) were interchanged in the matrix A(1:N,1:N). If-ipiv(k+1) =k+1, no interchange occurred.
- In both cases 1 and 2, always ABS( ipiv(k) ) ≥k.
Any entry ipiv(k) is always nonzero on output.
Return Values
This function returns a value
info
.= 0: Successful exit.
< 0: If , the
info
= -k
k
th
argument had an illegal value.> 0: If
info
= k
, the matrix A is singular. If uplo
= 'U'
, the column k
in the upper triangular part of A contains all zeros. If uplo
= 'L'
, the column k
in the lower triangular part of A contains all zeros. Therefore D(k
,k
) is exactly zero, and superdiagonal elements of column k
of U (or subdiagonal elements of column k
of L ) are all zeros. The factorization has been completed, but the block diagonal matrix D is exactly singular, and division by zero will occur if it is used to solve a system of equations.