PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_eigen_complex_gen_eigsys (f02gc)
Purpose
nag_eigen_complex_gen_eigsys (f02gc) computes selected eigenvalues and eigenvectors of a complex general matrix.
Syntax
[
a,
m,
w,
v,
ifail] = f02gc(
crit,
a,
wl,
wu,
mest, 'n',
n)
[
a,
m,
w,
v,
ifail] = nag_eigen_complex_gen_eigsys(
crit,
a,
wl,
wu,
mest, 'n',
n)
Description
nag_eigen_complex_gen_eigsys (f02gc) 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
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Indicates the criterion for selecting eigenvalues.
- Eigenvalues are selected according to their moduli: .
- Eigenvalues are selected according to their real parts: .
Constraint:
or .
- 2:
– complex array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
The by general matrix .
- 3:
– double scalar
- 4:
– double scalar
-
and
, the lower and upper bounds on the criterion for the selected eigenvalues (see
crit).
Constraint:
.
- 5:
– int64int32nag_int scalar
-
The second dimension of the array
v.
mest must be an upper bound on
, the number of eigenvalues and eigenvectors selected. No eigenvectors are computed if
.
Constraint:
.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
a and the second dimension of the array
a.
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
Contains the Hessenberg form of the balanced input matrix
(see
Further Comments).
- 2:
– int64int32nag_int scalar
-
, the number of eigenvalues actually selected.
- 3:
– complex array
-
The first
m elements of
w hold the selected eigenvalues; elements
to
n contain the other eigenvalues.
- 4:
– complex array
-
Contains the selected eigenvectors, with the th column holding the eigenvector associated with the eigenvalue (stored in ).
- 5:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Errors or warnings detected by the function:
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
-
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
.
- W
-
Inverse iteration failed to compute all the specified eigenvectors. If an eigenvector failed to converge, the corresponding column of
v is set to zero.
-
An unexpected error has been triggered by this routine. Please
contact
NAG.
-
Your licence key may have expired or may not have been installed correctly.
-
Dynamic memory allocation failed.
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
Further Comments), 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
nag_lapack_zhseqr (f08ps) with
to compute the Schur form of
, followed by
nag_lapack_ztrsna (f08qy).
Further Comments
nag_eigen_complex_gen_eigsys (f02gc) calls functions 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 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.
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_eigen_complex_gen_eigsys (f02gc).
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.
Example
This example computes those eigenvalues of the matrix
which lie in the range
, and their corresponding eigenvectors, where
Open in the MATLAB editor:
f02gc_example
function f02gc_example
fprintf('f02gc example results\n\n');
a = [ -3.97 - 5.04i, -4.11 + 3.70i, -0.34 + 1.01i, 1.29 - 0.86i;
0.34 - 1.50i, 1.52 - 0.43i, 1.88 - 5.38i, 3.36 + 0.65i;
3.31 - 3.85i, 2.50 + 3.45i, 0.88 - 1.08i, 0.64 - 1.48i;
-1.10 + 0.82i, 1.81 - 1.59i, 3.25 + 1.33i, 1.57 - 3.44i];
crit = 'Moduli';
wl = 0.0;
wu = 5.5;
mest = int64(3);
[a, m, w, v, ifail] = f02gc( ...
crit, a, wl, wu, mest);
evals = w(1:m)';
disp('Eigenvalues');
disp(evals);
evecs = v(:,1:m);
disp('Eigenvectors');
disp(evecs);
f02gc example results
Eigenvalues
-5.0000 - 2.0060i 3.0023 + 3.9998i
Eigenvectors
-0.3865 + 0.1732i -0.0356 - 0.1782i
-0.3539 + 0.4529i 0.1264 + 0.2666i
0.6124 + 0.0000i 0.0129 - 0.2966i
-0.0859 - 0.3284i 0.8898 + 0.0000i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015