|
|
◆ zhpgv()
| void zhpgv |
( |
int |
itype, |
|
|
char |
jobz, |
|
|
char |
uplo, |
|
|
int |
n, |
|
|
doublecomplex |
ap[], |
|
|
doublecomplex |
bp[], |
|
|
double |
w[], |
|
|
int |
ldz, |
|
|
doublecomplex |
z[], |
|
|
doublecomplex |
work[], |
|
|
double |
rwork[], |
|
|
int * |
info |
|
) |
| |
(Simple driver) Generalized eigenvalue problem of Hermitian matrices in packed form
- Purpose
- This routine 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 | Order of the matrices A and B. (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] = Aij for 0 <= i <= j <= n - 1.
uplo = 'L': ap[(i + j*(2*n - j - 1)/2] = Aij for 0 <= j < = i <= n - 1.
[out] The contents of ap[] are destroyed. |
| [in,out] | bp[] | Array bp[lbp] (lbp >= n(n + 1)/2)
[in] The upper or lower triangle of the Hermitian positive definite matrix B, packed columnwise in a linear array. The j-th column of B is stored in the array bp as follows.
uplo = 'U': bp[i + j*(j + 1)/2] = Bij for 0 <= i <= j <= n - 1.
uplo = 'L': bp[(i + j*(2*n - j - 1)/2] = Bij for 0 <= j < = i <= n - 1.
[out] The triangular factor U or L from the Cholesky factorization B = U^H*U or B = L*L^H, in the same storage format as B. |
| [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 if jobz = 'N', ldz >= max(1, n) if jobz = 'V') |
| [out] | z[][] | Array z[lz][ldz] (lz >= n)
jobz = 'V': If info = 0, z[][] contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows:
itype = 1 or 2: Z^H*B*Z = I
itype = 3: Z^H*inv(B)*Z = I
jobz = 'N': z[][] is not referenced. |
| [out] | work[] | Array work[lwork] (lwork >= max(1, 2*n-1))
Complex work array. |
| [out] | rwork[] | Array rwork[lrwork] (lrwork >= max(1, 3*n-2))
Work array. |
| [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 uplo had an illegal value (uplo != 'U' nor 'L')
= -4: The argument n had an illegal value (n < 0)
= -8: The argument ldz had an illegal value (ldz too small)
= i (0 < i <= n): zhpev failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
= 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
|