|
|
◆ dtrevc3()
| void dtrevc3 |
( |
char |
side, |
|
|
char |
howmny, |
|
|
int |
select[], |
|
|
int |
n, |
|
|
int |
ldt, |
|
|
double |
t[], |
|
|
int |
ldvl, |
|
|
double |
vl[], |
|
|
int |
ldvr, |
|
|
double |
vr[], |
|
|
int |
mm, |
|
|
int * |
m, |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int * |
info |
|
) |
| |
Eigenvectors of quasi-triangular matrix of Schur factorization
- Purpose
- This routine computes some or all of the right and/or left eigenvectors of a real upper quasi-triangular matrix T. Matrices of this type are produced by the Schur factorization of a real general matrix: A = Q*T*Q^T, as computed by dhseqr.
The right eigenvector x and the left eigenvector y of T corresponding to an eigenvalue w are defined by: T*x = w*x, (y^T)*T = w*(y^T)
where y^T denotes the transpose of the vector y. The eigenvalues are not input to this routine, but are read directly from the diagonal blocks of T.
This routine returns the matrices X and/or Y of right and left eigenvectors of T, or the products Q*X and/or Q*Y, where Q is an input matrix. If Q is the orthogonal factor that reduces a matrix A to Schur form T, then Q*X and Q*Y are the matrices of right and left eigenvectors of A.
This uses a Level 3 BLAS version of the back transformation.
- Parameters
-
| [in] | side | = 'R': Compute right eigenvectors only.
= 'L': Compute left eigenvectors only.
= 'B': Compute both right and left eigenvectors. |
| [in] | howmny | = 'A': Compute all right and/or left eigenvectors.
= 'B': Compute all right and/or left eigenvectors, backtransformed by the matrices in vl[][] and/or vr[][].
= 'S': Compute selected right and/or left eigenvectors, as indicated by the logical array select[]. |
| [in,out] | select[] | Array select[lselect] (lselect >= n)
If howmny = 'S', select[] specifies the eigenvectors to be computed.
If w[j] is a real eigenvalue, the corresponding real eigenvector is computed if select[j] is true.
If w[j] and w[j+1] are the real and imaginary parts of a complex eigenvalue, the corresponding complex eigenvector is computed if either select[j] or select[j+1] is true, and on exit select[j] is set to true and select[j+1] is set to false.
Not referenced if howmny = 'A' or 'B'. |
| [in] | n | Order of the matrix A. (n >= 0) (If n = 0, returns without computation) |
| [in] | ldt | Leading dimension of the two dimensional array t[][]. (ldt >= max(1, n)) |
| [in] | t[][] | Array t[lt][ldt] (lt >= n)
The upper quasi-triangular matrix T in Schur canonical form. |
| [in] | ldvl | Leading dimension of the two dimensional array vl[][]. (ldvl >= 1 if side = 'R', ldvl >= n if side = 'L' or 'B') |
| [in,out] | vl[][] | Array vl[lvl][ldvl] (lvl >= mm)
[in] If side = 'L' or 'B' and howmny = 'B', vl[][] must contain an n x n matrix Q (usually the orthogonal matrix Q of Schur vectors returned by dhseqr).
[out] If side = 'L' or 'B', vl[][] contains:
if howmny = 'A', the matrix Y of left eigenvectors of T;
if howmny = 'B', the matrix Q*Y;
if howmny = 'S', the left eigenvectors of T specified by select[], stored consecutively in the rows of vl[][], in the same order as their eigenvalues.
A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive rows, the first holding the real part, and the second the imaginary part.
Not referenced if side = 'R'. |
| [in] | ldvr | Leading dimension of the two dimensional array vr[][]. (ldvr >= 1 if side = 'L', ldvr >= n if side = 'R' or 'B') |
| [in,out] | vr[][] | Array vr[lvr][ldvr] (lvr >= mm)
[in] If side = 'R' or 'B' and howmny = 'B', vr[][] must contain an n x n matrix Q (usually the orthogonal matrix Q of Schur vectors returned by dhseqr).
[out] If side = 'R' or 'B', vr[][] contains:
if howmny = 'A', the matrix X of right eigenvectors of T;
if howmny = 'B', the matrix Q*X;
if howmny = 'S', the right eigenvectors of T specified by select[], stored consecutively in the rows of vr, in the same order as their eigenvalues.
A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive rows, the first holding the real part and the second the imaginary part.
Not referenced if side = 'L'. |
| [in] | mm | The number of rows in the arrays vl[][] and/or vr[][]. (mm >= m) |
| [out] | m | The number of rows in the arrays vl[][] and/or vr[][] actually used to store the eigenvectors.
If howmny = 'A' or 'B', m is set to n.
Each selected real eigenvector occupies one row and each selected complex eigenvector occupies two rows. |
| [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))
For optimum performance, lwork >= n + 2*n*nb, where nb is the optimal blocksize.
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 side had an illegal value (side != 'R', 'L' nor 'B')
= -2: The argument howmny had an illegal value (hownmy != 'A', 'B' nor 'S')
= -4: The argument n had an illegal value (n < 0)
= -5: The argument ldt had an illegal value (ldt < max(1, n))
= -7: The argument ldvl had an illegal value (ldvl too small)
= -9: The argument ldvr had an illegal value (ldvr too small)
= -11: The argument mm had an illegal value (mm < m)
= -14: The argument lwork had an illegal value (lwork too small) |
- Further Details
- The algorithm used in this program is basically backward (forward) substitution, with scaling to make the the code robust against possible overflow.
Each eigenvector is normalized so that the element of largest magnitude has magnitude 1; here the magnitude of a complex number (x,y) is taken to be |x| + |y|.
- Reference
- LAPACK
|