F08PKF (DHSEIN) computes selected left and/or right eigenvectors of a real upper Hessenberg matrix corresponding to specified eigenvalues, by inverse iteration.
SUBROUTINE F08PKF ( |
JOB, EIGSRC, INITV, SELECT, N, H, LDH, WR, WI, VL, LDVL, VR, LDVR, MM, M, WORK, IFAILL, IFAILR, INFO) |
INTEGER |
N, LDH, LDVL, LDVR, MM, M, IFAILL(*), IFAILR(*), INFO |
REAL (KIND=nag_wp) |
H(LDH,*), WR(*), WI(*), VL(LDVL,*), VR(LDVR,*), WORK((N+2)*N) |
LOGICAL |
SELECT(*) |
CHARACTER(1) |
JOB, EIGSRC, INITV |
|
F08PKF (DHSEIN) computes left and/or right eigenvectors of a real upper Hessenberg matrix H, corresponding to selected eigenvalues.
The right eigenvector
x, and the left eigenvector
y, corresponding to an eigenvalue
λ, are defined by:
Note that even though
H is real,
λ,
x and
y may be complex. If
x is an eigenvector corresponding to a complex eigenvalue
λ, then the complex conjugate vector
x- is the eigenvector corresponding to the complex conjugate eigenvalue
λ-.
The eigenvectors are computed by inverse iteration. They are scaled so that, for a real eigenvector x,
maxxi
=
1
,
and for a complex eigenvector,
max
Rexi
+
Imxi
=
1
.
If
H has been formed by reduction of a real general matrix
A to upper Hessenberg form, then the eigenvectors of
H may be transformed to eigenvectors of
A by a call to
F08NGF (DORMHR).
Golub G H and Van Loan C F (1996)
Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
- 1: JOB – CHARACTER(1)Input
On entry: indicates whether left and/or right eigenvectors are to be computed.
- JOB='R'
- Only right eigenvectors are computed.
- JOB='L'
- Only left eigenvectors are computed.
- JOB='B'
- Both left and right eigenvectors are computed.
Constraint:
JOB='R', 'L' or 'B'.
- 2: EIGSRC – CHARACTER(1)Input
On entry: indicates whether the eigenvalues of
H (stored in
WR and
WI) were found using
F08PEF (DHSEQR).
- EIGSRC='Q'
- The eigenvalues of H were found using F08PEF (DHSEQR); thus if H has any zero subdiagonal elements (and so is block triangular), then the jth eigenvalue can be assumed to be an eigenvalue of the block containing the jth row/column. This property allows the routine to perform inverse iteration on just one diagonal block.
- EIGSRC='N'
- No such assumption is made and the routine performs inverse iteration using the whole matrix.
Constraint:
EIGSRC='Q' or 'N'.
- 3: INITV – CHARACTER(1)Input
On entry: indicates whether you are supplying initial estimates for the selected eigenvectors.
- INITV='N'
- No initial estimates are supplied.
- INITV='U'
- Initial estimates are supplied in VL and/or VR.
Constraint:
INITV='N' or 'U'.
- 4: SELECT(*) – LOGICAL arrayInput/Output
-
Note: the dimension of the array
SELECT
must be at least
max1,N.
On entry: specifies which eigenvectors are to be computed. To obtain the real eigenvector corresponding to the real eigenvalue WRj, SELECTj must be set .TRUE.. To select the complex eigenvector corresponding to the complex eigenvalue WRj,WIj with complex conjugate (WRj+1,WIj+1), SELECTj and/or SELECTj+1 must be set .TRUE.; the eigenvector corresponding to the first eigenvalue in the pair is computed.
On exit: if a complex eigenvector was selected as specified above, then SELECTj is set to .TRUE. and SELECTj+1 to .FALSE..
- 5: N – INTEGERInput
On entry: n, the order of the matrix H.
Constraint:
N≥0.
- 6: H(LDH,*) – REAL (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
H
must be at least
max1,N.
On entry: the n by n upper Hessenberg matrix H.
- 7: LDH – INTEGERInput
On entry: the first dimension of the array
H as declared in the (sub)program from which F08PKF (DHSEIN) is called.
Constraint:
LDH≥max1,N.
- 8: WR(*) – REAL (KIND=nag_wp) arrayInput/Output
- 9: WI(*) – REAL (KIND=nag_wp) arrayInput
-
Note: the dimension of the arrays
WR and
WI
must be at least
max1,N.
On entry: the real and imaginary parts, respectively, of the eigenvalues of the matrix
H. Complex conjugate pairs of values must be stored in consecutive elements of the arrays. If
EIGSRC='Q', the arrays
must be exactly as returned by
F08PEF (DHSEQR).
On exit: some elements of
WR may be modified, as close eigenvalues are perturbed slightly in searching for independent eigenvectors.
- 10: VL(LDVL,*) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
VL
must be at least
max1,MM if
JOB='L' or
'B' and at least
1 if
JOB='R'.
On entry: if
INITV='U' and
JOB='L' or
'B',
VL must contain starting vectors for inverse iteration for the left eigenvectors. Each starting vector must be stored in the same column or columns as will be used to store the corresponding eigenvector (see below).
If
INITV='N',
VL need not be set.
On exit: if
JOB='L' or
'B',
VL contains the computed left eigenvectors (as specified by
SELECT). The eigenvectors are stored consecutively in the columns of the array, in the same order as their eigenvalues. Corresponding to each selected real eigenvalue is a real eigenvector, occupying one column. Corresponding to each selected complex eigenvalue is a complex eigenvector, occupying two columns: the first column holds the real part and the second column holds the imaginary part.
If
JOB='R',
VL is not referenced.
- 11: LDVL – INTEGERInput
On entry: the first dimension of the array
VL as declared in the (sub)program from which F08PKF (DHSEIN) is called.
Constraints:
- if JOB='L' or 'B', LDVL≥ max1,N ;
- if JOB='R', LDVL≥1.
- 12: VR(LDVR,*) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
VR
must be at least
max1,MM if
JOB='R' or
'B' and at least
1 if
JOB='L'.
On entry: if
INITV='U' and
JOB='R' or
'B',
VR must contain starting vectors for inverse iteration for the right eigenvectors. Each starting vector must be stored in the same column or columns as will be used to store the corresponding eigenvector (see below).
If
INITV='N',
VR need not be set.
On exit: if
JOB='R' or
'B',
VR contains the computed right eigenvectors (as specified by
SELECT). The eigenvectors are stored consecutively in the columns of the array, in the same order as their eigenvalues. Corresponding to each selected real eigenvalue is a real eigenvector, occupying one column. Corresponding to each selected complex eigenvalue is a complex eigenvector, occupying two columns: the first column holds the real part and the second column holds the imaginary part.
If
JOB='L',
VR is not referenced.
- 13: LDVR – INTEGERInput
On entry: the first dimension of the array
VR as declared in the (sub)program from which F08PKF (DHSEIN) is called.
Constraints:
- if JOB='R' or 'B', LDVR≥ max1,N ;
- if JOB='L', LDVR≥1.
- 14: MM – INTEGERInput
On entry: the number of columns in the arrays
VL and/or
VR . The actual number of columns required,
m, is obtained by counting
1 for each selected real eigenvector and
2 for each selected complex eigenvector (see
SELECT);
0≤m≤n.
Constraint:
MM≥m.
- 15: M – INTEGEROutput
On exit:
m, the number of columns of
VL and/or
VR required to store the selected eigenvectors.
- 16: WORK(N+2×N) – REAL (KIND=nag_wp) arrayWorkspace
- 17: IFAILL(*) – INTEGER arrayOutput
-
Note: the dimension of the array
IFAILL
must be at least
max1,MM if
JOB='L' or
'B' and at least
1 if
JOB='R'.
On exit: if
JOB='L' or
'B', then
IFAILLi=0 if the selected left eigenvector converged and
IFAILLi=j>0 if the eigenvector stored in the
ith column of
VL (corresponding to the
jth eigenvalue as held in
WRj,WIj failed to converge. If the
ith and
i+1th columns of
VL contain a selected complex eigenvector, then
IFAILLi and
IFAILLi+1 are set to the same value.
If
JOB='R',
IFAILL is not referenced.
- 18: IFAILR(*) – INTEGER arrayOutput
-
Note: the dimension of the array
IFAILR
must be at least
max1,MM if
JOB='R' or
'B' and at least
1 if
JOB='L'.
On exit: if
JOB='R' or
'B', then
IFAILRi=0 if the selected right eigenvector converged and
IFAILRi=j>0 if the eigenvector stored in the
ith row or column of
VR (corresponding to the
jth eigenvalue as held in
WRj,WIj) failed to converge. If the
ith and
i+1th rows or columns of
VR contain a selected complex eigenvector, then
IFAILRi and
IFAILRi+1 are set to the same value.
If
JOB='L',
IFAILR is not referenced.
- 19: INFO – INTEGEROutput
On exit:
INFO=0 unless the routine detects an error (see
Section 6).
Each computed right eigenvector
xi is the exact eigenvector of a nearby matrix
A+Ei, such that
Ei=OεA. Hence the residual is small:
However, eigenvectors corresponding to close or coincident eigenvalues may not accurately span the relevant subspaces.
Similar remarks apply to computed left eigenvectors.
The complex analogue of this routine is
F08PXF (ZHSEIN).