These subroutines compute the eigenvalues and, optionally, the eigenvectors of a generalized real symmetric eigensystem, where A is a real symmetric matrix, and B is a real positive definite symmetric matrix. Both A and B are stored in lower storage mode in two-dimensional arrays. Eigenvalues are returned in vector w, and eigenvectors are returned in matrix Z:
where A = AT,
B = BT, and
xTBx > 0.
| A, B, w, Z, aux | Subroutine |
| Short-precision real | SSYGV |
| Long-precision real | DSYGV |
| Fortran | CALL SSYGV | DSYGV (iopt, a, lda, b, ldb, w, z, ldz, n, aux, naux) |
| C and C++ | ssygv | dsygv (iopt, a, lda, b, ldb, w, z, ldz, n, aux, naux); |
| PL/I | CALL SSYGV | DSYGV (iopt, a, lda, b, ldb, w, 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 127. On output, the contents are overwritten.
If naux = 0 and error 2015 is unrecoverable, SSYGV and DSYGV dynamically allocate the work area used by the subroutine. The work area is deallocated before control is returned to the calling program.
Otherwise, It must have the following value, where:
If iopt = 0, naux >= n.
If iopt = 1, naux >= 2n.
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 symmetric eigensystem, Az = wBz. The eigenvectors are normalized so that ZTBZ = I. The eigenvector in column i of matrix Z corresponds to the eigenvalue wi.
Returned as: an ldz by (at least) n array, containing numbers of the data type indicated in Table 127.
The following steps describe the methods used to compute the eigenvalues and, optionally, the eigenvectors of a generalized real symmetric eigensystem, Az = wBz, where A is a real symmetric matrix, and B is a real positive definite symmetric matrix. Both A and B are stored in lower storage mode in two-dimensional arrays.
For a description of methods used in this computation, see SPPF, DPPF, SPOF, DPOF, CPOF, ZPOF, SPOTRF, DPOTRF, CPOTRF, and ZPOTRF--Positive Definite Real Symmetric or Complex Hermitian Matrix Factorization.
In this computation, C overwrites A.
where:
For a description of the methods used for this computation, see Real Symmetric Matrix. In this computation, Y overwrites Z.
For more information on these methods, see references [39], [43], [58], [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.
This example shows how to find the eigenvalues only of a real symmetric generalized eigensystem problem, AZ = wBZ, where:
IOPT A LDA B LDB W Z LDZ N AUX NAUX
| | | | | | | | | | |
CALL DSYGV( 0 , A , 2 , B , 2 , W , DUMMY , 1 , 2 , AUX , 2 )
* *
A = | 229.0 . |
| 163.0 116.0 |
* *
* *
B = | 81.0 . |
| 59.0 43.0 |
* *
* *
W = | -0.500000 |
| 5.000000 |
* *
This example shows how to find the eigenvalues and eigenvectors of a real symmetric generalized eigensystem problem, AZ = wBZ, where:
IOPT A LDA B LDB W Z LDZ N AUX NAUX
| | | | | | | | | | |
CALL DSYGV( 1 , A , 3 , B , 3 , W , Z , 3 , N , AUX , 6 )
* *
| -1.0 . . |
A = | 1.0 1.0 . |
| -1.0 -1.0 1.0 |
* *
* *
| 2.0 . . |
B = | 1.0 2.0 . |
| 0.0 1.0 2.0 |
* *
* *
| -1.500000 |
W = | 0.000000 |
| 2.000000 |
* *
* *
| 0.866025 0.000000 0.000000 |
Z = | -0.577350 -0.408248 -0.707107 |
| 0.288675 -0.408248 0.707107 |
* *