hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

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 AA:
Axi = λixi.
Axi=λixi.
Eigenvalues λiλi may be selected either by modulus, satisfying
wl|λi|wu,
wl|λi|wu,
or by real part, satisfying
wlRe(λi)wu.
wlRe(λi)wu.

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     crit – string (length ≥ 1)
Indicates the criterion for selecting eigenvalues.
crit = 'M'crit='M'
Eigenvalues are selected according to their moduli: wl|λi|wuwl|λi|wu.
crit = 'R'crit='R'
Eigenvalues are selected according to their real parts: wlRe(λi)wuwlRe(λi)wu.
Constraint: crit = 'M'crit='M' or 'R''R'.
2:     a(lda, : :) – complex array
The first dimension of the array a must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
The nn by nn general matrix AA.
3:     wl – double scalar
4:     wu – double scalar
wlwl and wuwu, the lower and upper bounds on the criterion for the selected eigenvalues (see crit).
Constraint: wu > wlwu>wl.
5:     mest – int64int32nag_int scalar
The second dimension of the array v as declared in the (sub)program from which nag_eigen_complex_gen_eigsys (f02gc) is called. mest must be an upper bound on mm, the number of eigenvalues and eigenvectors selected. No eigenvectors are computed if mest < mmest<m.
Constraint: mestmax (1,m)mestmax(1,m).

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a The second dimension of the array a.
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda ldv work lwork rwork iwork bwork

Output Parameters

1:     a(lda, : :) – complex array
The first dimension of the array a will be max (1,n)max(1,n)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,n)ldamax(1,n).
Contains the Hessenberg form of the balanced input matrix AA (see Section [Further Comments]).
2:     m – int64int32nag_int scalar
mm, the number of eigenvalues actually selected.
3:     w(n) – complex array
The first m elements of w hold the selected eigenvalues; elements m + 1m+1 to n contain the other eigenvalues.
4:     v(ldv,mest) – complex array
ldvmax (1,n)ldvmax(1,n).
Contains the selected eigenvectors, with the iith column holding the eigenvector associated with the eigenvalue λiλi (stored in w(i)wi).
5:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 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.

  ifail = 1ifail=1
On entry,crit'M'crit'M' or 'R''R',
orn < 0n<0,
orlda < max (1,n)lda<max(1,n),
orwuwlwuwl,
ormest < 1mest<1,
orldv < max (1,n)ldv<max(1,n),
orlwork < max (1,n × (n + 2))lwork<max(1,n×(n+2)).
  ifail = 2ifail=2
The QRQR algorithm failed to compute all the eigenvalues. No eigenvectors have been computed.
  ifail = 3ifail=3
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 v = mestmv=mestm.
W ifail = 4ifail=4
Inverse iteration failed to compute all the specified eigenvectors. If an eigenvector failed to converge, the corresponding column of v is set to zero.

Accuracy

If λiλi is an exact eigenvalue, and λ̃iλ~i is the corresponding computed value, then
|λ̃iλi| (c(n)εA2)/(si),
| λ~i - λi | c(n)εA2si,
where c(n)c(n) is a modestly increasing function of nn, εε is the machine precision, and sisi is the reciprocal condition number of λiλi; AA is the balanced form of the original matrix AA (see Section [Further Comments]), and AAAA.
If xixi is the corresponding exact eigenvector, and ix~i is the corresponding computed eigenvector, then the angle θ(i,xi)θ(x~i,xi) between them is bounded as follows:
θ(i,xi)(c(n)εA2)/(sepi)
θ(x~i,xi)c(n)εA2sepi
where sepisepi is the reciprocal condition number of xixi.
The condition numbers sisi and sepisepi may be computed from the Hessenberg form of the balanced matrix AA which is returned in the array a. This requires calling nag_lapack_zhseqr (f08ps) with job = 'S'job='S' to compute the Schur form of AA, 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 AA to upper Hessenberg form HH, using a unitary similarity transformation: A = QHQHA=QHQH. The function uses the Hessenberg QRQR algorithm to compute all the eigenvalues of HH, which are the same as the eigenvalues of AA. It computes the eigenvectors of HH which correspond to the selected eigenvalues, using inverse iteration. It premultiplies the eigenvectors by QQ to form the eigenvectors of AA; and finally transforms the eigenvectors to those of the original matrix AA.
Each eigenvector xx is normalized so that x2 = 1x2=1, 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_eigen_complex_gen_eigsys (f02gc).
The time taken by the function is approximately proportional to n3n3.
The function can be used to compute all eigenvalues and eigenvectors, by setting wl large and negative, and wu large and positive.

Example

function nag_eigen_complex_gen_eigsys_example
crit = 'Moduli';
a = [ -3.97 - 5.04i,  -4.11 + 3.7i,  -0.34 + 1.01i,  1.29 - 0.86i;
      0.34 - 1.5i,  1.52 - 0.43i,  1.88 - 5.38i,  3.36 + 0.65i;
      3.31 - 3.85i,  2.5 + 3.45i,  0.88 - 1.08i,  0.64 - 1.48i;
      -1.1 + 0.82i,  1.81 - 1.59i,  3.25 + 1.33i,  1.57 - 3.44i];
wl = -5.5;
wu = 5.5;
mest = int64(3);
[aOut, m, w, v, ifail] = nag_eigen_complex_gen_eigsys(crit, a, wl, wu, mest)
 

aOut =

  -3.9700 - 5.0400i  -1.1318 - 2.5693i  -4.6027 - 0.1426i  -1.4249 + 1.7330i
  -5.4797 + 0.0000i   1.8585 - 1.5502i   4.4145 - 0.7638i  -0.4805 - 1.1976i
   0.6932 - 0.4829i   6.2673 + 0.0000i  -0.4504 - 0.0290i  -1.3467 + 1.6579i
  -0.2113 + 0.0864i   0.1242 - 0.2289i  -3.5000 + 0.0000i   2.5619 - 3.3708i


m =

                    2


w =

  -5.0000 + 2.0060i
   3.0023 - 3.9998i
   7.9982 - 0.9964i
  -6.0004 - 6.9998i


v =

  -0.3865 + 0.1732i  -0.0356 - 0.1782i   0.0000 + 0.0000i
  -0.3539 + 0.4529i   0.1264 + 0.2666i   0.0000 + 0.0000i
   0.6124 + 0.0000i   0.0129 - 0.2966i   0.0000 + 0.0000i
  -0.0859 - 0.3284i   0.8898 + 0.0000i   0.0000 + 0.0000i


ifail =

                    0


function f02gc_example
crit = 'Moduli';
a = [ -3.97 - 5.04i,  -4.11 + 3.7i,  -0.34 + 1.01i,  1.29 - 0.86i;
      0.34 - 1.5i,  1.52 - 0.43i,  1.88 - 5.38i,  3.36 + 0.65i;
      3.31 - 3.85i,  2.5 + 3.45i,  0.88 - 1.08i,  0.64 - 1.48i;
      -1.1 + 0.82i,  1.81 - 1.59i,  3.25 + 1.33i,  1.57 - 3.44i];
wl = -5.5;
wu = 5.5;
mest = int64(3);
[aOut, m, w, v, ifail] = f02gc(crit, a, wl, wu, mest)
 

aOut =

  -3.9700 - 5.0400i  -1.1318 - 2.5693i  -4.6027 - 0.1426i  -1.4249 + 1.7330i
  -5.4797 + 0.0000i   1.8585 - 1.5502i   4.4145 - 0.7638i  -0.4805 - 1.1976i
   0.6932 - 0.4829i   6.2673 + 0.0000i  -0.4504 - 0.0290i  -1.3467 + 1.6579i
  -0.2113 + 0.0864i   0.1242 - 0.2289i  -3.5000 + 0.0000i   2.5619 - 3.3708i


m =

                    2


w =

  -5.0000 + 2.0060i
   3.0023 - 3.9998i
   7.9982 - 0.9964i
  -6.0004 - 6.9998i


v =

  -0.3865 + 0.1732i  -0.0356 - 0.1782i   0.0000 + 0.0000i
  -0.3539 + 0.4529i   0.1264 + 0.2666i   0.0000 + 0.0000i
   0.6124 + 0.0000i   0.0129 - 0.2966i   0.0000 + 0.0000i
  -0.0859 - 0.3284i   0.8898 + 0.0000i   0.0000 + 0.0000i


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013