Computes the Bunch-Kaufman factorization of a complex Hermitian matrix using packed storage.
FORTRAN 77:
call chptrf( uplo, n, ap, ipiv, info )
call zhptrf( uplo, n, ap, ipiv, info )
FORTRAN 95:
call hptrf( ap [,uplo] [,ipiv] [,info] )
C:
lapack_int LAPACKE_<?>hptrf( int matrix_order, char uplo, lapack_int n, <datatype>* ap, lapack_int* ipiv );
The routine computes the factorization of a complex Hermitian packed matrix A using the Bunch-Kaufman diagonal pivoting method:
if uplo='U', A = P*U*D*UH*PT
if uplo='L', A = P*L*D*LH*PT,
where A is the input matrix, P is a permutation matrix, U and L are upper and lower triangular matrices with unit diagonal, and D is a Hermitian 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 Function for details.
The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.
uplo |
CHARACTER*1. Must be 'U' or 'L'. Indicates whether the upper or lower triangular part of A is packed and how A is factored: If uplo = 'U', the array ap stores the upper triangular part of the matrix A, and A is factored as P*U*D*UH*PT. If uplo = 'L', the array ap stores the lower triangular part of the matrix A, and A is factored as P*L*D*LH*PT. |
n |
INTEGER. The order of matrix A; n ≥ 0. |
ap |
COMPLEX for chptrf DOUBLE COMPLEX for zhptrf. Array, DIMENSION at least max(1, n(n+1)/2). The array ap contains the upper or the lower triangular part of the matrix A (as specified by uplo) in packed storage (see Matrix Storage Schemes). |
ap |
The upper or lower triangle of A (as specified by uplo) is overwritten by details of the block-diagonal matrix D and the multipliers used to obtain the factor U (or L). |
ipiv |
INTEGER. Array, DIMENSION at least max(1, n). Contains details of the interchanges and the block structure of D. If ipiv(i) = k > 0, then dii is a 1-by-1 block, and the i-th row and column of A was interchanged with the k-th row and column. If uplo = 'U' and ipiv(i) =ipiv(i-1) = -m < 0, then D has a 2-by-2 block in rows/columns i and i-1, and the (i-1)-th row and column of A was interchanged with the m-th row and column. If uplo = 'L' and ipiv(i) =ipiv(i+1) = -m < 0, then D has a 2-by-2 block in rows/columns i and i+1, and the (i+1)-th row and column of A was interchanged with the m-th row and column. |
info |
INTEGER. If info = 0, the execution is successful. If info = -i, the i-th parameter had an illegal value. If info = i, dii is 0. The factorization has been completed, but D is exactly singular. Division by 0 will occur if you use D for solving a system of linear equations. |
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.
Specific details for the routine hptrf interface are as follows:
ap |
Holds the array A of size (n*(n+1)/2). |
ipiv |
Holds the vector of length n. |
uplo |
Must be 'U' or 'L'. The default value is 'U'. |
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 ipiv(i) = i for all i = 1...n, then all off-diagonal elements of U (L) are stored explicitly in the corresponding elements of the array a.
If uplo = 'U', the computed factors U and D are the exact factors of a perturbed matrix A + E, where
|E| ≤ c(n)ε P|U||D||UT|PT
c(n) is a modest linear function of 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 (4/3)n3.
After calling this routine, you can call the following routines:
to solve A*X = B |
|
to estimate the condition number of A |
|
to compute the inverse of A. |