Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?hetrf

Computes the Bunch-Kaufman factorization of a complex Hermitian matrix.

Syntax

call chetrf( uplo, n, a, lda, ipiv, work, lwork, info )

call zhetrf( uplo, n, a, lda, ipiv, work, lwork, info )

call hetrf( a [, uplo] [,ipiv] [,info] )

Include Files
  • mkl.fi, lapack.f90
Description

The routine computes the factorization of a complex Hermitian matrix A using the Bunch-Kaufman diagonal pivoting method:

  • if uplo='U', A = U*D*UH

  • if uplo='L', A = L*D*LH,

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 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.

NOTE:

This routine supports the Progress Routine feature. See Progress Routine for details.

Input Parameters

uplo

CHARACTER*1. Must be 'U' or 'L'.

Indicates whether the upper or lower triangular part of A is stored and how A is factored:

If uplo = 'U', the array a stores the upper triangular part of the matrix A, and A is factored as U*D*UH.

If uplo = 'L', the array a stores the lower triangular part of the matrix A, and A is factored as L*D*LH.

n

INTEGER. The order of matrix A; n 0.

a, work

COMPLEX for chetrf

DOUBLE COMPLEX for zhetrf.

Arrays, size (lda,*), work(*).

The array a contains the upper or the lower triangular part of the matrix A (see uplo). The second dimension of a must be at least max(1, n).

work(*) is a workspace array of dimension at least max(1, lwork).

lda

INTEGER. The leading dimension of a; at least max(1, n).

lwork

INTEGER. The size of the work array (lworkn).

If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.

See Application Notes for the suggested value of lwork.

Output Parameters

a

The upper or lower triangular part of a is overwritten by details of the block-diagonal matrix D and the multipliers used to obtain the factor U (or L).

work(1)

If info = 0, on exit work(1) contains the minimum value of lwork required for optimum performance. Use this lwork for subsequent runs.

ipiv

INTEGER.

Array, size 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 (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 (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.

LAPACK 95 Interface Notes

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 LAPACK 95 Interface Conventions.

Specific details for the routine hetrf interface are as follows:

a

holds the matrix A of size (n, n)

ipiv

holds the vector of length n

uplo

must be 'U' or 'L'. The default value is 'U'.

Application Notes

This routine is suitable for Hermitian matrices that are not known to be positive-definite. If A is in fact positive-definite, the routine does not perform interchanges, and no 2-by-2 diagonal blocks occur in D.

For better performance, try using lwork = n*blocksize, where blocksize is a machine-dependent value (typically, 16 to 64) required for optimum performance of the blocked algorithm.

If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set lwork = -1.

If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value described, the routine completes the task, though probably not so fast as with a recommended workspace, and provides the recommended workspace in the first element of the corresponding array work on exit. Use this value (work(1)) for subsequent runs.

If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the first element of the corresponding array (work). This operation is called a workspace query.

Note that if you set lwork to less than the minimal required value and not -1, the routine returns immediately with an error exit and does not provide any information on the recommended workspace.

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).

Ifipiv(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:

?hetrs

to solve A*X = B

?hecon

to estimate the condition number of A

?hetri

to compute the inverse of A.