These subroutines compute the eigenvalues and, optionally, the eigenvectors of a generalized real eigensystem, where A and B are real general matrices. Eigenvalues w are based on the two parts returned in vectors alpha and beta, such that wi = alphai / betai for betai <> 0, and wi = infinity for betai = 0. Eigenvectors are returned in matrix Z:
A, B, beta, aux | alpha, Z | Subroutine |
Short-precision real | Short-precision complex | SGEGV |
Long-precision real | Long-precision complex | DGEGV |
Fortran | CALL SGEGV | DGEGV (iopt, a, lda, b, ldb, alpha, beta, z, ldz, n, aux, naux) |
C and C++ | sgegv | dgegv (iopt, a, lda, b, ldb, alpha, beta, z, ldz, n, aux, naux); |
PL/I | CALL SGEGV | DGEGV (iopt, a, lda, b, ldb, alpha, beta, z, ldz, n, aux, naux); |
If iopt = 0, eigenvalues only are computed.
If iopt = 1, eigenvalues and eigenvectors are computed.
Specified as: a fullword integer; iopt = 0 or 1.
If iopt = 0, it is not used in the computation.
If iopt = 1, it is the leading dimension of the output array specified for z.
Specified as: a fullword integer. It must have the following value, where:
If iopt = 0, ldz > 0.
If iopt = 1, ldz > 0 and ldz >= n.
If naux = 0 and error 2015 is unrecoverable, aux is ignored.
Otherwise, it is a storage work area used by this subroutine. Its size is specified by naux.
Specified as: an area of storage, containing numbers of the data type indicated in Table 126. On output, the contents are overwritten.
If naux = 0 and error 2015 is unrecoverable, SGEGV and DGEGV dynamically allocate the work area used by the subroutine. The work area is deallocated before control is returned to the calling program.
Otherwise, naux >= 3n.
If iopt = 0, it is not used in the computation.
If iopt = 1, it is the matrix Z of order n, containing the eigenvectors of the generalized real eigensystem, Az = wBz. The eigenvector in column i of matrix Z corresponds to the eigenvalue wi, computed using the alphai and betai values. Each eigenvector is normalized so that the modulus of its largest element is 1.
Returned as: an ldz by (at least) n array, containing numbers of the data type indicated in Table 126.
The following steps describe the methods used to compute the eigenvalues and, optionally, the eigenvectors of a generalized real eigensystem, Az = wBz, where A and B are real general matrices. The methods are based upon Moler and Stewart's QZ algorithm. You must calculate the resulting eigenvalues w based on the two parts returned in vectors alpha and beta. Each eigenvalue is calculated as follows: wi = alphai/betai for betai <> 0 and wi = infinity for betai = 0. Eigenvalues are unordered, except that complex conjugate pairs appear consecutively with the eigenvalue having the positive imaginary part first.
For more information on these methods, see references [39], [43], [58], [83], [63], [62], [87], [97], and [99]. If n is 0, no computation is performed. The results of the computations using short- and long-precision data can vary in accuracy.
These algorithms have a tendency to generate underflows that may hurt overall performance. The system default is to mask underflow, which improves the performance of these subroutines.
Error 2015 is unrecoverable, naux = 0, and unable to allocate work area.
Eigenvalue (i) failed to converge after (xxx) iterations:
This example shows how to find the eigenvalues only of a real generalized eigensystem problem, AZ = wBZ, where:
IOPT A LDA B LDB ALPHA BETA Z LDZ N AUX NAUX | | | | | | | | | | | | CALL DGEGV( 0 , A , 3 , B , 3 , ALPHA , BETA , DUMMY , 1 , 3 , AUX , 9 )
* * | 10.0 1.0 2.0 | A = | 1.0 3.0 -1.0 | | 1.0 1.0 2.0 | * *
* * | 1.0 2.0 3.0 | B = | 4.0 5.0 6.0 | | 7.0 8.0 9.0 | * *
* * | (4.778424, 0.000000) | ALPHA = | (-4.760580, 0.000000) | | (2.769466, 0.000000) | * *
* * | 0.000000 | BETA = | 0.934851 | | 15.446215 | * *
This example shows how to find the eigenvalues and eigenvectors of a real generalized eigensystem problem, AZ = wBZ, where:
IOPT A LDA B LDB ALPHA BETA Z LDZ N AUX NAUX | | | | | | | | | | | | CALL DGEGV( 1 , A , 5 , B , 5 , ALPHA , BETA , Z , 5 , 5 , AUX , 15 )
* * | 2.0 3.0 4.0 5.0 6.0 | | 4.0 4.0 5.0 6.0 7.0 | A = | 0.0 3.0 6.0 7.0 8.0 | | 0.0 0.0 2.0 8.0 9.0 | | 0.0 0.0 0.0 1.0 10.0 | * *
* * | 1.0 -1.0 -1.0 -1.0 -1.0 | | 0.0 1.0 -1.0 -1.0 -1.0 | B = | 0.0 0.0 1.0 -1.0 -1.0 | | 0.0 0.0 0.0 1.0 -1.0 | | 0.0 0.0 0.0 0.0 1.0 | * *
* * | (7.950050, 0.000000) | | (-0.277338, 0.000000) | ALPHA = | (2.149669, 0.000000) | | (6.720718, 0.000000) | | (10.987556, 0.000000) | * *
* * | 0.374183 | | 1.480299 | BETA = | 1.636872 | | 1.213574 | | 0.908837 | * *
* | (1.000000, 0.000000) (-0.483408, 0.000000) (0.540696, 0.000000) | (0.565497, 0.000000) (1.000000, 0.000000) (0.684441, 0.000000) Z = | (0.180429, 0.000000) (-0.661372, 0.000000) (-1.000000, 0.000000) | (0.034182, 0.000000) (0.180646, 0.000000) (0.363671, 0.000000) | (0.003039, 0.000000) (-0.017732, 0.000000) (-0.041865, 0.000000) * * (1.000000, 0.000000) (-1.000000, 0.000000) | (0.722065, 0.000000) (-0.610415, 0.000000) | (-0.089003, 0.000000) (-0.116987, 0.000000) | (-0.223599, 0.000000) (0.038979, 0.000000) | (0.050111, 0.000000) (0.018653, 0.000000) | *