|
|
◆ zgeevx()
| void zgeevx |
( |
char |
balanc, |
|
|
char |
jobvl, |
|
|
char |
jobvr, |
|
|
char |
sense, |
|
|
int |
n, |
|
|
int |
lda, |
|
|
doublecomplex |
a[], |
|
|
doublecomplex |
w[], |
|
|
int |
ldvl, |
|
|
doublecomplex |
vl[], |
|
|
int |
ldvr, |
|
|
doublecomplex |
vr[], |
|
|
int * |
ilo, |
|
|
int * |
ihi, |
|
|
double |
scale[], |
|
|
double * |
abnrm, |
|
|
double |
rconde[], |
|
|
double |
rcondv[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
double |
rwork[], |
|
|
int * |
info |
|
) |
| |
(Expert driver) Eigenvalues and left and/or right eigenvectors of a complex matrix
- Purpose
- This routine computes for an n x n complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors. The matrix A is reduced to upper Hessenberg form first. Then the eigenvalues and, optionally, the Schur factorization are computed by QR method. The engenvectors are computed from the Schur decomposition.
Optionally also, it computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (ilo, ihi, scale, and abnrm), reciprocal condition numbers for the eigenvalues (rconde), and reciprocal condition numbers for the right eigenvectors (rcondv).
The right eigenvector v(j) of A satisfies A * v(j) = lambda(j) * v(j)
where lambda(j) is its eigenvalue.
The left eigenvector u(j) of A satisfies u(j)^H * A = lambda(j) * u(j)^H
where u(j)^H denotes the conjugate transpose of u(j).
The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real.
Balancing a matrix means permuting the rows and columns to make it more nearly upper triangular, and applying a diagonal similarity transformation D*A*D^(-1), where D is a diagonal matrix, to make its rows and columns closer in norm and the condition numbers of its eigenvalues and eigenvectors smaller. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see Section 4.8.1 of the LAPACK Users' Guide Third Edition.
- Parameters
-
| [in] | balanc | Indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues.
= 'N': Do not diagonally scale or permute.
= 'P': Perform permutations to make the matrix more nearly upper triangular. Do not diagonally scale.
= 'S': diagonally scale the matrix, i.e. replace A by D*A*D^(-1), where D is a diagonal matrix chosen to make the rows and columns of A more equal in norm. Do not permute.
= 'B': Both diagonally scale and permute A. |
| [in] | jobvl | = 'N': left eigenvectors of A are not computed.
= 'V': left eigenvectors of A are computed.
If sense='E' or 'B', jobvl must = 'V'. |
| [in] | jobvr | = 'N': right eigenvectors of A are not computed.
= 'V': right eigenvectors of A are computed.
If sense='E' or 'B', jobvr must = 'V'. |
| [in] | sense | Determines which reciprocal condition numbers are computed.
= 'N': None are computed.
= 'E': Computed for eigenvalues only.
= 'V': Computed for right eigenvectors only.
= 'B': Computed for eigenvalues and right eigenvectors.
If sense='E' or 'B', both left and right eigenvectors must also be computed (jobvl = 'V' and jobvr = 'V'). |
| [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[][] has been overwritten. If jobvl = 'V' or jobvr = 'V', a[][] contains the Schur form of the balanced version of the input matrix A. |
| [out] | w[] | Array w[lw] (lw >= n)
w[] contains the computed eigenvalues. |
| [in] | ldvl | Leading dimension of the two dimensional array vl[][]. (ldvl >= 1 if jobvl = 'N', ldvl >= n if jobvl = 'V') |
| [out] | vl[][] | Array vl[lvl][ldvl] (lvl >= n)
jobvl = 'V': The left eigenvectors u(j) are stored one after another in the rows of vl[][], in the same order as their eigenvalues (u(j) = (j-th row of vl[][]).
jobvl = 'N': vl[][] is not referenced. |
| [in] | ldvr | Leading dimension of the two dimensional array vr[][]. (ldvr >= 1 if jobvr = 'N', ldvr >= n if jobvr = 'V') |
| [out] | vr[][] | Array vr[lvr][ldvr] (lvr >= n)
jobvr = 'V': The right eigenvectors v(j) are stored one after another in the rows of vr[][] in the same order as their eigenvalues (v(j) = j-th row of vr[][]).
jobvr = 'N': vr[][] is not referenced. |
| [out] | ilo | |
| [out] | ihi | ilo and ihi are integer values determined when A was balanced. The balanced a[j][i] = 0 if i > j and j = 0, ..., ilo-2 or i = ihi, ..., n-1. |
| [out] | scale[] | Array scale[lscale] (lscale >= n)
Details of the permutations and scaling factors applied when balancing A. If p(j) is the index of the row and column interchanged with row and column j, and d(j) is the scaling factor applied to row and column j, then
scale[j] = p(j), for j = 0 to ilo-2
= d(j), for j = ilo-1 to ihi-1
= p(j), for j = ihi to n-1
The order in which the interchanges are made is n-1 to ihi, then 0 to ilo-2. |
| [out] | abnrm | The one-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column). |
| [out] | rconde() | Array rconde[lrconde] (lrconde >= n)
rconde[j] is the reciprocal condition number of the j-th eigenvalue. |
| [out] | rcondv() | Array rcondv[lrcondv] (lrcondv >= n)
rcondv[j] is the reciprocal condition number of the j-th right eigenvector. |
| [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, 2*n) if sense = 'N' or 'E', lwork >= max(1, n*n+2*n) if sense = 'V' or 'B')
For good performance, lwork must generally be larger.
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] | rwork[] | Array rwork[lrwork] (lrwork >= 2*n)
Work array. |
| [out] | info | = 0: Successful exit
= -1: The argument balanc had an illegal value (balanc != 'N', 'P', 'S' nor 'B')
= -2: The argument jobvl had an illegal value (jobvl != 'V' nor 'N')
= -3: The argument jobvr had an illegal value (jobvr != 'V' nor 'N')
= -4: The argument sense had an illegal value (sense != 'N', 'E', 'V' nor 'B')
= -5: The argument n had an illegal value (n < 0)
= -6: The argument lda had an illegal value (lda < max(1, n))
= -9: The argument ldvl had an illegal value (ldvl too small)
= -11: The argument ldvr had an illegal value (ldvr too small)
= -20: The argument lwork had an illegal value (lwork too small)
= i > 0: The QR algorithm failed to compute all the eigenvalues, and no eigenvectors or condition numbers have been computed. Elements 0 to ilo-2 and i to n-1 of w[] contain eigenvalues which have converged. |
- Reference
- LAPACK
|