NAG C Library Function Document
nag_real_eigensystem_sel (f02ecc)
1
Purpose
nag_real_eigensystem_sel (f02ecc) computes selected eigenvalues and eigenvectors of a real general matrix.
2
Specification
#include <nag.h> |
#include <nagf02.h> |
void |
nag_real_eigensystem_sel (Nag_Select_Eigenvalues crit,
Integer n,
double a[],
Integer tda,
double wl,
double wu,
Integer mest,
Integer *m,
Complex w[],
Complex v[],
Integer tdv,
NagError *fail) |
|
3
Description
nag_real_eigensystem_sel (f02ecc) computes selected eigenvalues and the corresponding right eigenvectors of a real general matrix
:
Eigenvalues
may be selected either by
modulus, satisfying:
or by
real part, satisfying:
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 eigenvalues in a complex conjugate pair
and
are either both selected or both not selected.
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:
– doubleInput/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 values of the selected eigenvalues; elements from the index
m to
contain the other eigenvalues. Complex conjugate pairs of eigenvalues are stored in consecutive elements of the array, with the eigenvalue having the positive imaginary part first.
- 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 3.7 in How to Use the NAG Library and its Documentation).
6
Error Indicators and Warnings
- 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: .
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_real_eigensystem_sel (f02ecc) is not threaded in any implementation.
nag_real_eigensystem_sel (f02ecc) first balances the matrix, using a diagonal similarity transformation to reduce its norm; and then reduces the balanced matrix to upper Hessenberg form , using an orthogonal 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 (real or complex) 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_real_eigensystem_sel (f02ecc).
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 (f02ecce.c)
10.2
Program Data
Program Data (f02ecce.d)
10.3
Program Results
Program Results (f02ecce.r)