heevd#

Functions

void cheevd(
    const char*          jobz,
    const char*          uplo,
    const INT            n,
          c64*  restrict A,
    const INT            lda,
          f32*  restrict W,
          c64*  restrict work,
    const INT            lwork,
          f32*  restrict rwork,
    const INT            lrwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void cheevd(const char *jobz, const char *uplo, const INT n, c64 *restrict A, const INT lda, f32 *restrict W, c64 *restrict work, const INT lwork, f32 *restrict rwork, const INT lrwork, INT *restrict iwork, const INT liwork, INT *info)#

CHEEVD computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A.

If eigenvectors are desired, it uses a divide and conquer algorithm.

Parameters

in
jobz

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

in
uplo

= ‘U’: Upper triangle of A is stored; = ‘L’: Lower triangle of A is stored.

in
n

The order of the matrix A. n >= 0.

inout
A

On entry, the Hermitian matrix A. On exit, if JOBZ = ‘V’, then A contains the orthonormal eigenvectors of the matrix A. If JOBZ = ‘N’, then the triangle is destroyed.

in
lda

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

out
W

Array of dimension (n). The eigenvalues in ascending order.

out
work

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

in
lwork

The dimension of work. If N <= 1, LWORK >= 1. If JOBZ = ‘N’ and N > 1, LWORK >= N + 1. If JOBZ = ‘V’ and N > 1, LWORK >= 2*N + N**2. If lwork = -1, workspace query only.

out
rwork

Single precision workspace array, dimension (max(1, lrwork)). On exit, if info = 0, rwork[0] returns the optimal lrwork.

in
lrwork

The dimension of rwork. If N <= 1, LRWORK >= 1. If JOBZ = ‘N’ and N > 1, LRWORK >= N. If JOBZ = ‘V’ and N > 1, LRWORK >= 1 + 5*N + 2*N**2. If lrwork = -1, workspace query only.

out
iwork

Integer workspace array, dimension (max(1, liwork)). On exit, if info = 0, iwork[0] returns the optimal liwork.

in
liwork

The dimension of iwork. If N <= 1, LIWORK >= 1. If JOBZ = ‘N’ and N > 1, LIWORK >= 1. If JOBZ = ‘V’ and N > 1, LIWORK >= 3 + 5*N. If liwork = -1, workspace query only.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: if info = i and JOBZ = ‘N’, the algorithm failed to converge; i off-diagonal elements did not converge to zero; if info = i and JOBZ = ‘V’, the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns INFO/(N+1) through mod(INFO,N+1).

Functions

void zheevd(
    const char*          jobz,
    const char*          uplo,
    const INT            n,
          c128* restrict A,
    const INT            lda,
          f64*  restrict W,
          c128* restrict work,
    const INT            lwork,
          f64*  restrict rwork,
    const INT            lrwork,
          INT*  restrict iwork,
    const INT            liwork,
          INT*           info
);
void zheevd(const char *jobz, const char *uplo, const INT n, c128 *restrict A, const INT lda, f64 *restrict W, c128 *restrict work, const INT lwork, f64 *restrict rwork, const INT lrwork, INT *restrict iwork, const INT liwork, INT *info)#

ZHEEVD computes all eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A.

If eigenvectors are desired, it uses a divide and conquer algorithm.

Parameters

in
jobz

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

in
uplo

= ‘U’: Upper triangle of A is stored; = ‘L’: Lower triangle of A is stored.

in
n

The order of the matrix A. n >= 0.

inout
A

On entry, the Hermitian matrix A. On exit, if JOBZ = ‘V’, then A contains the orthonormal eigenvectors of the matrix A. If JOBZ = ‘N’, then the triangle is destroyed.

in
lda

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

out
W

Array of dimension (n). The eigenvalues in ascending order.

out
work

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

in
lwork

The dimension of work. If N <= 1, LWORK >= 1. If JOBZ = ‘N’ and N > 1, LWORK >= N + 1. If JOBZ = ‘V’ and N > 1, LWORK >= 2*N + N**2. If lwork = -1, workspace query only.

out
rwork

Double precision workspace array, dimension (max(1, lrwork)). On exit, if info = 0, rwork[0] returns the optimal lrwork.

in
lrwork

The dimension of rwork. If N <= 1, LRWORK >= 1. If JOBZ = ‘N’ and N > 1, LRWORK >= N. If JOBZ = ‘V’ and N > 1, LRWORK >= 1 + 5*N + 2*N**2. If lrwork = -1, workspace query only.

out
iwork

Integer workspace array, dimension (max(1, liwork)). On exit, if info = 0, iwork[0] returns the optimal liwork.

in
liwork

The dimension of iwork. If N <= 1, LIWORK >= 1. If JOBZ = ‘N’ and N > 1, LIWORK >= 1. If JOBZ = ‘V’ and N > 1, LIWORK >= 3 + 5*N. If liwork = -1, workspace query only.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value

  • > 0: if info = i and JOBZ = ‘N’, the algorithm failed to converge; i off-diagonal elements did not converge to zero; if info = i and JOBZ = ‘V’, the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns INFO/(N+1) through mod(INFO,N+1).