|
|
◆ dgeesx_r()
| void dgeesx_r |
( |
char |
jobvs, |
|
|
char |
sort, |
|
|
char |
sense, |
|
|
int |
n, |
|
|
int |
lda, |
|
|
double |
a[], |
|
|
int * |
sdim, |
|
|
double |
wr[], |
|
|
double |
wi[], |
|
|
int |
ldvs, |
|
|
double |
vs[], |
|
|
double * |
rconde, |
|
|
double * |
rcondv, |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int |
iwork[], |
|
|
int |
liwork, |
|
|
int |
bwork[], |
|
|
int * |
info, |
|
|
int * |
irev |
|
) |
| |
(Expert driver) Schur factorization of a general matrix (Reverse communication version)
- Purpose
- This routine computes for an n x n real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*Z^T.
Optionally, it also orders the eigenvalues on the diagonal of the real Schur form so that selected eigenvalues are at the top left; computes a reciprocal condition number for the average of the selected eigenvalues (rconde); and computes a reciprocal condition number for the right invariant subspace corresponding to the selected eigenvalues (rcondv). The leading columns of Z form an orthonormal basis for this invariant subspace.
For further explanation of the reciprocal condition numbers rconde and rcondv, see Section 4.8.1 of the LAPACK Users' Guide Third Edition (where these quantities are called s and sep respectively).
A real matrix is in real Schur form if it is upper quasi-triangular with 1 x 1 and 2 x 2 blocks. 2 x 2 blocks will be standardized in the form where b*c < 0. The eigenvalues of such a block are a+-sqrt(bc).
The matrix A is reduced to upper Hessenberg form first. Then the eigenvalues and the Schur factorization are computed by QR method.
This routine is the reverse communication version of dgeesx.
- Parameters
-
| [in] | jobvs | = 'N': Schur vectors are not computed.
= 'V': Schur vectors are computed. |
| [in] | sort | Specifies whether or not to order the eigenvalues on the diagonal of the Schur form.
= 'N': Eigenvalues are not ordered.
= 'S': Eigenvalues are ordered (see select). |
| [in] | sense | Determines which reciprocal condition numbers are computed.
= 'N': None are computed.
= 'E': Computed for average of selected eigenvalues only.
= 'V': Computed for selected right invariant subspace only.
= 'B': Computed for both.
If sense = 'E', 'V' or 'B', sort must equal 'S'. |
| [in] | n | Order of the matrix A. (n >= 0) (If n = 0, returns without computation) |
| [in] | lda | Leading dimension of the two dimensional array a[][]. (lda >= max(1, n)) |
| [in,out] | a[][] | Array a[la][lda] (la >= n)
[in] n x n matrix A.
[out] a[][] is overwritten by its real Schur form T. |
| [in] | sdim | sort = 'N': sdim = 0.
sort = 'S': sdim = number of eigenvalues (after sorting) for which bwork[i] is true. (Complex conjugate pairs for which bwork[i] is true for either eigenvalue count as 2.) |
| [out] | wr[] | Array wr[lwr] (lwr >= n) |
| [out] | wi[] | Array wi[lwi] (lwi >= n)
wr[] and wi[] contain the real and imaginary parts, respectively, of the computed eigenvalues in the same order that they appear on the diagonal of the output Schur form T. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first. |
| [in] | ldvs | Leading dimension of the two dimensional array vs[][]. (ldvs >= 1 if jobvs = 'N', ldvs >= n if jobvs = 'V') |
| [out] | vs[][] | Array vs[lvs][ldvs] (lvs >= n)
jobvs = 'V': vs[][] contains the orthogonal matrix Z of Schur vectors.
jobvs = 'N': vs[][] is not referenced. |
| [out] | rconde | sense = 'E' or 'B': rconde contains the reciprocal condition number for the average of the selected eigenvalues.
sense = 'N' or 'V': Not referenced. |
| [out] | rcondv | sense = 'V' or 'B': rcondv contains the reciprocal condition number for the selected right invariant subspace.
sense = 'N' or 'E': 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, 3*n) if sense = 'N', lwork >= max(1, n+2*sdim*(n-sdim)) if sense = 'E', 'V' or 'B' where sdim is the number of selected eigenvalues computed by this routine. Note that n+2*sdim*(n-sdim) <= n+n*n/2). Note also that an error is only returned if lwork < max(1, 3*n), but if sense = 'E' or 'V' or 'B', this may not be large enough.)
For good performance, lwork must generally be larger.
If lwork = -1, then a workspace query is assumed. The routine only calculates upper bounds on the optimal size of the arrays work[] and iwork[], 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 dimension of the array iwork[]. (liwork >= 1 if sense = 'N' or 'E', liwork >= sdim*(n-sdim) if sense = 'V' or 'B'. Note that sdim*(n-sdim) <= n*n/4). Note also that an error is only returned if liwork < 1, but if sense = 'V' or 'B' this may not be large enough.)
If lwork = -1, then a workspace query is assumed. The routine only calculates upper bounds on the optimal size of the arrays work[] and iwork[], and returns these values in work[0] and iwork[0]. |
| [out] | bwork[] | Array bwork[lbwork] (lbwork >= n)
Logical type (integer) work array.
Not referenced if sort = 'N'. |
| [out] | info | = 0: Successful exit
= -1: The argument jobvs had an illegal value (jobvs != 'V' nor 'N')
= -2: The argument sort had an illegal value (sort != 'S' nor 'N')
= -4: The argument sense had an illegal value (sense != 'E', 'V', 'B' nor 'N')
= -5: The argument n had an illegal value (n < 0)
= -6: The argument lda had an illegal value (lda < max(1, n))
= -11: The argument ldvs had an illegal value (ldvs too small)
= -16: The argument lwork had an illegal value (lwork too small)
= -18: The argument liwork had an illegal value (liwork too small)
= i (0 < i <= n): The QR algorithm failed to compute all the eigenvalues. Elements 0 to ilo-2 and i to n-1 of wr[] and wi[] contain those eigenvalues which have converged. If jobvs = 'V', vs[][] contains the matrix which reduces A to its partially converged Schur form.
= n+1: The eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned)
= n+2: After reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfy bwork[i] = true. This could also be caused by underflow due to scaling |
| [in,out] | irev | Control variable for reverse communication.
[in] Before first call, irev should be initialized to zero. On succeeding calls, irev should not be altered.
[out] If irev is not zero, complete the following process and call this routine again.
= 0: Normal exit. See return code in info.
= 1, 2: In the case of sort = 'S', to select eigenvalues to sort to the top left of the Schur form, the user should set bwork[i] (i = 0 to n-1). Decision should be made based on the values in wr[i] and wi[i] (real and imaginary part of the eigenvalue). Set bwork[i] = true (1) to select or bwork[i] = false (0) not to select. Do not alter any variables other than bwork[].
Always irev = 0 if sort = 'N'. |
- Reference
- LAPACK
|