|
|
◆ zhegvx()
| void zhegvx |
( |
int |
itype, |
|
|
char |
jobz, |
|
|
char |
range, |
|
|
char |
uplo, |
|
|
int |
n, |
|
|
int |
lda, |
|
|
doublecomplex |
a[], |
|
|
int |
ldb, |
|
|
doublecomplex |
b[], |
|
|
double |
vl, |
|
|
double |
vu, |
|
|
int |
il, |
|
|
int |
iu, |
|
|
double |
abstol, |
|
|
int * |
m, |
|
|
double |
w[], |
|
|
int |
ldz, |
|
|
doublecomplex |
z[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
double |
rwork[], |
|
|
int |
iwork[], |
|
|
int |
ifail[], |
|
|
int * |
info |
|
) |
| |
(Expert driver) Generalized eigenvalue problem of Hermitian matrices
- Purpose
- This routine computes selected 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.
Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
- 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] | range | = 'A': All eigenvalues will be found.
= 'V': All eigenvalues in the half-open interval (vl, vu] will be found.
= 'I': The il-th through iu-th eigenvalues will be found. |
| [in] | uplo | = 'U': Upper triangles of A and B are stored.
= 'L': Lower triangles of A and B are stored. |
| [in] | n | Order of the matrices A and B. (n >= 0) (If n = 0, returns without computation) |
| [in] | lda | Leading dimension of the two dimensional array a[][]. (lda >= max(1, n)) |
| [in,out] | a[][] | Array a[la][lda] (la >= n)
[in] The Hermitian matrix A. If uplo = 'U', the leading n x n upper triangular part of a[][] contains the upper triangular part of the matrix A. If uplo = 'L', the leading n x n lower triangular part of a[][] contains the lower triangular part of the matrix A.
[out] The upper triangle (if uplo='U') or the lower triangle (if uplo='L') of a[][], including the diagonal, is destroyed. |
| [in] | ldb | Leading dimension of the two dimensional array b[][]. (ldb >= max(1, n)) |
| [in,out] | b[][] | Array b[lb][ldb] (lb >= n)
[in] The Hermitian positive definite matrix B. If uplo = 'U', the leading n x n upper triangular part of b[][] contains the upper triangular part of the matrix B. If uplo = 'L', the leading n x n lower triangular part of b[][] contains the lower triangular part of the matrix B.
[out] 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] | vl | range = 'V': The lower bound of the interval to be searched for eigenvalues. (vl < vu)
range = 'A' or 'I': Not referenced. |
| [in] | vu | range = 'V': The upper bound of the interval to be searched for eigenvalues. (vl < vu)
range = 'A' or 'I': Not referenced. |
| [in] | il | range = 'I': The index of the smallest eigenvalue to be returned. (1 <= il <= iu <= n, if n > 0; il = 1 and iu = 0 if n = 0)
range = 'A' or 'V': Not referenced. |
| [in] | iu | range = 'I': The index of the largest eigenvalues to be returned. (1 <= il <= iu <= n, if n > 0; il = 1 and iu = 0 if n = 0)
range = 'A' or 'V': Not referenced. |
| [in] | abstol | The absolute error tolerance for the eigenvalues.
An approximate eigenvalue is accepted as converged when it is determined to lie in an interval [a, b] of width less than or equal to abstol + eps * max(|a|, |b|), where eps is the machine precision. If abstol is less than or equal to zero, then eps*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing C to tridiagonal form, where C is the symmetric matrix of the standard symmetric problem to which the generalized problem is transformed.
Eigenvalues will be computed most accurately when abstol is set to twice the underflow threshold 2*dlamch('S'), not zero. If this routine returns with info > 0, indicating that some eigenvectors did not converge, try setting abstol to 2*dlamch('S'). |
| [out] | m | The total number of eigenvalues found. (0 <= m <= n)
If range = 'A', m = n, and if range = 'I', m = iu - il + 1. |
| [out] | w[] | Array w[lw] (lw >= n)
The first m elements contain the selected eigenvalues in ascending order. |
| [in] | ldz | Leading dimension of the two dimensional array z[][]. (ldz >= 1 if jobz = 'N', ldz >= max(1, n) if jobz = 'V') |
| [out] | z[][] | Array z[lz][ldz] (lz >= max(1, m))
jobz = 'V': If info = 0, the first m columns of z[][] contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with the i-th column of z[][] holding the eigenvector associated with w[i].
The eigenvectors are normalized as follows:
itype = 1 or 2: Z^H*B*Z = I
itype = 3: Z^H*inv(B)*Z = I
If an eigenvector fails to converge, then that column of z[][] contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in ifail[].
jobz = 'N': z[][] is not referenced.
Note: The user must ensure that at least max(1, m) columns are supplied in the array z[][]; if range = 'V', the exact value of m is not known in advance and an upper bound must be used. |
| [out] | work[] | Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork. |
| [in] | lwork | The length of the array work[]. (lwork >= max(1, 2*n))
For optimal efficiency, lwork >= (nb + 1)*n, where nb is the optimal blocksize.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0]. |
| [out] | rwork[] | Array rwork[lrwork] (lrwork >= 7*n)
Work array. |
| [out] | iwork[] | Array iwork[liwork] (liwork >= 5*n)
Work array. |
| [out] | ifail[] | Array ifail[lifail] (lifail >= n)
jobz = 'V': If info = 0, the first m elements of ifail[] are zero. If info > 0, then ifail[] contains the indices of the eigenvectors that failed to converge.
jobz = 'N': ifail[] is not referenced. |
| [out] | info | = 0: Successful exit
= -1: The argument itype had an illegal value (itype < 1 or itype > 3)
= -2: The argument jobz had an illegal value (jobz != 'V' nor 'N')
= -3: The argument range had an illegal value (range != 'A', 'V' nor 'I')
= -4: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -5: The argument n had an illegal value (n < 0)
= -6: The argument lda had an illegal value (lda < max(1, n))
= -8: The argument ldb had an illegal value (ldb < max(1, n))
= -11: The argument vu had an illegal value (vu <= vl)
= -12: The argument il had an illegal value (il < 1 or il > n)
= -13: The argument iu had an illegal value (iu < min(n, il) or iu > n)
= -17: The argument ldz had an illegal value (ldz too small)
= -20: The argument lwork had an illegal value (lwork too small)
= i (0 < i <= n): zheevx failed to converge; i eigenvectors failed to converge. Their indices are stored in array ifail[].
= i (i > n): The leading minor of order i-n of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed |
- Reference
- LAPACK
|