|
|
◆ dhseqr()
| void dhseqr |
( |
char |
job, |
|
|
char |
compz, |
|
|
int |
n, |
|
|
int |
ilo, |
|
|
int |
ihi, |
|
|
int |
ldh, |
|
|
double |
h[], |
|
|
double |
wr[], |
|
|
double |
wi[], |
|
|
int |
ldz, |
|
|
double |
z[], |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int * |
info |
|
) |
| |
Eigenvalues and Schur factorization of Hessenberg matrix by QR method
- Purpose
- This routine computes the eigenvalues of a Hessenberg matrix H and, optionally, the matrices T and Z from the Schur decomposition H = Z T Z^T, where T is an upper quasi-triangular matrix (the Schur form), and Z is the orthogonal matrix of Schur vectors.
Optionally Z may be postmultiplied into an input orthogonal 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 orthogonal 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 an orthogonal 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 dgebal, and then passed to dgehrd when the matrix output by dgebal is reduced to Hessenberg form. Otherwise they 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 quasi-triangular matrix T from the Schur decomposition (the Schur form). 2 x 2 diagonal blocks (corresponding to complex conjugate pairs of eigenvalues) are returned in standard form, with H(i, i) = H(i+1, i+1) and H(i+1, i)*H(i, i+1) < 0. 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] | wr[] | Array wr[lwr] (lwr >= n) |
| [out] | wi[] | Array wi[lwi] (lwi >= n)
The real and imaginary parts, respectively, of the computed eigenvalues. If two eigenvalues are computed as a complex conjugate pair, they are stored in consecutive elements of wr[] and wi[], say the i-th and (i+1)th, with wi[i] > 0 and wi[i+1] < 0. If job = 'S', the eigenvalues are stored in the same order as on the diagonal of the Schur form returned in h[][], with wr[i] = h[i][i] and, if h[i〜i+1][i〜i+1] is a 2 x 2 diagonal block, wi[i] = sqrt(-h[i][i+1]*h[i+1][i]) and wi[i+1] = -wi[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 orthogonal 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 orthogonal matrix generated by dorghr after the call to dgehrd 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))
= -10: The argument ldz had an illegal value (ldz < 1 or (compz = 'I' or 'V' and ldz < max(1, n)))
= -13: 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 wr[] and wi[] 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 an orthogonal matrix. The final value of h[][] is upper Hessenberg and quasi-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 orthogonal matrix in (*) (regardless of the value of job.)
If compz = 'I', then (final value of z[][]) = U
where U is the orthogonal matrix in (*) (regardless of the value of job.)
If compz = 'N', then z[][] is not accessed. |
- Reference
- LAPACK
|