NAG Library Routine Document
F02GCF
1 Purpose
F02GCF computes selected eigenvalues and eigenvectors of a complex general matrix.
2 Specification
SUBROUTINE F02GCF ( |
CRIT, N, A, LDA, WL, WU, MEST, M, W, V, LDV, WORK, LWORK, RWORK, IWORK, BWORK, IFAIL) |
INTEGER |
N, LDA, MEST, M, LDV, LWORK, IWORK(N), IFAIL |
REAL (KIND=nag_wp) |
WL, WU, RWORK(2*N) |
COMPLEX (KIND=nag_wp) |
A(LDA,*), W(N), V(LDV,MEST), WORK(LWORK) |
LOGICAL |
BWORK(N) |
CHARACTER(1) |
CRIT |
|
3 Description
F02GCF computes selected eigenvalues and the corresponding right eigenvectors of a complex general matrix
:
Eigenvalues
may be selected either by
modulus, satisfying
or by
real part, satisfying
4 References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5 Parameters
- 1: CRIT – CHARACTER(1)Input
On entry: indicates the criterion for selecting eigenvalues.
- Eigenvalues are selected according to their moduli: .
- Eigenvalues are selected according to their real parts: .
Constraint:
or .
- 2: N – INTEGERInput
On entry: , the order of the matrix .
Constraint:
.
- 3: A(LDA,) – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
A
must be at least
.
On entry: the by general matrix .
On exit: contains the Hessenberg form of the balanced input matrix
(see
Section 8).
- 4: LDA – INTEGERInput
On entry: the first dimension of the array
A as declared in the (sub)program from which F02GCF is called.
Constraint:
.
- 5: WL – REAL (KIND=nag_wp)Input
- 6: WU – REAL (KIND=nag_wp)Input
On entry:
and
, the lower and upper bounds on the criterion for the selected eigenvalues (see
CRIT).
Constraint:
.
- 7: MEST – INTEGERInput
On entry: the second dimension of the array
V as declared in the (sub)program from which F02GCF is called.
MEST must be an upper bound on
, the number of eigenvalues and eigenvectors selected. No eigenvectors are computed if
.
Constraint:
.
- 8: M – INTEGEROutput
On exit: , the number of eigenvalues actually selected.
- 9: W(N) – COMPLEX (KIND=nag_wp) arrayOutput
On exit: the first
M elements of
W hold the selected eigenvalues; elements
to
N contain the other eigenvalues.
- 10: V(LDV,MEST) – COMPLEX (KIND=nag_wp) arrayOutput
On exit: contains the selected eigenvectors, with the th column holding the eigenvector associated with the eigenvalue (stored in ).
- 11: LDV – INTEGERInput
On entry: the first dimension of the array
V as declared in the (sub)program from which F02GCF is called.
Constraint:
.
- 12: WORK(LWORK) – COMPLEX (KIND=nag_wp) arrayWorkspace
- 13: LWORK – INTEGERInput
On entry: the dimension of the array
WORK as declared in the (sub)program from which F02GCF is called.
Constraint:
.
- 14: RWORK() – REAL (KIND=nag_wp) arrayWorkspace
- 15: IWORK(N) – INTEGER arrayWorkspace
- 16: BWORK(N) – LOGICAL arrayWorkspace
- 17: IFAIL – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
On entry, | or , |
or | , |
or | , |
or | , |
or | , |
or | , |
or | . |
The algorithm failed to compute all the eigenvalues. No eigenvectors have been computed.
There are more than
MEST eigenvalues in the specified range. The actual number of eigenvalues in the range is returned in
M. No eigenvectors have been computed. Rerun with the second dimension of
.
Inverse iteration failed to compute all the specified eigenvectors. If an eigenvector failed to converge, the corresponding column of
V is set to zero.
7 Accuracy
If
is an exact eigenvalue, and
is the corresponding computed value, then
where
is a modestly increasing function of
,
is the
machine precision, and
is the reciprocal condition number of
;
is the balanced form of the original matrix
(see
Section 8), and
.
If
is the corresponding exact eigenvector, and
is the corresponding computed eigenvector, then the angle
between them is bounded as follows:
where
is the reciprocal condition number of
.
The condition numbers
and
may be computed from the Hessenberg form of the balanced matrix
which is returned in the array
A. This requires calling
F08PSF (ZHSEQR) with
to compute the Schur form of
, followed by
F08QYF (ZTRSNA).
F02GCF calls routines from LAPACK in
Chapter F08. It first balances the matrix, using a diagonal similarity transformation to reduce its norm; and then reduces the balanced matrix
to upper Hessenberg form
, using a unitary similarity transformation:
. The routine uses the Hessenberg
algorithm to compute all the eigenvalues of
, which are the same as the eigenvalues of
. It computes the eigenvectors of
which correspond to the selected eigenvalues, using inverse iteration. It premultiplies the eigenvectors by
to form the eigenvectors of
; and finally transforms the eigenvectors to those of the original matrix
.
Each eigenvector is normalized so that , and the element of largest absolute value is real and positive.
The inverse iteration routine may make a small perturbation to the real parts of close eigenvalues, and this may shift their moduli just outside the specified bounds. If you are relying on eigenvalues being within the bounds, you should test them on return from F02GCF.
The time taken by the routine is approximately proportional to .
The routine can be used to compute
all eigenvalues and eigenvectors, by setting
WL large and negative, and
WU large and positive.
9 Example
This example computes those eigenvalues of the matrix
which lie in the range
, and their corresponding eigenvectors, where
9.1 Program Text
Program Text (f02gcfe.f90)
9.2 Program Data
Program Data (f02gcfe.d)
9.3 Program Results
Program Results (f02gcfe.r)