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 , corresponding to selected eigenvalues.
The right eigenvector
, and the left eigenvector
, corresponding to an eigenvalue
, are defined by:
Note that even though
is real,
,
and
may be complex. If
is an eigenvector corresponding to a complex eigenvalue
, then the complex conjugate vector
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 ,
,
and for a complex eigenvector,
.
If
has been formed by reduction of a real general matrix
to upper Hessenberg form, then the eigenvectors of
may be transformed to eigenvectors of
by a call to
F08NGF (DORMHR).
- 1: JOB – CHARACTER(1)Input
On entry: indicates whether left and/or right eigenvectors are to be computed.
- Only right eigenvectors are computed.
- Only left eigenvectors are computed.
- Both left and right eigenvectors are computed.
Constraint:
, or .
- 2: EIGSRC – CHARACTER(1)Input
On entry: indicates whether the eigenvalues of
(stored in
WR and
WI) were found using
F08PEF (DHSEQR).
- The eigenvalues of were found using F08PEF (DHSEQR); thus if has any zero subdiagonal elements (and so is block triangular), then the th eigenvalue can be assumed to be an eigenvalue of the block containing the th row/column. This property allows the routine to perform inverse iteration on just one diagonal block.
- No such assumption is made and the routine performs inverse iteration using the whole matrix.
Constraint:
or .
- 3: INITV – CHARACTER(1)Input
On entry: indicates whether you are supplying initial estimates for the selected eigenvectors.
- No initial estimates are supplied.
- Initial estimates are supplied in VL and/or VR.
Constraint:
or .
- 4: SELECT() – LOGICAL arrayInput/Output
-
Note: the dimension of the array
SELECT
must be at least
.
On entry: specifies which eigenvectors are to be computed. To obtain the real eigenvector corresponding to the real eigenvalue , must be set .TRUE.. To select the complex eigenvector corresponding to the complex eigenvalue with complex conjugate (), and/or 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 is set to .TRUE. and to .FALSE..
- 5: N – INTEGERInput
On entry: , the order of the matrix .
Constraint:
.
- 6: H(LDH,) – REAL (KIND=nag_wp) arrayInput
-
Note: the second dimension of the array
H
must be at least
.
On entry: the by upper Hessenberg matrix .
- 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:
.
- 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
.
On entry: the real and imaginary parts, respectively, of the eigenvalues of the matrix
. Complex conjugate pairs of values must be stored in consecutive elements of the arrays. If
, 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
if
or
and at least
if
.
On entry: if
and
or
,
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
,
VL need not be set.
On exit: if
or
,
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
,
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 or , ;
- if , .
- 12: VR(LDVR,) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
VR
must be at least
if
or
and at least
if
.
On entry: if
and
or
,
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
,
VR need not be set.
On exit: if
or
,
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
,
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 or , ;
- if , .
- 14: MM – INTEGERInput
On entry: the number of columns in the arrays
VL and/or
VR . The actual number of columns required,
, is obtained by counting
for each selected real eigenvector and
for each selected complex eigenvector (see
SELECT);
.
Constraint:
.
- 15: M – INTEGEROutput
On exit:
, the number of columns of
VL and/or
VR required to store the selected eigenvectors.
- 16: WORK() – REAL (KIND=nag_wp) arrayWorkspace
- 17: IFAILL() – INTEGER arrayOutput
-
Note: the dimension of the array
IFAILL
must be at least
if
or
and at least
if
.
On exit: if
or
, then
if the selected left eigenvector converged and
if the eigenvector stored in the
th column of
VL (corresponding to the
th eigenvalue as held in
failed to converge. If the
th and
th columns of
VL contain a selected complex eigenvector, then
and
are set to the same value.
If
,
IFAILL is not referenced.
- 18: IFAILR() – INTEGER arrayOutput
-
Note: the dimension of the array
IFAILR
must be at least
if
or
and at least
if
.
On exit: if
or
, then
if the selected right eigenvector converged and
if the eigenvector stored in the
th row or column of
VR (corresponding to the
th eigenvalue as held in
) failed to converge. If the
th and
th rows or columns of
VR contain a selected complex eigenvector, then
and
are set to the same value.
If
,
IFAILR is not referenced.
- 19: INFO – INTEGEROutput
On exit:
unless the routine detects an error (see
Section 6).
Each computed right eigenvector
is the exact eigenvector of a nearby matrix
, such that
. 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).