naginterfaces.library.lapacklin.zhptrf

naginterfaces.library.lapacklin.zhptrf(uplo, n, ap)[source]

zhptrf computes the Bunch–Kaufman factorization of a complex Hermitian indefinite matrix, using packed storage.

For full information please refer to the NAG Library document for f07pr

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/f07/f07prf.html

Parameters
uplostr, length 1

Specifies whether the upper or lower triangular part of is stored and how is to be factorized.

The upper triangular part of is stored and is factorized as , where is upper triangular.

The lower triangular part of is stored and is factorized as , where is lower triangular.

nint

, the order of the matrix .

apcomplex, array-like, shape

The Hermitian matrix , packed by columns.

Returns
apcomplex, ndarray, shape

is overwritten by details of the block diagonal matrix and the multipliers used to obtain the factor or as specified by .

ipivint, ndarray, shape

Details of the interchanges and the block structure of . More precisely,

if , is a pivot block and the th row and column of were interchanged with the th row and column;

if and , is a pivot block and the th row and column of were interchanged with the th row and column;

if and , is a pivot block and the th row and column of were interchanged with the th row and column.

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: or .

(errno )

On entry, error in parameter .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

Element of the diagonal is exactly zero. The factorization has been completed, but the block diagonal matrix is exactly singular, and division by zero will occur if it is used to solve a system of equations.

Notes

zhptrf factorizes a complex Hermitian matrix , using the Bunch–Kaufman diagonal pivoting method and packed storage. is factorized as either if or if , where is a permutation matrix, (or ) is a unit upper (or lower) triangular matrix and is an Hermitian block diagonal matrix with and diagonal blocks; (or ) has unit diagonal blocks corresponding to the blocks of . Row and column interchanges are performed to ensure numerical stability while keeping the matrix Hermitian.

This method is suitable for Hermitian matrices which are not known to be positive definite. If is in fact positive definite, no interchanges are performed and no blocks occur in .

References

Golub, G H and Van Loan, C F, 1996, Matrix Computations, (3rd Edition), Johns Hopkins University Press, Baltimore