XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zhptrf()

void zhptrf ( char  uplo,
int  n,
doublecomplex  ap[],
int  ipiv[],
int *  info 
)

UDUH or LDLH factorization of a Hermitian matrix in packed form

Purpose
This routine computes the factorization of a Hermitian matrix A stored in packed form using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U^H or A = L*D*L^H
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, and D is Hermitian and block diagonal with 1 x 1 and 2 x 2 diagonal blocks.
Parameters
[in]uplo= 'U': Upper triangle of A is stored.
= 'L': Lower triangle of A is stored.
[in]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in,out]ap[]Array ap[lap] (lap >= n(n + 1)/2)
[in] n x n Hermitian matrix A in packed form. The upper or lower part is to be stored in accordance with uplo.
[out] The block diagonal matrix D and the multipliers used to obtain the factor U or L, stored as a packed triangular matrix overwriting A (see below for further details).
[out]ipiv[]Array ipiv[lipiv] (lipiv >= n)
Details of the interchanges and the block structure of D.
If ipiv[k-1] > 0, then rows and columns k and ipiv[k-1] were interchanged, and k-th diagonal of D is a 1 x 1 diagonal block.
If uplo = 'U' and ipiv[k-1] = ipiv[k-2] < 0, then rows and columns k-1 and -ipiv[k-1] were interchanged and (k-1)-th diagonal of D is a 2 x 2 diagonal block.
If uplo = 'L' and ipiv[k-1] = ipiv[k] < 0, then rows and columns k+1 and -ipiv[k-1] were interchanged and k-th diagonal of D is a 2 x 2 diagonal block.
[out]info= 0: Successful exit
= -1: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -2: The argument n had an illegal value (n < 0)
= i > 0: The i-th diagonal element of D is exactly zero. 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.
Further Details
If uplo = 'U', then A = U*D*U^H, where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1 x 1 and 2 x 2 diagonal blocks D(k). P(k) is a permutation matrix as defined by ipiv[k-1], and U(k) is a unit upper triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1 to 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 to k-2, k-1 to k).

If uplo = 'L', then A = L*D*L^H, where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1 x 1 and 2 x 2 diagonal blocks D(k). P(k) is a permutation matrix as defined by ipiv[k-1], and L(k) is a unit lower triangular matrix, such that if the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1 to n,k).
If s = 2, the upper triangle of D(k) overwrites A(k,k), A(k+1,k) and A(k+1,k+1), and v overwrites A(k+2 to n, k to k+1).

Note - A(i,j) shows the element of ap[] corresponding to that in row i and column j of A.
Reference
LAPACK