|
|
◆ dggev()
| void dggev |
( |
char |
jobvl, |
|
|
char |
jobvr, |
|
|
int |
n, |
|
|
int |
lda, |
|
|
double |
a[], |
|
|
int |
ldb, |
|
|
double |
b[], |
|
|
double |
alphar[], |
|
|
double |
alphai[], |
|
|
double |
beta[], |
|
|
int |
ldvl, |
|
|
double |
vl[], |
|
|
int |
ldvr, |
|
|
double |
vr[], |
|
|
double |
work[], |
|
|
int |
lwork, |
|
|
int * |
info |
|
) |
| |
(Simple driver) Generalized eigenvalue problem of general matrices
- Purpose
- This routine computes for a pair of n x n real nonsymmetric matrices (A, B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
A generalized eigenvalue for a pair of matrices (A, B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha, beta), as there is a reasonable interpretation for beta = 0, and even for both being zero.
The right generalized eigenvector v(j) corresponding to the generalized eigenvalue lambda(j) of (A, B) satisfies A * v(j) = lambda(j) * B * v(j)
The left generalized eigenvector u(j) corresponding to the generalized eigenvalue lambda(j) of (A, B) satisfies u(j)^H * A = lambda(j) * u(j)^H * B
where u(j)^H is the conjugate-transpose of u(j).
- Parameters
-
| [in] | jobvl | = 'N': Do not compute the left generalized eigenvectors.
= 'V': Compute the left generalized eigenvectors. |
| [in] | jobvr | = 'N': Do not compute the right generalized eigenvectors.
= 'V': Compute the right generalized eigenvectors. |
| [in] | n | Order of the matrices A, B, VL and VR. (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] Matrix A in the pair (A, B).
[out] a[][] has been overwritten. |
| [in] | ldb | Leading dimension of the two dimensional array b[][]. (ldb >= max(1, n)) |
| [in,out] | b[][] | Array b[lb][ldb] (lb >= n)
[in] Matrix B in the pair (A, B).
[out] b[][] has been overwritten. |
| [out] | alphar[] | Array alphar[lalphar] (lalphar >= n) |
| [out] | alphai[] | Array alphai[lalphai] (lalphai >= n) |
| [out] | beta[] | Array beta[lbeta] (lbeta >= n)
(alphar[j] + alphai[j]*i)/beta[j], j = 0, ..., n-1, will be the generalized eigenvalues. If alphai[j] is zero, then the j-th eigenvalue is real. If positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with alphai[j+1] negative.
Note: The quotients alphar[j]/beta[j] and alphai[j]/beta[j] may easily over- or underflow, and beta[j] may even be zero. Thus, the user should avoid naively computing the ratio alpha/beta. However, alphar and alphai will be always less than and usually comparable with norm(A) in magnitude, and beta always less than and usually comparable with norm(B). |
| [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 columns of vl[][], in the same order as their eigenvalues.
If the j-th eigenvalue is real, then u(j) = vl[j][*], the j-th column of vl[][].
If j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u(j) = vl[j][*] + vl[j+1][*]*i and u(j+1) = vl[j][*] - vl[j+1][*]*i.
Each eigenvector is scaled so the largest component has |real part| + |imaginary part| = 1.
jobvl = 'N': 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 columns of vr[][] in the same order as their eigenvalues.
If the j-th eigenvalue is real, then v(j) = vr[j][*], the j-th column of vr[][].
If j-th and (j+1)-th eigenvalues form a complex conjugate pair, then v(j) = vr[j][*] + vr[j+1][*]*i and v(j+1) = vr[j][*] - vr[j+1][*]*i.
Each eigenvector is scaled so the largest component has |real part| + |imag. part| = 1.
jobvr = 'N': 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, 8*n))
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] | info | = 0: Successful exit
= -1: The argument jobvl had an illegal value (jobvl != 'V' nor 'N')
= -2: The argument jobvr had an illegal value (jobvr != 'V' nor 'N')
= -3: The argument n had an illegal value (n < 0)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -6: The argument ldb had an illegal value (ldb < max(1, n))
= -11: The argument ldvl had an illegal value (ldvl too small)
= -13: The argument ldvr had an illegal value (ldvr too small)
= -16: The argument lwork had an illegal value (lwork too small)
= i (0 < i <= n): The QZ iteration failed. No eigenvectors have been calculated, but alphar[j], alphai[j], and beta[j] should be correct for j = i, ..., n-1.
= n+1: Other than QZ iteration failed in dhgeqz
= n+2: Error return from dtgevc |
- Reference
- LAPACK
|