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

◆ dgeev()

void dgeev ( char  jobvl,
char  jobvr,
int  n,
int  lda,
double  a[],
double  wr[],
double  wi[],
int  ldvl,
double  vl[],
int  ldvr,
double  vr[],
double  work[],
int  lwork,
int *  info 
)

(Simple driver) Eigenvalues and left and/or right eigenvectors of a general matrix

Purpose
This routine computes for an n x n real nonsymmetric matrix A, all 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.

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.
Parameters
[in]jobvl= 'N': Left eigenvectors of A are not computed.
= 'V': Left eigenvectors of A are computed.
[in]jobvr= 'N': Right eigenvectors of A are not computed.
= 'V': Right eigenvectors of A are computed.
[in]nOrder of the matrix A. (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] n x n matrix A.
[out] a[][] has been overwritten.
[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. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.
[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 eigenvectors u(j) are stored one after another in the rows of vl[][], in the same order as their eigenvalues. If the j-th eigenvalue is real, then u(j) = (j-th row of vl[][]). If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then u(j) = (j-th row of vl[][]) + i*((j+1)-th row of vl[][]) and u(j+1) = (j-th row of vl[][]) - i*((j+1)-st row of vl[][]).
jobvl = 'N': vl[][] is 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 eigenvectors v(j) are stored one after another in the rows of vr[][] in the same order as their eigenvalues. If the j-th eigenvalue is real, then v(j) = (j-th row of vr[][]). If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then v(j) = (j-th row of vr[][]) + i*((j+1)-st row of vr[][]) and v(j+1) = (j-th row of vr[][]) - i*((j+1)-st row of vr[][]).
jobvr = 'N': vr[][] is not referenced.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork >= max(1, 3*n) if jobvl = 'N' and jobvr = 'N', lwork >= max(1, 4*n) if jobvl = 'V' or jobvr = 'V')
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))
= -8: The argument ldvl had an illegal value (ldvl too small)
= -10: The argument ldvr had an illegal value (ldvr too small)
= -13: The argument lwork had an illegal value (lwork too small)
= i > 0: The QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed; elements i to n-1 of wr[] and wi[] contain eigenvalues which have converged.
Reference
LAPACK