NAG Library Function Document
nag_complex_eigensystem_sel (f02gcc)
1 Purpose
nag_complex_eigensystem_sel (f02gcc) computes selected eigenvalues and eigenvectors of a complex general matrix.
2 Specification
#include <nag.h> |
#include <nagf02.h> |
void |
nag_complex_eigensystem_sel (Nag_Select_Eigenvalues crit,
Integer n,
Complex a[],
Integer tda,
double wl,
double wu,
Integer mest,
Integer *m,
Complex w[],
Complex v[],
Integer tdv,
NagError *fail) |
|
3 Description
nag_complex_eigensystem_sel (f02gcc) 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 Arguments
- 1:
– Nag_Select_EigenvaluesInput
-
On entry: indicates the criterion for selecting eigenvalues:
- if , then eigenvalues are selected according to their moduli: .
- if , then eigenvalues are selected according to their real parts: .
Constraint:
or .
- 2:
– IntegerInput
-
On entry: , the order of the matrix .
Constraint:
.
- 3:
– ComplexInput/Output
-
Note: the th element of the matrix is stored in .
On entry: the by general matrix .
On exit:
a contains the Hessenberg form of the balanced input matrix
(see
Section 9).
- 4:
– IntegerInput
-
On entry: the stride separating matrix column elements in the array
a.
Constraint:
.
- 5:
– doubleInput
- 6:
– doubleInput
-
On entry: and , the lower and upper bounds on the criterion for the selected eigenvalues.
Constraint:
.
- 7:
– IntegerInput
-
On entry:
mest must be an upper bound on
, the number of eigenvalues and eigenvectors selected. No eigenvectors are computed if
.
Constraint:
.
- 8:
– Integer *Output
-
On exit: , the number of eigenvalues actually selected.
- 9:
– ComplexOutput
-
On exit: the first
m elements of
w hold the selected eigenvalues; elements from the index
m to
contain the other eigenvalues.
- 10:
– ComplexOutput
-
Note: the th element of the matrix is stored in .
On exit:
v contains the selected eigenvectors, with the
th column holding the eigenvector associated with the eigenvalue
(stored in
).
- 11:
– IntegerInput
-
On entry: the stride separating matrix column elements in the array
v.
Constraint:
.
- 12:
– NagError *Input/Output
-
The NAG error argument (see
Section 2.7 in How to Use the NAG Library and its Documentation).
6 Error Indicators and Warnings
- NE_2_INT_ARG_LT
-
On entry, while . These arguments must satisfy .
- NE_2_REAL_ARG_LE
-
On entry, while . These arguments must satisfy .
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
- NE_BAD_PARAM
-
On entry, argument
crit had an illegal value.
- NE_EIGVEC
-
Inverse iteration failed to compute all the specified eigenvectors. If an eigenvector failed to converge, the corresponding column of
v is set to zero.
- NE_INT_2
-
On entry, while .
Constraint: .
- NE_INT_ARG_LT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_QR_FAIL
-
The QR algorithm failed to compute all the eigenvalues. No eigenvectors have been computed.
- NE_REQD_EIGVAL
-
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 .
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
, 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
.
8 Parallelism and Performance
nag_complex_eigensystem_sel (f02gcc) is not threaded in any implementation.
nag_complex_eigensystem_sel (f02gcc) 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 function 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 function 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 nag_complex_eigensystem_sel (f02gcc).
The time taken by the function is approximately proportional to .
The function can be used to compute
all eigenvalues and eigenvectors, by setting
wl large and negative, and
wu large and positive.
10 Example
To compute those eigenvalues of the matrix
whose moduli lie in the range
, and their corresponding eigenvectors, where
10.1 Program Text
Program Text (f02gcce.c)
10.2 Program Data
Program Data (f02gcce.d)
10.3 Program Results
Program Results (f02gcce.r)