hpgv#

Functions

void chpgv(
    const INT            itype,
    const char*          jobz,
    const char*          uplo,
    const INT            n,
          c64*  restrict AP,
          c64*  restrict BP,
          f32*  restrict W,
          c64*  restrict Z,
    const INT            ldz,
          c64*  restrict work,
          f32*  restrict rwork,
          INT*           info
);
void chpgv(const INT itype, const char *jobz, const char *uplo, const INT n, c64 *restrict AP, c64 *restrict BP, f32 *restrict W, c64 *restrict Z, const INT ldz, c64 *restrict work, f32 *restrict rwork, INT *info)#

CHPGV computes all the eigenvalues and, optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x.

Here A and B are assumed to be Hermitian, stored in packed format, and B is also positive definite.

Parameters

in
itype

Specifies the problem type to be solved: = 1: A*x = (lambda)*B*x = 2: A*B*x = (lambda)*x = 3: B*A*x = (lambda)*x

in
jobz

= ‘N’: Compute eigenvalues only; = ‘V’: Compute eigenvalues and eigenvectors.

in
uplo

= ‘U’: Upper triangles of A and B are stored; = ‘L’: Lower triangles of A and B are stored.

in
n

The order of the matrices A and B. n >= 0.

inout
AP

Complex*16 array, dimension (n*(n+1)/2). On entry, the upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. On exit, the contents of AP are destroyed.

inout
BP

Complex*16 array, dimension (n*(n+1)/2). On entry, the upper or lower triangle of the Hermitian positive definite matrix B, packed columnwise. On exit, the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.

out
W

Single precision array, dimension (n). If info = 0, the eigenvalues in ascending order.

out
Z

Complex*16 array, dimension (ldz, n). If jobz = ‘V’, then if info = 0, Z contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows: if itype = 1 or 2, Z**H*B*Z = I; if itype = 3, Z**H*inv(B)*Z = I. If jobz = ‘N’, then Z is not referenced.

in
ldz

The leading dimension of the array Z. ldz >= 1, and if jobz = ‘V’, ldz >= max(1,n).

out
work

Complex*16 array, dimension (max(1, 2*n-1)).

out
rwork

Single precision array, dimension (max(1, 3*n-2)).

out
info

= 0: successful exit < 0: if info = -i, the i-th argument had an illegal value > 0: CPPTRF or CHPEV returned an error code: <= n: if info = i, CHPEV failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero; > n: if info = n + i, for 1 <= i <= n, then the leading principal minor of order i of B is not positive. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.

Functions

void zhpgv(
    const INT            itype,
    const char*          jobz,
    const char*          uplo,
    const INT            n,
          c128* restrict AP,
          c128* restrict BP,
          f64*  restrict W,
          c128* restrict Z,
    const INT            ldz,
          c128* restrict work,
          f64*  restrict rwork,
          INT*           info
);
void zhpgv(const INT itype, const char *jobz, const char *uplo, const INT n, c128 *restrict AP, c128 *restrict BP, f64 *restrict W, c128 *restrict Z, const INT ldz, c128 *restrict work, f64 *restrict rwork, INT *info)#

ZHPGV computes all the eigenvalues and, optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x.

Here A and B are assumed to be Hermitian, stored in packed format, and B is also positive definite.

Parameters

in
itype

Specifies the problem type to be solved: = 1: A*x = (lambda)*B*x = 2: A*B*x = (lambda)*x = 3: B*A*x = (lambda)*x

in
jobz

= ‘N’: Compute eigenvalues only; = ‘V’: Compute eigenvalues and eigenvectors.

in
uplo

= ‘U’: Upper triangles of A and B are stored; = ‘L’: Lower triangles of A and B are stored.

in
n

The order of the matrices A and B. n >= 0.

inout
AP

Complex*16 array, dimension (n*(n+1)/2). On entry, the upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. On exit, the contents of AP are destroyed.

inout
BP

Complex*16 array, dimension (n*(n+1)/2). On entry, the upper or lower triangle of the Hermitian positive definite matrix B, packed columnwise. On exit, the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.

out
W

Double precision array, dimension (n). If info = 0, the eigenvalues in ascending order.

out
Z

Complex*16 array, dimension (ldz, n). If jobz = ‘V’, then if info = 0, Z contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows: if itype = 1 or 2, Z**H*B*Z = I; if itype = 3, Z**H*inv(B)*Z = I. If jobz = ‘N’, then Z is not referenced.

in
ldz

The leading dimension of the array Z. ldz >= 1, and if jobz = ‘V’, ldz >= max(1,n).

out
work

Complex*16 array, dimension (max(1, 2*n-1)).

out
rwork

Double precision array, dimension (max(1, 3*n-2)).

out
info

= 0: successful exit < 0: if info = -i, the i-th argument had an illegal value > 0: ZPPTRF or ZHPEV returned an error code: <= n: if info = i, ZHPEV failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero; > n: if info = n + i, for 1 <= i <= n, then the leading principal minor of order i of B is not positive. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.