XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zggev()

void zggev ( char  jobvl,
char  jobvr,
int  n,
int  lda,
doublecomplex  a[],
int  ldb,
doublecomplex  b[],
doublecomplex  alpha[],
doublecomplex  beta[],
int  ldvl,
doublecomplex  vl[],
int  ldvr,
doublecomplex  vr[],
doublecomplex  work[],
int  lwork,
double  rwork[],
int *  info 
)

(Simple driver) Generalized eigenvalue problem of complex matrices

Purpose
This routine computes for a pair of n x n complex 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]nOrder of the matrices A, B, VL and VR. (n >= 0) (If n = 0, returns without computation)
[in]ldaLeading 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]ldbLeading 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]alpha[]Array alpha[lalpha] (lalpha >= n)
[out]beta[]Array beta[lbeta] (lbeta >= n)
alpha[j]/beta[j], j = 0, ..., n-1, will be the generalized eigenvalues.

Note: The quotients alpha[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, alpha 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]ldvlLeading 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 generalized eigenvectors u(j) are stored one after another in the columns of vl[][], in the same order as their eigenvalues. Each eigenvector is scaled so the largest component has |real part| + |imaginary part| = 1.
jobvl = 'N': Not referenced.
[in]ldvrLeading 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 generalized eigenvectors v(j) are stored one after another in the columns of vr[][] in the same order as their eigenvalues. Each eigenvector is scaled so the largest component has |real part| + |imaginary part| = 1.
jobvr = 'N': Not referenced.
[out]work[]Array work[lwork]
Complex work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork >= max(1, 2*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]rwork[]Array rwork[lrwork] (lrwork >= 8*n)
Work array.
[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))
= -10: The argument ldvl had an illegal value (ldvl too small)
= -12: The argument ldvr had an illegal value (ldvr too small)
= -15: The argument lwork had an illegal value (lwork too small)
= i (0 < i <= n): The QZ iteration failed. No eigenvectors have been calculated, but alpha[j] and beta[j] should be correct for j = i, ..., n-1.
= n+1: Other than QZ iteration failed in zhgeqz.
= n+2: Error return from ztgevc.
Reference
LAPACK