|
|
◆ dspgvd()
| void dspgvd |
( |
int |
itype, |
|
|
char |
jobz, |
|
|
char |
uplo, |
|
|
int |
n, |
|
|
double |
ap[], |
|
|
double |
bp[], |
|
|
double |
w[], |
|
|
int |
ldz, |
|
|
double |
z[], |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int |
iwork[], |
|
|
int |
liwork, |
|
|
int * |
info |
|
) |
| |
(Divide and conquer driver) Generalized eigenvalue problem of symmetric matrices in packed form
- Purpose
- This routine computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-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 symmetric, stored in packed form, and B is also positive definite.
If eigenvectors are desired, it uses a divide and conquer algorithm.
- 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 symmetric 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 symmetric 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^T*U or B = L*L^T, 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^T*B*Z = I
itype = 3: Z^T*inv(B)*Z = I
jobz = 'N': z[][] is not referenced. |
| [out] | work[] | Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork. |
| [in] | lwork | The size of work[]. (lwork >= 1 (if n <= 1), 2*n (if jobz = 'N'), 2*n^2 + 6*n + 1 (if jobz = 'V'))
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] and iwork[] arrays, and returns these values in work[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 size of the work[] and iwork[] arrays, and returns these values in work[0] and iwork[0]. |
| [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)
= -11: The argument lwork had an illegal value (lwork too small)
= -13: The argument liwork had an illegal value (liwork too small)
= i (0 < i <= n): dspevd failed to converge. i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
= i (n < i <= 2n): 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
|