|
|
◆ zhpevd()
| void zhpevd |
( |
char |
jobz, |
|
|
char |
uplo, |
|
|
int |
n, |
|
|
doublecomplex |
ap[], |
|
|
double |
w[], |
|
|
int |
ldz, |
|
|
doublecomplex |
z[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
double |
rwork[], |
|
|
int |
lrwork, |
|
|
int |
iwork[], |
|
|
int |
liwork, |
|
|
int * |
info |
|
) |
| |
(Divide and conquer driver) Eigenvalues and eigenvectors of a Hermitian matrix in packed form
- Purpose
- This routine computes all the eigenvalues and, optionally, eigenvectors of a Hermitian matrix A in packed form. If only eigenvalues are desired, it uses a QL or QR method. If eigenvectors are also 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 | Order of the matrix A. (n >= 0) (If n = 0, returns without computation) |
| [in,out] | ap[] | Array ap[lap] (lap >= n(n + 1)/2)
[in] The upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array ap as follows.
uplo = 'U': ap[i + j*(j + 1)/2] = A(i, j) for 0 <= i <= j <= n - 1.
uplo = 'L': ap[(i + j*(2*n - j - 1)/2] = A(i, j) for 0 <= j < = i <= n - 1.
[out] ap[] is overwritten by values generated during the reduction to tridiagonal form. If uplo = 'U', the diagonal and first superdiagonal of the tridiagonal matrix T overwrite the corresponding elements of A. If uplo = 'L', the diagonal and first subdiagonal of T overwrite the corresponding elements of A. |
| [out] | w[] | Array w[lw] (lw >= n)
If info = 0, the eigenvalues in ascending order. |
| [in] | ldz | Leading dimension of the two dimensional array z[][]. (ldz >= 1 (jobz = 'N'), ldz >= max(1, n) (jobz = 'V')) |
| [out] | z[][] | Array z[lz][ldz] (lz >= n)
jobz = 'V': If info = 0, z[][] contains the orthonormal eigenvectors of the matrix A, with the i-th row of z[][] holding the eigenvector associated with w[i].
jobz = 'N': z[][] is not referenced. |
| [out] | work[] | Array work[lwork]
Complex work array.
On exit, if info = 0, work[0] returns the optimal lwork. |
| [in] | lwork | The size of work[]. (lrwork >= 1 (if n <= 1), n (if jobz = 'N'), 2*n (if jobz = 'V'))
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal sizes of the work[], rwork[] and iwork[] arrays, and returns these values in work[0], rwork[0] and iwork[0]. |
| [out] | rwork[] | Array rwork[lrwork]
Work array. On exit, if info = 0, rwork[0] returns the optimal lwork. |
| [in] | lrwork | The size of rwork[]. (lrwork >= 1 (if n <= 1), n (if jobz = 'N'), 2*n^2 + 5*n + 1 (if jobz = 'V'))
If lrwork = -1, then a workspace query is assumed. The routine only calculates the optimal sizes of the work[], rwork[] and iwork[] arrays, and returns these values in work[0], rwork[0] and iwork[0]. |
| [out] | iwork[] | Array iwork[liwork]
Integer work array.
On exit, if info = 0, iwork[0] returns the optimal liwork. |
| [in] | liwork | The size of iwork[]. (liwork >= 1 (if n <= 1), 1 (if jobz = 'N'), 5*n + 3 (if jobz = 'V'))
If liwork = -1, then a workspace query is assumed. The routine only calculates the optimal sizes of the work[], rwork[] and iwork[] arrays, and returns these values in work[0], rwork[0] and iwork[0]. |
| [out] | info | = 0: Successful exit
= -1: The argument jobz had an illegal value (jobz != 'V' nor 'N')
= -2: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -3: The argument n had an illegal value (n < 0)
= -6: The argument ldz had an illegal value (ldz too small)
= -9: The argument lwork had an illegal value (lwork too small)
= -11: The argument lrwork had an illegal value (lrwork too small)
= -13: The argument liwork had an illegal value (liwork too small)
= i > 0: The algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero |
- Reference
- LAPACK
|