|
|
◆ zstedc()
| void zstedc |
( |
char |
compz, |
|
|
int |
n, |
|
|
double |
d[], |
|
|
double |
e[], |
|
|
int |
ldz, |
|
|
doublecomplex |
z[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
double |
rwork[], |
|
|
int |
lrwork, |
|
|
int |
iwork[], |
|
|
int |
liwork, |
|
|
int * |
info |
|
) |
| |
Eigenvalues and eigenvectors of symmetric tridiagonal matrix to which a Hermitian matrix was reduced (Divide and conquer method)
- Purpose
- This routine computes all eigenvalues and, optionally, eigenvectors of a symmetric tridiagonal matrix to which a Hermitian matrix was reduced using the divide and conquer method. The eigenvectors of a full or band complex Hermitian matrix can also be found if zhetrd or zhptrd or zhbtrd has been used to reduce this matrix to tridiagonal form.
- Parameters
-
| [in] | compz | = 'N': Compute eigenvalues only.
= 'I': Compute eigenvalues and eigenvectors of the tridiagonal matrix.
= 'V': Compute eigenvalues and eigenvectors of the original Hermitian matrix. On entry, z[][] must contain the unitary matrix used to reduce the original matrix to tridiagonal form. |
| [in] | n | Order of the matrix. (n >= 0) (If n = 0, returns without computation) |
| [in,out] | d[] | Array d[ld] (ld >= n)
[in] The diagonal elements of the tridiagonal matrix.
[out] If info = 0, the eigenvalues in ascending order. |
| [in,out] | e[] | Array e[le] (le >= n - 1)
[in] The (n - 1) subdiagonal elements of the tridiagonal matrix.
[out] e[] has been destroyed. |
| [in] | ldz | Leading dimension of the two dimensional array z[][]. (ldz >= 1 if compz = 'N', ldz >= max(1, n) if compz = 'V' or 'I') |
| [in,out] | z[][] | Array z[lz][ldz] (lz >= n)
[in] If compz = 'V', then z[][] contains the unitary matrix used in the reduction to tridiagonal form.
[out] If info = 0, then if compz = 'V', z[][] contains the orthonormal eigenvectors of the original Hermitian matrix, and if compz = 'I', z[][] contains the orthonormal eigenvectors of the symmetric tridiagonal matrix. If compz = 'N', then 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[]. (lwork >= 1 if compz = 'N' or 'I' or n <= 1, lwork >= n^2 if compz = 'V' and n > 1)
Note that for compz = 'V', then if n is less than or equal to the minimum divide size, usually 25, then lwork need only be 1.
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 lrwork. |
| [in] | lrwork | The size of rwork[]. (lrwork >= 1 if compz = 'N' or n <= 1, lrwork >= 1 + 3*n + 2*n*lg(n) + 4*n^2 if compz = 'V' and n > 1 (where lg(n) = smallest integer k such that 2^k >= n), lrwork >= 1 + 4*n + 2*n^2 if compz = 'I' and n > 1)
Note that for compz = 'I' or 'V', then if n is less than or equal to the minimum divide size, usually 25, then liwork need only be max(1, 2*(n-1)).
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 compz = 'N' or n <= 1, liwork >= 6 + 6*n + 5*n*lg(n) if compz = 'V' and n > 1 (where lg(n) = smallest integer k such that 2^k >= n), liwork >= 3 + 5*n if compz = 'I' and n > 1)
Note that for compz = 'I' or 'V', then if n is less than or equal to the minimum divide size, usually 25, then liwork need only be 1.
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 compz an illegal value. (compz != 'N', 'I' nor 'V')
= -2: The argument n had an illegal value. (n < 0)
= -5: The argument ldz had an illegal value. (ldz < 1 or (compz = 'V' or 'I' and ldz < max(1, n)))
= -8: The argument lwork had an illegal value. (lwork too small)
= -10: The argument lrwork had an illegal value. (lrwork too small)
= -12: The argument liwork had an illegal value. (liwork too small)
= i > 0: The algorithm has failed to compute an eigenvalue while working on the submatrix lying in rows and columns i/(n + 1) through mod(i, n + 1). |
- Reference
- LAPACK
|