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_lapack_zhsein (f08px)

Purpose

nag_lapack_zhsein (f08px) computes selected left and/or right eigenvectors of a complex upper Hessenberg matrix corresponding to specified eigenvalues, by inverse iteration.

Syntax

[w, vl, vr, m, ifaill, ifailr, info] = f08px(job, eigsrc, initv, select, h, w, vl, vr, mm, 'n', n)
[w, vl, vr, m, ifaill, ifailr, info] = nag_lapack_zhsein(job, eigsrc, initv, select, h, w, vl, vr, mm, 'n', n)

Description

nag_lapack_zhsein (f08px) computes left and/or right eigenvectors of a complex upper Hessenberg matrix HH, corresponding to selected eigenvalues.
The right eigenvector xx, and the left eigenvector yy, corresponding to an eigenvalue λλ, are defined by:
Hx = λx   and   yHH = λyH (  or HHy = λy) .
Hx = λx   and   yHH = λyH (   or  HHy = λ-y ) .
The eigenvectors are computed by inverse iteration. They are scaled so that max  |Re(xi)| + |Imxi| = 1 max | Re(xi) | +| Imxi | = 1 .
If HH has been formed by reduction of a complex general matrix AA to upper Hessenberg form, then the eigenvectors of HH may be transformed to eigenvectors of AA by a call to nag_lapack_zunmhr (f08nu).

References

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

Parameters

Compulsory Input Parameters

1:     job – string (length ≥ 1)
Indicates whether left and/or right eigenvectors are to be computed.
job = 'R'job='R'
Only right eigenvectors are computed.
job = 'L'job='L'
Only left eigenvectors are computed.
job = 'B'job='B'
Both left and right eigenvectors are computed.
Constraint: job = 'R'job='R', 'L''L' or 'B''B'.
2:     eigsrc – string (length ≥ 1)
Indicates whether the eigenvalues of HH (stored in w) were found using nag_lapack_zhseqr (f08ps).
eigsrc = 'Q'eigsrc='Q'
The eigenvalues of HH were found using nag_lapack_zhseqr (f08ps); thus if HH has any zero subdiagonal elements (and so is block triangular), then the jjth eigenvalue can be assumed to be an eigenvalue of the block containing the jjth row/column. This property allows the function to perform inverse iteration on just one diagonal block.
eigsrc = 'N'eigsrc='N'
No such assumption is made and the function performs inverse iteration using the whole matrix.
Constraint: eigsrc = 'Q'eigsrc='Q' or 'N''N'.
3:     initv – string (length ≥ 1)
Indicates whether you are supplying initial estimates for the selected eigenvectors.
initv = 'N'initv='N'
No initial estimates are supplied.
initv = 'U'initv='U'
Initial estimates are supplied in vl and/or vr.
Constraint: initv = 'N'initv='N' or 'U''U'.
4:     select( : :) – logical array
Note: the dimension of the array select must be at least max (1,n)max(1,n).
Specifies which eigenvectors are to be computed. To select the eigenvector corresponding to the eigenvalue w(j)wj, select(j)selectj must be set to true.
5:     h(ldh, : :) – complex array
The first dimension of the array h 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 upper Hessenberg matrix HH.
6:     w( : :) – complex array
Note: the dimension of the array w must be at least max (1,n)max(1,n).
The eigenvalues of the matrix HH. If eigsrc = 'Q'eigsrc='Q', the array must be exactly as returned by nag_lapack_zhseqr (f08ps).
7:     vl(ldvl, : :) – complex array
The first dimension, ldvl, of the array vl must satisfy
  • if job = 'L'job='L' or 'B''B', ldvl max (1,n) ldvl max(1,n) ;
  • if job = 'R'job='R', ldvl1ldvl1.
The second dimension of the array must be at least max (1,mm)max(1,mm) if job = 'L'job='L' or 'B''B' and at least 11 if job = 'R'job='R'
If initv = 'U'initv='U' and job = 'L'job='L' or 'B''B', vl must contain starting vectors for inverse iteration for the left eigenvectors. Each starting vector must be stored in the same column as will be used to store the corresponding eigenvector (see below).
If initv = 'N'initv='N', vl need not be set.
8:     vr(ldvr, : :) – complex array
The first dimension, ldvr, of the array vr must satisfy
  • if job = 'R'job='R' or 'B''B', ldvr max (1,n) ldvr max(1,n) ;
  • if job = 'L'job='L', ldvr1ldvr1.
The second dimension of the array must be at least max (1,mm)max(1,mm) if job = 'R'job='R' or 'B''B' and at least 11 if job = 'L'job='L'
If initv = 'U'initv='U' and job = 'R'job='R' or 'B''B', vr must contain starting vectors for inverse iteration for the right eigenvectors. Each starting vector must be stored in the same column as will be used to store the corresponding eigenvector (see below).
If initv = 'N'initv='N', vr need not be set.
9:     mm – int64int32nag_int scalar
The number of columns in the arrays vl and/or vr . The actual number of columns required, mm, is obtained by counting 11 for each selected real eigenvector and 22 for each selected complex eigenvector (see select); 0mn0mn.
Constraint: mmmmmm.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array h and the second dimension of the array h. (An error is raised if these dimensions are not equal.)
nn, the order of the matrix HH.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

ldh ldvl ldvr work rwork

Output Parameters

1:     w( : :) – complex array
Note: the dimension of the array w must be at least max (1,n)max(1,n).
The real parts of some elements of w may be modified, as close eigenvalues are perturbed slightly in searching for independent eigenvectors.
2:     vl(ldvl, : :) – complex array
The first dimension, ldvl, of the array vl will be
  • if job = 'L'job='L' or 'B''B', ldvl max (1,n) ldvl max(1,n) ;
  • if job = 'R'job='R', ldvl1ldvl1.
The second dimension of the array will be max (1,mm)max(1,mm) if job = 'L'job='L' or 'B''B' and at least 11 if job = 'R'job='R'
If job = 'L'job='L' or 'B''B', vl contains the computed left eigenvectors (as specified by select). The eigenvectors are stored consecutively in the columns of the array, in the same order as their eigenvalues.
If job = 'R'job='R', vl is not referenced.
3:     vr(ldvr, : :) – complex array
The first dimension, ldvr, of the array vr will be
  • if job = 'R'job='R' or 'B''B', ldvr max (1,n) ldvr max(1,n) ;
  • if job = 'L'job='L', ldvr1ldvr1.
The second dimension of the array will be max (1,mm)max(1,mm) if job = 'R'job='R' or 'B''B' and at least 11 if job = 'L'job='L'
If job = 'R'job='R' or 'B''B', vr contains the computed right eigenvectors (as specified by select). The eigenvectors are stored consecutively in the columns of the array, in the same order as their eigenvalues.
If job = 'L'job='L', vr is not referenced.
4:     m – int64int32nag_int scalar
mm, the number of selected eigenvectors.
5:     ifaill( : :) – int64int32nag_int array
Note: the dimension of the array ifaill must be at least max (1,mm)max(1,mm) if job = 'L'job='L' or 'B''B' and at least 11 if job = 'R'job='R'.
If job = 'L'job='L' or 'B''B', then ifaill(i) = 0ifailli=0 if the selected left eigenvector converged and ifaill(i) = j > 0ifailli=j>0 if the eigenvector stored in the iith row or column of vl (corresponding to the jjth eigenvalue) failed to converge.
If job = 'R'job='R', ifaill is not referenced.
6:     ifailr( : :) – int64int32nag_int array
Note: the dimension of the array ifailr must be at least max (1,mm)max(1,mm) if job = 'R'job='R' or 'B''B' and at least 11 if job = 'L'job='L'.
If job = 'R'job='R' or 'B''B', then ifailr(i) = 0ifailri=0 if the selected right eigenvector converged and ifailr(i) = j > 0ifailri=j>0 if the eigenvector stored in the iith column of vr (corresponding to the jjth eigenvalue) failed to converge.
If job = 'L'job='L', ifailr is not referenced.
7:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: job, 2: eigsrc, 3: initv, 4: select, 5: n, 6: h, 7: ldh, 8: w, 9: vl, 10: ldvl, 11: vr, 12: ldvr, 13: mm, 14: m, 15: work, 16: rwork, 17: ifaill, 18: ifailr, 19: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
  INFO > 0INFO>0
If info = iinfo=i, then ii eigenvectors (as indicated by the parameters ifaill and/or ifailr above) failed to converge. The corresponding columns of vl and/or vr contain no useful information.

Accuracy

Each computed right eigenvector xixi is the exact eigenvector of a nearby matrix A + EiA+Ei, such that Ei = O(ε)AEi=O(ε)A. Hence the residual is small:
Axiλixi = O(ε) A .
Axi - λixi = O(ε) A .
However, eigenvectors corresponding to close or coincident eigenvalues may not accurately span the relevant subspaces.
Similar remarks apply to computed left eigenvectors.

Further Comments

The real analogue of this function is nag_lapack_dhsein (f08pk).

Example

function nag_lapack_zhsein_example
job = 'Right';
eigsrc = 'QR';
initv = 'No initial vectors';
select = [true;
     true;
     false;
     false];
h = [ -3.97 - 5.04i,  -1.131805187339771 - 2.56930489882744i, ...
      -4.602742437533554 - 0.142631904083292i,  -1.424912289366528 + 1.732983703342187i;
      -5.479653273702635 + 0i,  1.858472820765587 - 1.55018070644029i, ...
      4.414465526917012 - 0.7638237115550983i,  -0.4805261336990153 - 1.197599997332747i;
      0.6932222118146283 - 0.4828752762602551i, ...
      6.267276818064224 + 0i,  -0.4503809403345012 - 0.02898183259817966i,  ...
      -1.346684450078734 + 1.65792489538873i;
      -0.2112946907920694 + 0.0864412259893682i, ...
      0.1242146188766495 - 0.2289276049796828i,  -3.499985837393258 + 0i,  ...
      2.561908119568915 - 3.370837460961531i];
w = [ -6.000425342949246 - 6.999843371570391i;
      -5.000033457596968 + 2.006027162316515i;
      7.998194516208248 - 0.9963650913929011i;
      3.002264284337973 - 3.999818699353226i];
vl = complex([ 0]);
vr = complex([ 0,  0,  0,  0;
               0,  0,  0,  0;
               0,  0,  0,  0;
               0,  0,  0,  0]);
mm = int64(4);
[wOut, vlOut, vrOut, m, ifaill, ifailr, info] = ...
    nag_lapack_zhsein(job, eigsrc, initv, select, h, w, vl, vr, mm)
 

wOut =

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


vlOut =

   0.0000 + 0.0000i


vrOut =

   0.3815 - 0.6185i  -0.2691 - 0.5053i   0.0000 + 0.0000i   0.0000 + 0.0000i
  -0.1142 - 0.3555i   0.5760 - 0.2995i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.2385 + 0.0716i  -0.9708 + 0.0292i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0932 - 0.0102i  -0.3048 - 0.2032i   0.0000 + 0.0000i   0.0000 + 0.0000i


m =

                    2


ifaill =

                    0


ifailr =

                    0
                    0
                    0
                    0


info =

                    0


function f08px_example
job = 'Right';
eigsrc = 'QR';
initv = 'No initial vectors';
select = [true;
     true;
     false;
     false];
h = [ -3.97 - 5.04i,  -1.131805187339771 - 2.56930489882744i, ...
      -4.602742437533554 - 0.142631904083292i,  -1.424912289366528 + 1.732983703342187i;
      -5.479653273702635 + 0i,  1.858472820765587 - 1.55018070644029i, ...
      4.414465526917012 - 0.7638237115550983i,  -0.4805261336990153 - 1.197599997332747i;
      0.6932222118146283 - 0.4828752762602551i, ...
      6.267276818064224 + 0i,  -0.4503809403345012 - 0.02898183259817966i,  ...
      -1.346684450078734 + 1.65792489538873i;
      -0.2112946907920694 + 0.0864412259893682i, ...
      0.1242146188766495 - 0.2289276049796828i,  -3.499985837393258 + 0i,  ...
      2.561908119568915 - 3.370837460961531i];
w = [ -6.000425342949246 - 6.999843371570391i;
      -5.000033457596968 + 2.006027162316515i;
      7.998194516208248 - 0.9963650913929011i;
      3.002264284337973 - 3.999818699353226i];
vl = complex([ 0]);
vr = complex([ 0,  0,  0,  0;
               0,  0,  0,  0;
               0,  0,  0,  0;
               0,  0,  0,  0]);
mm = int64(4);
[wOut, vlOut, vrOut, m, ifaill, ifailr, info] = ...
    f08px(job, eigsrc, initv, select, h, w, vl, vr, mm)
 

wOut =

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


vlOut =

   0.0000 + 0.0000i


vrOut =

   0.3815 - 0.6185i  -0.2691 - 0.5053i   0.0000 + 0.0000i   0.0000 + 0.0000i
  -0.1142 - 0.3555i   0.5760 - 0.2995i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.2385 + 0.0716i  -0.9708 + 0.0292i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0932 - 0.0102i  -0.3048 - 0.2032i   0.0000 + 0.0000i   0.0000 + 0.0000i


m =

                    2


ifaill =

                    0


ifailr =

                    0
                    0
                    0
                    0


info =

                    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