Refactored SLATEC/EISPACK routines for computing eigenvalues and eigenvectors.
Balance a real general matrix and isolate eigenvalues whenever possible.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nm | ||||
integer | :: | n | ||||
real(kind=wp) | :: | a(Nm,*) | ||||
integer | :: | Low | ||||
integer | :: | Igh | ||||
real(kind=wp) | :: | Scale(*) |
Form the eigenvectors of a real general matrix from the eigenvectors of matrix output from BALANC.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nm | ||||
integer | :: | n | ||||
integer | :: | Low | ||||
integer | :: | Igh | ||||
real(kind=wp) | :: | Scale(*) | ||||
integer | :: | m | ||||
real(kind=wp) | :: | z(Nm,*) |
Compute the complex quotient of two complex numbers.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp) | :: | Ar | ||||
real(kind=wp) | :: | Ai | ||||
real(kind=wp) | :: | Br | ||||
real(kind=wp) | :: | Bi | ||||
real(kind=wp) | :: | Cr | ||||
real(kind=wp) | :: | Ci |
Reduce a real general matrix to upper Hessenberg form using stabilized elementary similarity transformations.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nm | ||||
integer | :: | n | ||||
integer | :: | Low | ||||
integer | :: | Igh | ||||
real(kind=wp) | :: | a(Nm,*) | ||||
integer | :: | Intv(*) |
Accumulates the stabilized elementary similarity transformations used in the reduction of a real general matrix to upper Hessenberg form by ELMHES.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nm | ||||
integer | :: | n | ||||
integer | :: | Low | ||||
integer | :: | Igh | ||||
real(kind=wp) | :: | a(Nm,*) | ||||
integer | :: | Int(*) | ||||
real(kind=wp) | :: | z(Nm,*) |
Compute the eigenvalues of a real upper Hessenberg matrix using the QR method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nm | ||||
integer | :: | n | ||||
integer | :: | Low | ||||
integer | :: | Igh | ||||
real(kind=wp) | :: | h(Nm,*) | ||||
real(kind=wp) | :: | Wr(*) | ||||
real(kind=wp) | :: | Wi(*) | ||||
integer | :: | Ierr |
Compute the eigenvalues and eigenvectors of a real upper Hessenberg matrix using QR method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | Nm | ||||
integer | :: | n | ||||
integer | :: | Low | ||||
integer | :: | Igh | ||||
real(kind=wp) | :: | h(Nm,*) | ||||
real(kind=wp) | :: | Wr(*) | ||||
real(kind=wp) | :: | Wi(*) | ||||
real(kind=wp) | :: | z(Nm,*) | ||||
integer | :: | Ierr |
Compute the eigenvalues and, optionally, the eigenvectors of a real general matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | Nm |
must be set to the row dimension of the two-dimensional array parameters, A and Z, as declared in the calling program dimension statement. |
||
integer, | intent(in) | :: | n |
the order of the matrix A. N must be less than or equal to NM. |
||
real(kind=wp), | intent(inout) | :: | a(Nm,*) |
contains the real general matrix. dimensioned A(NM,N). Note: A is destroyed on output. |
||
real(kind=wp), | intent(out) | :: | Wr(*) |
real part of the eigenvalues. The eigenvalues are unordered except that complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first. If an error exit is made, the eigenvalues should be correct for indices IERR+1, IERR+2, ..., N. WR and WI are one-dimensional REAL arrays, dimensioned WR(N) and WI(N). |
||
real(kind=wp), | intent(out) | :: | Wi(*) |
imaginary part of the eigenvalues. |
||
integer, | intent(in) | :: | Matz |
an INTEGER variable set equal to zero if only eigenvalues are desired. Otherwise, it is set to any non-zero integer for both eigenvalues and eigenvectors. |
||
real(kind=wp), | intent(out) | :: | z(Nm,*) |
contains the real and imaginary parts of the eigenvectors if MATZ is not zero. If the J-th eigenvalue is real, the J-th column of Z contains its eigenvector. If the J-th eigenvalue is complex with positive imaginary part, the J-th and (J+1)-th columns of Z contain the real and imaginary parts of its eigenvector. The conjugate of this vector is the eigenvector for the conjugate eigenvalue. Z is a two-dimensional REAL array, dimensioned Z(NM,N). |
||
integer, | intent(inout) | :: | Iv1(*) |
one-dimensional temporary storage arrays of dimension N. |
||
real(kind=wp), | intent(inout) | :: | Fv1(*) |
one-dimensional temporary storage arrays of dimension N. |
||
integer, | intent(out) | :: | Ierr |
an INTEGER flag set to: |
Compute the eigenvalues and, optionally, the eigenvectors of a real general matrix.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
the order of the matrix |
||
real(kind=wp), | intent(in), | dimension(n,n) | :: | a |
contains the real general matrix |
|
real(kind=wp), | intent(out), | dimension(n,2) | :: | w |
real and imaginary parts of the eigenvalues |
|
real(kind=wp), | intent(out), | dimension(n,n) | :: | z |
real and imaginary parts of the eigenvectors |
|
integer, | intent(out) | :: | ierr |
output flag from rg |
Returns only the real eigenvalues and the associated eigenvectors. Wrapper for compute_eigenvalues_and_eigenvectors.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | n |
the order of the matrix |
||
real(kind=wp), | intent(in), | dimension(n,n) | :: | a |
contains the real general matrix |
|
real(kind=wp), | intent(out), | dimension(:), allocatable | :: | e |
eigenvalues (size |
|
real(kind=wp), | intent(out), | dimension(:,:), allocatable | :: | v |
eigenvectors (size |
|
integer, | intent(out) | :: | n_results |
number of real eigenvalues |
||
integer, | intent(out) | :: | ierr |
output flag from rg |
Unit test