This section contains the eigensystem analysis subroutine
SGEEV and DGEEV compute the eigenvalues and, optionally, all or selected eigenvectors of real general matrix A. CGEEV and ZGEEV compute the eigenvalues and, optionally, all or selected eigenvectors of complex general matrix A. Eigenvalues are returned in complex vector w, and eigenvectors are returned in complex matrix Z:
A | w, Z | aux | Subroutine |
---|---|---|---|
Short-precision real | Short-precision complex | Short-precision real | SGEEV |
Long-precision real | Long-precision complex | Long-precision real | DGEEV |
Short-precision complex | Short-precision complex | Short-precision real | CGEEV |
Long-precision complex | Long-precision complex | Long-precision real | ZGEEV |
Fortran | CALL SGEEV | DGEEV | CGEEV | ZGEEV (iopt, a, lda, w, z, ldz, select, n, aux, naux) |
C and C++ | sgeev | dgeev | cgeev | zgeev (iopt, a, lda, w, z, ldz, select, n, aux, naux); |
PL/I | CALL SGEEV | DGEEV | CGEEV | ZGEEV (iopt, a, lda, w, z, ldz, select, n, aux, naux); |
If iopt = 0, eigenvalues only are computed.
If iopt = 1, eigenvalues and eigenvectors are computed.
If iopt = 2, eigenvalues and eigenvectors corresponding to selected eigenvalues are computed.
Specified as: a fullword integer; iopt = 0, 1, or 2.
If iopt = 0, it is not used in the computation.
If iopt = 1 or 2, it is the leading dimension of the output array specified for z.
Specified as: a fullword integer. It must have the following values, where:
If iopt = 0, ldz > 0.
If iopt = 1 or 2, ldz > 0 and ldz >= n.
If iopt = 0 or 1, it is not used in the computation.
If iopt = 2, it is the logical vector select of length n whose true elements indicate those eigenvalues whose corresponding eigenvectors are to be computed.
Specified as: a one-dimensional array of (at least) length n, containing logical data items. Element values can be true (.TRUE.) or false (.FALSE.).
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 118. On output, the contents are overwritten.
If naux = 0 and error 2015 is unrecoverable, SGEEV, DGEEV, CGEEV, and ZGEEV 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:
For SGEEV and DGEEV:
naux >= n2+4n.
For CGEEV and ZGEEV:
Returned as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 118.
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 matrix A. The eigenvector in column i of matrix Z corresponds to the eigenvalue wi.
If iopt = 2, it is the n by m matrix Z, containing the m eigenvectors of matrix A, which correspond to the m selected eigenvalues in wi,
where m is the number of true elements in the logical vector select. The eigenvector in column i of matrix Z corresponds to the i-th selected eigenvalue. Any eigenvector that does not converge is set to 0.
Returned as: a two-dimensional array, containing numbers of the data type indicated in Table 118, where:
If iopt = 1, the array must be ldz by (at least) n.
If iopt = 2, the array must be ldz by (at least) m.
The next two sections describe the methods used to compute the eigenvectors and eigenvalues for either a real general matrix or a complex general matrix. For more information on these methods, see references [39], [43], [45], [60], [81], [91], and [93]. If n is 0, no computation is performed. The results of the computations using short- and long-precision data can vary in accuracy. See the examples for an illustration of the difference in the results.
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.
The eigenvalues and, optionally, all or selected eigenvectors of a real general matrix A are computed as follows.
The eigenvalues and, optionally, all or selected eigenvectors of a complex general matrix A are computed as follows.
Error 2015 is unrecoverable, naux = 0, and unable to allocate work area.
This example shows how to find the eigenvalues only of a real short-precision general matrix A of order 4, where:
Note: | This matrix is used in Example 5.5 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL SGEEV( 0 , A , 4 , W , DUMMY1 , 1 , DUMMY2 , 4 , AUX , 4 ) * * | -2.0 2.0 2.0 2.0 | A = | -3.0 3.0 2.0 2.0 | | -2.0 0.0 4.0 2.0 | | -1.0 0.0 0.0 5.0 | * *
* * | (0.999999, 0.000000) | W = | (2.000001, 0.000000) | | (2.999996, 0.000000) | | (3.999999, 0.000000) | * *
This example shows how to find the eigenvalues and eigenvectors of a real short-precision general matrix A of order 3, where:
Note: | This matrix is used in Example 5.1 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL SGEEV( 1 , A , 3 , W , Z , 3 , DUMMY , 3 , AUX , 6 ) * * | 33.0 16.0 72.0 | A = | -24.0 -10.0 -57.0 | | -8.0 -4.0 -17.0 | * *
* * | (3.000022, 0.000000) | W = | (1.000019, 0.000000) | | (1.999961, 0.000000) | * * * * | (2.498781, 0.000000) (76.837608, 0.000000) (79.999451, 0.000000) | Z = | (-1.874081, 0.000000) (-61.470169, 0.000000) (-64.999649, 0.000000) | | (-0.624695, 0.000000) (-20.489990, 0.000000) (-19.999886, 0.000000) | * *
This example shows how to find the eigenvalues and eigenvectors of a real short-precision general matrix A of order 3, where:
Note: | This matrix is used in Example 5.4 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL SGEEV( 1 , A , 3 , W , Z , 3 , DUMMY , 3 , AUX , 6 ) * * | 8.0 -1.0 -5.0 | A = | -4.0 4.0 -2.0 | | 18.0 -5.0 -7.0 | * *
* * | (1.999999, 3.999998) | W = | (1.999999, -3.999998) | | (0.999997, 0.000000) | * * * * | (0.044710, 0.410578) (0.044710, -0.410578) (1.732048, 0.000000) | Z = | (-0.365868, 0.455287) (-0.365868, -0.455287) (3.464096, 0.000000) | | (0.455287, 0.365868) (0.455287, -0.365868) (1.732049, 0.000000) | * *
This example shows how to find the eigenvalues and selected eigenvectors of a real short-precision general matrix A of order 4, where:
Note: | This matrix is used in Example 5.5 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL SGEEV( 2 , A , 4 , W , Z , 4 , SELECT , 4 , AUX , 32 )
* * | -2.0 2.0 2.0 2.0 | A = | -3.0 3.0 2.0 2.0 | | -2.0 0.0 4.0 2.0 | | -1.0 0.0 0.0 5.0 | * *
* * | .TRUE. | SELECT = | .FALSE. | | .TRUE. | | .TRUE. | * *
* * | (0.999999, 0.000000) | W = | (2.000001, 0.000000) | | (2.999996, 0.000000) | | (3.999999, 0.000000) | * *
* * | (1.000000, 0.000000) (-0.674014, 0.000000) (-0.474306, 0.000000) | Z = | (0.750000, 0.000000) (-0.674014, 0.000000) (-0.474306, 0.000000) | | (0.500000, 0.000000) (-0.674013, 0.000000) (-0.474306, 0.000000) | | (0.250000, 0.000000) (-0.337006, 0.000000) (-0.474305, 0.000000) | * *
This example shows how to find the eigenvalues and selected eigenvectors of a real short-precision general matrix A of order 3, where:
Note: | This matrix is used in Example 5.4 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL SGEEV( 2 , A , 3 , W , Z , 3 , SELECT , 3 , AUX , 21 )
* * | 8.0 -1.0 -5.0 | A = | -4.0 4.0 -2.0 | | 18.0 -5.0 -7.0 | * *
* * | .TRUE. | SELECT = | .TRUE. | | .FALSE. | * *
* * | (1.999999, 3.999998) | W = | (1.999999, -3.999998) | | (0.999997, 0.000000) | * *
* * | (0.500000, 0.000000) (0.500000, 0.000000) | Z = | (0.500000, 0.500000) (0.500000, -0.500000) | | (0.500000, -0.500000) (0.500000, 0.500000) | * *
This example shows how the results of Example 5 would differ if matrix A was a real long-precision general matrix. On output, A has been overwritten.
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL DGEEV( 2 , A , 3 , W , Z , 3 , SELECT , 3 , AUX , 21 )
* * | (2.000000, 4.000000) | W = | (2.000000, -4.000000) | | (1.000000, 0.000000) | * *
* * | (0.500000, 0.000000) (0.500000, 0.000000) | Z = | (0.500000, 0.500000) (0.500000, -0.500000) | | (0.500000, -0.500000) (0.500000, 0.500000) | * *
This example shows how to find the eigenvalues only of a complex long-precision general matrix A of order 3, where:
Note: | This matrix is used in Example 6.4 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL ZGEEV( 0 , A , 3 , W , DUMMY1 , 1 , DUMMY2 , 3 , AUX , 6 ) * * | (1.0, 2.0) (3.0, 4.0) (21.0, 22.0) | A = | (43.0, 44.0) (13.0, 14.0) (15.0, 16.0) | | (5.0, 6.0) (7.0, 8.0) (25.0, 26.0) | * *
* * | (39.776655, 42.995668) | W = | (-7.477530, 6.880321) | | (6.700876, -7.875989) | * *
This example shows how to find the eigenvalues and eigenvectors of a complex long-precision general matrix A of order 4, where:
Note: | This matrix is used in Example 6.5 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL ZGEEV( 1 , A , 4 , W , Z , 4 , DUMMY , 4 , AUX , 12 ) * * | (5.0, 9.0) (5.0, 5.0) (-6.0, -6.0) (-7.0, -7.0) | A = | (3.0, 3.0) (6.0, 10.0) (-5.0, -5.0) (-6.0, -6.0) | | (2.0, 2.0) (3.0, 3.0) (-1.0, 3.0) (-5.0, -5.0) | | (1.0, 1.0) (2.0, 2.0) (-3.0, -3.0) (0.0, 4.0) | * *
* * | (4.000000, 8.000000) | W = | (2.000000, 6.000000) | | (3.000000, 7.000000) | | (1.000000, 5.000000) | * *
* * | (0.625817, 0.229776) (0.333009, -0.729358) (-1.535458, 1.519551) (0.000000, 3.464102) | Z = | (0.625817, 0.229776) (0.666017, -1.458715) (-1.535458, 1.519551) (0.000000, 1.732051) | | (0.625817, 0.229776) (0.333009, -0.729358) ( 0.000000, 0.000000) (0.000000, 1.732051) | | (0.000000, 0.000000) (0.333009, -0.729358) (-1.535458, 1.519551) (0.000000, 1.732051) | * *
This example shows how to find the eigenvalues and selected eigenvectors of a complex long-precision general matrix A of order 4, where:
Note: | This matrix is used in Example 6.5 in referenced text [60]. |
IOPT A LDA W Z LDZ SELECT N AUX NAUX | | | | | | | | | | CALL ZGEEV( 2 , A , 4 , W , Z , 4 , SELECT , 4 , AUX , 52 )
* * | (5.0, 9.0) (5.0, 5.0) (-6.0, -6.0) (-7.0, -7.0) | A = | (3.0, 3.0) (6.0, 10.0) (-5.0, -5.0) (-6.0, -6.0) | | (2.0, 2.0) (3.0, 3.0) (-1.0, 3.0) (-5.0, -5.0) | | (1.0, 1.0) (2.0, 2.0) (-3.0, -3.0) (0.0, 4.0) | * *
* * | .TRUE. | SELECT = | .FALSE. | | .TRUE. | | .TRUE. | * *
* * | (4.000000, 8.000000) | W = | (2.000000, 6.000000) | | (3.000000, 7.000000) | | (1.000000, 5.000000) | * *
* * | (-0.748331, 0.000000) (-0.935414, 0.000000) (-1.247219, 0.000000) | Z = | (-0.748331, 0.000000) (-0.935414, 0.000000) (-0.623610, 0.000000) | | (-0.748331, 0.000000) (0.000000, 0.000000) (-0.623610, 0.000000) | | (0.000000, 0.000000) (-0.935414, 0.000000) (-0.623610, 0.000000) | * *
SSPEV and DSPEV compute the eigenvalues and, optionally, the eigenvectors of real symmetric matrix A, stored in lower- or upper-packed storage mode. CHPEV and ZHPEV compute the eigenvalues and, optionally, the eigenvectors of complex Hermitian matrix A, stored in lower- or upper-packed storage mode. Eigenvalues are returned in vector w, and eigenvectors are returned in matrix Z:
where A = AT or
A = AH.
A, z | w, aux | Subroutine |
Short-precision real | Short-precision real | SSPEV |
Long-precision real | Long-precision real | DSPEV |
Short-precision complex | Short-precision real | CHPEV |
Long-precision complex | Long-precision real | ZHPEV |
Note: | For compatibility with earlier releases of ESSL, you can use the names SSLEV, DSLEV, CHLEV, and ZHLEV for SSPEV, DSPEV, CHPEV, and ZHPEV, respectively. |
Fortran | CALL SSPEV | DSPEV | CHPEV | ZHPEV (iopt, ap, w, z, ldz, n, aux, naux) |
C and C++ | sspev | dspev | chpev | zhpev (iopt, ap, w, z, ldz, n, aux, naux); |
PL/I | CALL SSPEV | DSPEV | CHPEV | ZHPEV (iopt, ap, w, z, ldz, n, aux, naux); |
If iopt = 0 or 20, eigenvalues only are computed.
If iopt = 1 or 21, eigenvalues and eigenvectors are computed.
Specified as: a fullword integer; iopt = 0, 1, 20, or 21.
If iopt = 0 or 1, it is stored in lower-packed storage mode.
If iopt = 20 or 21, it is stored in upper-packed storage mode.
Specified as: a one-dimensional array of (at least) length n(n+1)/2, containing numbers of the data type indicated in Table 119. On output, for SSPEV and DSPEV if iopt = 0 or 20, and for CHPEV and ZHPEV, AP is overwritten; that is, the original input is not preserved.
If iopt = 0 or 20, it is not used in the computation.
If iopt = 1 or 21, 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 or 20, ldz > 0.
If iopt = 1 or 21, 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 119. On output, the contents are overwritten.
If naux = 0 and error 2015 is unrecoverable, SSPEV, DSPEV, CHPEV, and ZHPEV 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:
For SSPEV and DSPEV:
For CHPEV and ZHPEV:
If iopt = 0 or 20, it is not used in the computation.
If iopt = 1 or 21, it is the matrix Z of order n, containing the orthonormal eigenvectors of matrix A. 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 119.
For a description of how complex Hermitian matrices are stored in lower- or upper-packed storage mode, see "Complex Hermitian Matrix".
The next two sections describe the methods used to compute the eigenvalues and, optionally, the eigenvectors for either a real symmetric matrix or a complex Hermitian matrix. For more information on these methods, see references [39], [43], [60], [81], [91], and [93]. If n is 0, no computation is performed. The results of the computations using short- and long-precision data can vary in accuracy. See "Example 3" and "Example 4" for an illustration of the difference in results. Eigenvalues computed using equivalent iopt values are mathematically equivalent, but are not guaranteed to be bitwise identical. For example, the results computed using iopt = 0 and iopt = 20 are mathematically equivalent, but are not necessarily bitwise identical.
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.
The eigenvalues and, optionally, the eigenvectors of a real symmetric matrix A are computed as follows:
The eigenvalues and, optionally, the eigenvectors of a complex Hermitian matrix A are computed as follows:
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 short-precision symmetric matrix A of order 3, stored in lower-packed storage mode Matrix A is:
* * | 1.0 -1.0 0.0 | | -1.0 2.0 -1.0 | | 0.0 -1.0 1.0 | * *
where:
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL SSPEV( 0 , AP , W , DUMMY , 1 , 3 , AUX , 3 ) AP = (1.0, -1.0, 0.0, 2.0, -1.0, 1.0)
* * | 0.000000 | W = | 1.000000 | | 3.000000 | * *
This example shows how to find the eigenvalues and eigenvectors of a real short-precision symmetric matrix A of order 4, stored in upper-packed storage mode. Matrix A is:
* * | 5.0 4.0 1.0 1.0 | | 4.0 5.0 1.0 1.0 | | 1.0 1.0 4.0 2.0 | | 1.0 1.0 2.0 4.0 | * *
where:
Note: | This matrix is used in Example 4.1 in referenced text [60]. |
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL SSPEV( 21 , AP , W , Z , 4 , 4 , AUX , 8 ) AP = (5.0, 4.0, 5.0, 1.0, 1.0, 4.0, 1.0, 1.0, 2.0, 4.0)
* * | 1.000000 | W = | 2.000000 | | 5.000000 | | 9.999999 | * *
* * | 0.707107 0.000000 0.316227 0.632455 | Z = | -0.707107 0.000000 0.316228 0.632455 | | 0.000000 -0.707106 -0.632455 0.316227 | | 0.000000 0.707107 -0.632455 0.316228 | * *
This example shows how to find the eigenvalues and eigenvectors of a real short-precision symmetric matrix A, stored in lower-packed storage mode, which has an eigenvalue of multiplicity 2. Matrix A is:
* * | 6.0 4.0 4.0 1.0 | | 4.0 6.0 1.0 4.0 | | 4.0 1.0 6.0 4.0 | | 1.0 4.0 4.0 6.0 | * *
where:
Note: | This matrix is used in Example 4.2 in referenced text [60]. |
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL SSPEV( 1 , AP , W , Z , 7 , 4 , AUX , 8 ) AP = (6.0, 4.0, 4.0, 1.0, 6.0, 1.0, 4.0, 6.0, 4.0, 6.0)
* * | -1.000000 | W = | 4.999999 | | 5.000000 | | 15.000000 | * *
* * | -0.500000 0.000000 0.707107 0.500000 | | 0.500000 0.707107 0.000000 0.500000 | | 0.500000 -0.707107 0.000000 0.500000 | Z = | -0.500000 0.000000 -0.707107 0.500000 | | . . . . | | . . . . | | . . . . | * *
This example shows how the results of Example 3 differ if matrix A is a real long-precision symmetric matrix.
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL DSPEV( 1 , AP , W , Z , 7 , 4 , AUX , 8 )
* * | -1.000000 | W = | 5.000000 | | 5.000000 | | 15.000000 | * *
* * | -0.500000 -0.216773 -0.673060 0.500000 | | 0.500000 0.673060 -0.216773 0.500000 | | 0.500000 -0.673060 0.216773 0.500000 | Z = | -0.500000 0.216773 0.673060 0.500000 | | . . . . | | . . . . | | . . . . | * *
This example shows how to find the eigenvalues and eigenvectors of a complex Hermitian matrix A of order 2, stored in lower-packed storage mode. Matrix A is:
* * | (1.0, 0.0) (0.0, -1.0) | | (0.0, 1.0) (1.0, 0.0) | * *
where:
Note: | This matrix is used in Example 6.1 in referenced text [60]. |
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL ZHPEV( 1 , AP , W , Z , 2 , 2 , AUX , 8 ) AP = ((1.0, . ), (0.0, 1.0), (1.0, . ))
* * W = | 0.000000 | | 2.000000 | * *
* * Z = | (0.000000, -0.707107) (0.000000, -0.707107) | | (-0.707107, 0.000000) (0.707107, 0.000000) | * *
This example shows how to find the eigenvalues only of a complex Hermitian matrix A of order 4, stored in upper-packed storage mode. Matrix A is:
* * | (3.0, 0.0) (1.0, 0.0) (0.0, 0.0) (0.0, 2.0) | | (1.0, 0.0) (3.0, 0.0) (0.0, -2.0) (0.0, 0.0) | | (0.0, 0.0) (0.0, 2.0) (1.0, 0.0) (1.0, 0.0) | | (0.0, -2.0) (0.0, 0.0) (1.0, 0.0) (1.0, 0.0) | * *
where:
Note: | This matrix is used in Example 6.6 in referenced text [60]. |
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL ZHPEV( 20 , AP , W , DUMMY , 1 , 4 , AUX , 12 ) AP = ((3.0, . ), (1.0, 0.0), (3.0, . ), (0.0, 0.0), (0.0, -2.0), (1.0, . ), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0), (1.0, . ))
* * | -0.828427 | W = | 0.000000 | | 4.000000 | | 4.828427 | * *
This example shows how to find the eigenvalues and eigenvectors of a complex Hermitian matrix A of order 2, stored in lower-packed storage mode. Matrix A is:
* * | (1.0, 0.0) (1.0, -1.0) | | (1.0, 1.0) (1.0, 0.0) | * *
where:
Note: | This matrix is used in Example 6.2 in referenced text [60]. |
IOPT AP W Z LDZ N AUZ NAUX | | | | | | | | CALL ZHPEV( 1 , AP , W , Z , 2 , 2 , AUX , 8 ) AP = ((1.0, . ), (1.0, 1.0), (1.0, . ))
* * W = | -0.414214 | | 2.414214 | * *
* * Z = | (0.500000, -0.500000) (0.500000, -0.500000) | | (-0.707107, 0.000000) (0.707107, 0.000000) | * *
SSPSV and DSPSV compute the extreme eigenvalues and, optionally, the eigenvectors of real symmetric matrix A, stored in lower- or upper-packed storage mode. CHPSV and ZHPSV compute the extreme eigenvalues and, optionally, the eigenvectors of complex Hermitian matrix A, stored in lower- or upper-packed storage mode. The extreme eigenvalues are returned in vector w, and the corresponding eigenvectors are returned in matrix Z:
where A = AT or
A = AH.
A, z | w, aux | Subroutine |
Short-precision real | Short-precision real | SSPSV |
Long-precision real | Long-precision real | DSPSV |
Short-precision complex | Short-precision real | CHPSV |
Long-precision complex | Long-precision real | ZHPSV |
Note: | If you want to compute 10% or fewer eigenvalues only, or you want to compute 30% or fewer eigenvalues and eigenvectors, you get better performance if you use _SPSV and _HPSV instead of _SPEV and _HPEV, respectively. For all other uses, you should use _SPEV and _HPEV. |
Fortran | CALL SSPSV | DSPSV | CHPSV | ZHPSV (iopt, ap, w, z, ldz, n, m, aux, naux) |
C and C++ | sspsv | dspsv | chpsv | zhpsv (iopt, ap, w, z, ldz, n, m, aux, naux); |
PL/I | CALL SSPSV | DSPSV | CHPSV | ZHPSV (iopt, ap, w, z, ldz, n, m, aux, naux); |
If iopt = 0 or 20, the m smallest eigenvalues only are computed.
If iopt = 1 or 21, the m smallest eigenvalues and the eigenvectors are computed.
If iopt = 10 or 30, the m largest eigenvalues only are computed.
If iopt = 11 or 31, the m largest eigenvalues and the eigenvectors are computed.
Specified as: a fullword integer; iopt = 0, 1, 10, 11, 20, 21, 30, or 31.
If iopt = 0, 1, 10, or 11, it is stored in lower-packed storage mode.
If iopt = 20, 21, 30, or 31, it is stored in upper-packed storage mode.
Specified as: a one-dimensional array of (at least) length n(n+1)/2, containing numbers of the data type indicated in Table 120. On output, AP is overwritten; that is, the original input is not preserved.
If iopt = 0, 10, 20, or 30, it is not used in the computation.
If iopt = 1, 11, 21, or 31, 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, 10, 20, or 30, ldz > 0.
If iopt = 1, 11, 21, or 31, 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 120. On output, the contents are overwritten.
If naux = 0 and error 2015 is unrecoverable, SSPSV, DSPSV, CHPSV, and ZHPSV 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:
For SSPSV and DSPSV:
For CHPSV and ZHPSV:
Returned as: a one-dimensional array of (at least) length n, containing numbers of the data type indicated in Table 120.
If iopt = 0, 10, 20, or 30, it is not used in the computation.
If iopt = 1, 11, 21, or 31, it is the n by m matrix Z, containing m orthonormal eigenvectors of matrix A. The eigenvector in column i of matrix Z corresponds to the eigenvalue wi.
Returned as: an ldz by (at least) m array, containing numbers of the data type indicated in Table 120.
For a description of how complex Hermitian matrices are stored in lower- or upper-packed storage mode, see "Complex Hermitian Matrix".
The methods used to compute the extreme eigenvalues and, optionally, the eigenvectors for either a real symmetric matrix or a complex Hermitian matrix are described in the steps below. For more information on these methods, see references [39], [43], [60], [81], [91], and [93]. If n or m is 0, no computation is performed. The results of the computations using short- and long-precision data can vary in accuracy. Eigenvalues computed using equivalent iopt values are mathematically equivalent, but are not guaranteed to be bitwise identical. For example, the results computed using iopt = 0 and iopt = 20 are mathematically equivalent, but are not necessarily bitwise identical.
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.
The extreme eigenvalues and, optionally, the eigenvectors of a real symmetric matrix A or complex Hermitian matrix A are computed as follows:
Error 2015 is unrecoverable, naux = 0, and unable to allocate work area.
This example shows how to find the two smallest eigenvalues and corresponding eigenvectors of a real long-precision symmetric matrix A of order 4, stored in upper-packed storage mode. Matrix A is:
* * | 5.0 4.0 1.0 1.0 | | 4.0 5.0 1.0 1.0 | | 1.0 1.0 4.0 2.0 | | 1.0 1.0 2.0 4.0 | * *
where:
Note: | This matrix is used in Example 4.1 in referenced text [60]. |
IOPT AP W Z LDZ N M AUX NAUX | | | | | | | | | CALL DSPSV( 21 , AP , W , Z , 4 , 4 , 2 , AUX , 36 ) AP = (5.0, 4.0, 5.0, 1.0, 1.0, 4.0, 1.0, 1.0, 2.0, 4.0)
* * | 1.000000 | W = | 2.000000 | | . | | . | * *
* * | -0.707107 0.000000 | Z = | 0.707107 0.000000 | | 0.000000 -0.707107 | | 0.000000 0.707107 | * *
This example shows how to find the three largest eigenvalues and corresponding eigenvectors of a real long-precision symmetric matrix A of order 4, stored in lower-packed storage mode, having an eigenvalue of multiplicity two. Matrix A is:
* * | 6.0 4.0 4.0 1.0 | | 4.0 6.0 1.0 4.0 | | 4.0 1.0 6.0 4.0 | | 1.0 4.0 4.0 6.0 | * *
where:
Note: | This matrix is used in Example 4.2 in referenced text [60]. |
IOPT AP W Z LDZ N M AUX NAUX | | | | | | | | | CALL DSPSV( 11 , AP , W , Z , 8 , 4 , 3 , AUX , 36 ) AP = (6.0, 4.0, 4.0, 1.0, 6.0, 1.0, 4.0, 6.0, 4.0, 6.0)
* * | 15.000000 | W = | 5.000000 | | 5.000000 | | . | * *
* * | 0.500000 0.707107 0.000000 | | 0.500000 0.000000 -0.707107 | | 0.500000 0.000000 0.707107 | Z = | 0.500000 -0.707107 0.000000 | | . . . | | . . . | | . . . | | . . . | * *
This example shows how to find the largest eigenvalue and the corresponding eigenvector of a complex Hermitian matrix A of order 2, stored in lower-packed storage mode. Matrix A is:
* * | (1.0, 0.0) (0.0, -1.0) | | (0.0, 1.0) (1.0, 0.0) | * *
where:
Note: | This matrix is used in Example 6.1 in referenced text [60]. |
IOPT AP W Z LDZ N M AUX NAUX | | | | | | | | | CALL ZHPSV( 11 , AP , W , Z , 2 , 2 , 1 , AUX , 22 ) AP = ((1.0, . ), (0.0, 1.0), (1.0, . ))
* * W = | 2.000000 | | . | * *
* * Z = | (0.000000, -0.707107) | | (0.707107, 0.000000) | * *
This example shows how to find the two smallest eigenvalues only of a complex Hermitian matrix A of order 4, stored in upper-packed storage mode. Matrix A is:
* * | (3.0, 0.0) (1.0, 0.0) (0.0, 0.0) (0.0, 2.0) | | (1.0, 0.0) (3.0, 0.0) (0.0, -2.0) (0.0, 0.0) | | (0.0, 0.0) (0.0, 2.0) (1.0, 0.0) (1.0, 0.0) | | (0.0, -2.0) (0.0, 0.0) (1.0, 0.0) (1.0, 0.0) | * *
where:
Note: | This matrix is used in Example 6.6 in referenced text [60]. |
IOPT AP W Z LDZ N M AUX NAUX | | | | | | | | | CALL ZHPSV( 20 , AP , W , DUMMY , 1 , 4 , 2 , AUX , 20 ) AP = ((3.0, . ), (1.0, 0.0), (3.0, . ), (0.0, 0.0), (0.0, -2.0), (1.0, . ), (0.0, 2.0), (0.0, 0.0), (1.0, 0.0), (1.0, . ))
* * | -0.828427 | W = | 0.000000 | | . | | . | * *
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 121. 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 121.
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], [55], [77], [60], [59], [81], [91], and [93]. 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:
Note: | These matrices are from page 257 in referenced text [59]. |
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:
Note: | These matrices are from page 263 in referenced text [59]. |
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) | *
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 122. 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 122.
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, and ZPOF--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], [55], [60], [59], [81], [91], and [93]. 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:
Note: | These matrices are used in Example 8.6.2 in referenced text [59]. |
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:
Note: | These matrices are from page 67 in referenced text [55]. |
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 | * *