|
|
◆ zhseqr()
| void zhseqr |
( |
char |
job, |
|
|
char |
compz, |
|
|
int |
n, |
|
|
int |
ilo, |
|
|
int |
ihi, |
|
|
int |
ldh, |
|
|
doublecomplex |
h[], |
|
|
doublecomplex |
w[], |
|
|
int |
ldz, |
|
|
doublecomplex |
z[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
int * |
info |
|
) |
| |
Eigenvalues and Schur factorization of complex Hessenberg matrix by QR method
- Purpose
- This routine computes the eigenvalues of a complex Hessenberg matrix H and, optionally, the matrices T and Z from the Schur decomposition H = Z T Z^T, where T is an upper triangular matrix (the Schur form), and Z is the unitary matrix of Schur vectors.
Optionally Z may be postmultiplied into an input unitary matrix Q so that this routine can give the Schur factorization of a matrix A which has been reduced to the Hessenberg form H by the unitary matrix Q: A = Q*H*Q^T = (QZ)*T*(QZ)^T.
- Parameters
-
| [in] | job | = 'E': Compute eigenvalues only.
= 'S': Compute eigenvalues and the Schur form T. |
| [in] | compz | = 'N': No Schur vectors are computed.
= 'I': Z is initialized to the unit matrix and the matrix Z of Schur vectors of H is returned.
= 'V': Z must contain a unitary matrix Q on entry, and the product Q*Z is returned. |
| [in] | n | Order of the matrix H. (n >= 0) (If n = 0, returns without computation) |
| [in] | ilo | |
| [in] | ihi | It is assumed that H is already upper triangular in rows and columns 1〜ilo-1 and ihi+1〜n. ilo and ihi are normally set by a previous call to zgebal, and then passed to zgehrd when the matrix output by zgebal is reduced to Hessenberg form. Otherwise ilo and ihi should be set to 1 and n respectively. (1 <= ilo <= ihi <= n, if n > 0. ilo = 1 and ihi = 0, if n = 0) |
| [in] | ldh | Leading dimension of the two dimensional array h[][]. (ldh >= max(1, n)) |
| [in,out] | h[][] | Array h[lh][ldh] (lh >= n)
[in] The upper Hessenberg matrix H.
[out] If info = 0 and job = 'S', then H contains the upper triangular matrix T from the Schur decomposition (the Schur form). If info = 0 and job = 'E', the contents of H are unspecified on exit. (The output value of H when info > 0 is given under the description of info below.) |
| [out] | w[] | Array w[lw] (lw >= n) The computed eigenvalues. If job = 'S', the eigenvalues are stored in the same order as on the diagonal of the Schur form returned in h[][], with w[i] = h[i][i]. |
| [in] | ldz | Leading dimension of the two dimensional array z[][]. (ldz >= max(1, n) if compz = 'I' or 'V', ldz >= 1 if compz = 'N') |
| [in,out] | z[][] | Array z[lz][ldz] (lz >= n)
compz = 'I':
[in] z[][] need not be set.
[out] if info = 0, z[][] contains the unitary matrix Z of the Schur vectors of H.
compz = 'V':
[in] z[][] must contain an n x n matrix Q, which is assumed to be equal to the unit matrix except for the submatrix Z(ilo〜ihi, ilo〜ihi).
[out] If info = 0, z[][] contains Q*Z. Normally Q is the unitary matrix generated by zunghr after the call to zgehrd which formed the Hessenberg matrix H. (The output value of z[][] when info > 0 is given under the description of info below.)
compz = '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 dimension of the array work[].
lwork >= max(1, n) is sufficient and delivers very good and sometimes optimal performance. However, lwork as large as 11*n may be required for optimal performance. A workspace query is recommended to determine the optimal workspace size.
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] | info | = 0: Successful exit
= -1: The argument job had an illegal value. (job != 'E' nor 'S')
= -2: The argument compz had an illegal value. (compz != 'N', 'I' nor 'V')
= -3: The argument n had an illegal value (n < 0)
= -4: The argument ilo had an illegal value (ilo < 1 or ilo > n)
= -5: The argument ihi had an illegal value (ihi < min(ilo, n) or ihi > n)
= -6: The argument ldh had an illegal value (ldh < max(1, n))
= -9: The argument ldz had an illegal value (ldz < 1 or (compz = 'I' or 'V' and ldz < max(1, n)))
= -12: The argument lwork had an illegal value (lwork too small)
= i > 0: Failed to compute all of the eigenvalues. Elements 1〜ilo-1 and i+1〜n of w[] contain those eigenvalues which have been successfully computed. (Failures are rare.)
If job = 'E', the remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix rows and columns ilo through i of the final output value of h[][].
If job = 'S', then (initial value of h[][])*U = U*(final value of h[][]) --- (*)
where U is a unitary matrix. The final value of h[][] is upper Hessenberg and triangular in rows and columns i+1 through ihi.
If compz = 'V', then (final value of z[][]) = (initial value of z[][])*U
where U is the unitary matrix in (*) (regardless of the value of job.)
If compz = 'I', then (final value of z[][]) = U
where U is the unitary matrix in (*) (regardless of the value of job.)
If compz = 'N', then z[][] is not accessed. |
- Reference
- LAPACK
|