NAG CL Interface
f02ecc (real_gen_eigsys)
1
Purpose
f02ecc computes selected eigenvalues and eigenvectors of a real general matrix.
2
Specification
void |
f02ecc (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) |
|
The function may be called by the names: f02ecc, nag_eigen_real_gen_eigsys or nag_real_eigensystem_sel.
3
Description
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_Eigenvalues
Input
-
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:
– Integer
Input
-
On entry: , the order of the matrix .
Constraint:
.
-
3:
– double
Input/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:
– Integer
Input
-
On entry: the stride separating matrix column elements in the array
a.
Constraint:
.
-
5:
– double
Input
-
6:
– double
Input
-
On entry: and , the lower and upper bounds on the criterion for the selected eigenvalues.
Constraint:
.
-
7:
– Integer
Input
-
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:
– Complex
Output
-
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:
– Complex
Output
-
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:
– Integer
Input
-
On entry: the stride separating matrix column elements in the array
v.
Constraint:
.
-
12:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
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
f02ecc is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
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 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
10.2
Program Data
10.3
Program Results