hegv#

Functions

void chegv(
    const INT            itype,
    const char*          jobz,
    const char*          uplo,
    const INT            n,
          c64*  restrict A,
    const INT            lda,
          c64*  restrict B,
    const INT            ldb,
          f32*  restrict W,
          c64*  restrict work,
    const INT            lwork,
          f32*  restrict rwork,
          INT*           info
);
void chegv(const INT itype, const char *jobz, const char *uplo, const INT n, c64 *restrict A, const INT lda, c64 *restrict B, const INT ldb, f32 *restrict W, c64 *restrict work, const INT lwork, f32 *restrict rwork, INT *info)#

CHEGV 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 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
A

Complex*16 array, dimension (lda, n). On entry, the Hermitian matrix A. On exit, if jobz = ‘V’, then if info = 0, A contains the matrix Z of eigenvectors.

in
lda

The leading dimension of the array A. lda >= max(1,n).

inout
B

Complex*16 array, dimension (ldb, n). On entry, the Hermitian positive definite matrix B. On exit, if info <= n, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.

in
ldb

The leading dimension of the array B. ldb >= max(1,n).

out
W

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

out
work

Complex*16 array, dimension (max(1,lwork)). On exit, if info = 0, work[0] returns the optimal lwork.

in
lwork

The length of the array work. lwork >= max(1,2*n-1). For optimal efficiency, lwork >= (nb+1)*n, where nb is the blocksize for CHETRD. If lwork = -1, then a workspace query is assumed.

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: CPOTRF or CHEEV returned an error code: <= n: if info = i, CHEEV failed to converge; > n: if info = n + i, for 1 <= i <= n, then the leading principal minor of order i of B is not positive.

Functions

void zhegv(
    const INT            itype,
    const char*          jobz,
    const char*          uplo,
    const INT            n,
          c128* restrict A,
    const INT            lda,
          c128* restrict B,
    const INT            ldb,
          f64*  restrict W,
          c128* restrict work,
    const INT            lwork,
          f64*  restrict rwork,
          INT*           info
);
void zhegv(const INT itype, const char *jobz, const char *uplo, const INT n, c128 *restrict A, const INT lda, c128 *restrict B, const INT ldb, f64 *restrict W, c128 *restrict work, const INT lwork, f64 *restrict rwork, INT *info)#

ZHEGV 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 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
A

Complex*16 array, dimension (lda, n). On entry, the Hermitian matrix A. On exit, if jobz = ‘V’, then if info = 0, A contains the matrix Z of eigenvectors.

in
lda

The leading dimension of the array A. lda >= max(1,n).

inout
B

Complex*16 array, dimension (ldb, n). On entry, the Hermitian positive definite matrix B. On exit, if info <= n, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H.

in
ldb

The leading dimension of the array B. ldb >= max(1,n).

out
W

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

out
work

Complex*16 array, dimension (max(1,lwork)). On exit, if info = 0, work[0] returns the optimal lwork.

in
lwork

The length of the array work. lwork >= max(1,2*n-1). For optimal efficiency, lwork >= (nb+1)*n, where nb is the blocksize for ZHETRD. If lwork = -1, then a workspace query is assumed.

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: ZPOTRF or ZHEEV returned an error code: <= n: if info = i, ZHEEV failed to converge; > n: if info = n + i, for 1 <= i <= n, then the leading principal minor of order i of B is not positive.