nag_zhsein (f08pxc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_zhsein (f08pxc)

+ Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

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

2  Specification

#include <nag.h>
#include <nagf08.h>
void  nag_zhsein (Nag_OrderType order, Nag_SideType side, Nag_EigValsSourceType eig_source, Nag_InitVeenumtype initv, const Nag_Boolean select[], Integer n, const Complex h[], Integer pdh, Complex w[], Complex vl[], Integer pdvl, Complex vr[], Integer pdvr, Integer mm, Integer *m, Integer ifaill[], Integer ifailr[], NagError *fail)

3  Description

nag_zhsein (f08pxc) computes left and/or right eigenvectors of a complex upper Hessenberg matrix H, corresponding to selected eigenvalues.
The right eigenvector x, and the left eigenvector y, corresponding to an eigenvalue λ, are defined by:
Hx = λx   and   yHH = λyH   or  HHy = λ-y .
The eigenvectors are computed by inverse iteration. They are scaled so that max Rexi + Imxi = 1 .
If H has been formed by reduction of a complex general matrix A to upper Hessenberg form, then the eigenvectors of H may be transformed to eigenvectors of A by a call to nag_zunmhr (f08nuc).

4  References

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

5  Arguments

1:     orderNag_OrderTypeInput
On entry: the order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by order=Nag_RowMajor. See Section 3.2.1.3 in the Essential Introduction for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2:     sideNag_SideTypeInput
On entry: indicates whether left and/or right eigenvectors are to be computed.
side=Nag_RightSide
Only right eigenvectors are computed.
side=Nag_LeftSide
Only left eigenvectors are computed.
side=Nag_BothSides
Both left and right eigenvectors are computed.
Constraint: side=Nag_RightSide, Nag_LeftSide or Nag_BothSides.
3:     eig_sourceNag_EigValsSourceTypeInput
On entry: indicates whether the eigenvalues of H (stored in w) were found using nag_zhseqr (f08psc).
eig_source=Nag_HSEQRSource
The eigenvalues of H were found using nag_zhseqr (f08psc); thus if H has any zero subdiagonal elements (and so is block triangular), then the jth eigenvalue can be assumed to be an eigenvalue of the block containing the jth row/column. This property allows the function to perform inverse iteration on just one diagonal block.
eig_source=Nag_NotKnown
No such assumption is made and the function performs inverse iteration using the whole matrix.
Constraint: eig_source=Nag_HSEQRSource or Nag_NotKnown.
4:     initvNag_InitVeenumtypeInput
On entry: indicates whether you are supplying initial estimates for the selected eigenvectors.
initv=Nag_NoVec
No initial estimates are supplied.
initv=Nag_UserVec
Initial estimates are supplied in vl and/or vr.
Constraint: initv=Nag_NoVec or Nag_UserVec.
5:     select[dim]const Nag_BooleanInput
Note: the dimension, dim, of the array select must be at least max1,n.
On entry: specifies which eigenvectors are to be computed. To select the eigenvector corresponding to the eigenvalue w[j-1], select[j-1] must be set to Nag_TRUE.
6:     nIntegerInput
On entry: n, the order of the matrix H.
Constraint: n0.
7:     h[dim]const ComplexInput
Note: the dimension, dim, of the array h must be at least max1,pdh×n.
The i,jth element of the matrix H is stored in
  • h[j-1×pdh+i-1] when order=Nag_ColMajor;
  • h[i-1×pdh+j-1] when order=Nag_RowMajor.
On entry: the n by n upper Hessenberg matrix H.
8:     pdhIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array h.
Constraint: pdhmax1,n.
9:     w[dim]ComplexInput/Output
Note: the dimension, dim, of the array w must be at least max1,n.
On entry: the eigenvalues of the matrix H. If eig_source=Nag_HSEQRSource, the array must be exactly as returned by nag_zhseqr (f08psc).
On exit: the real parts of some elements of w may be modified, as close eigenvalues are perturbed slightly in searching for independent eigenvectors.
10:   vl[dim]ComplexInput/Output
Note: the dimension, dim, of the array vl must be at least
  • max1,pdvl×mm when side=Nag_LeftSide or Nag_BothSides and order=Nag_ColMajor;
  • max1,n×pdvl when side=Nag_LeftSide or Nag_BothSides and order=Nag_RowMajor;
  • 1 when side=Nag_RightSide.
The dimension, dim, of the array vl must be at least
  • max1,pdvl×m when side=Nag_LeftSide or Nag_BothSides and order=Nag_ColMajor;
  • max1,n×pdvl when side=Nag_LeftSide or Nag_BothSides and order=Nag_RowMajor;
  • 1 when side=Nag_RightSide.
The i,jth element of the matrix is stored in
  • vl[j-1×pdvl+i-1] when order=Nag_ColMajor;
  • vl[i-1×pdvl+j-1] when order=Nag_RowMajor.
On entry: if initv=Nag_UserVec and side=Nag_LeftSide or Nag_BothSides, vl must contain starting vectors for inverse iteration for the left eigenvectors. Each starting vector must be stored in the same row or column as will be used to store the corresponding eigenvector (see below).
If initv=Nag_NoVec, vl need not be set.
On exit: if side=Nag_LeftSide or Nag_BothSides, vl contains the computed left eigenvectors (as specified by select). The eigenvectors are stored consecutively in the rows or columns of the array (depending on the value of order), in the same order as their eigenvalues.
If side=Nag_RightSide, vl is not referenced.
11:   pdvlIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array vl.
Constraints:
  • if order=Nag_ColMajor,
    • if side=Nag_LeftSide or Nag_BothSides, pdvln;
    • if side=Nag_RightSide, pdvl1;
  • if order=Nag_RowMajor,
    • if side=Nag_LeftSide or Nag_BothSides, pdvlmax1,mm;
    • if side=Nag_RightSide, pdvl1.
    • if side=Nag_LeftSide or Nag_BothSides, pdvlmax1,m;
    • if side=Nag_RightSide, pdvl1.
12:   vr[dim]ComplexInput/Output
Note: the dimension, dim, of the array vr must be at least
  • max1,pdvr×mm when side=Nag_RightSide or Nag_BothSides and order=Nag_ColMajor;
  • max1,n×pdvr when side=Nag_RightSide or Nag_BothSides and order=Nag_RowMajor;
  • 1 when side=Nag_LeftSide.
The dimension, dim, of the array vr must be at least
  • max1,pdvr×m when side=Nag_RightSide or Nag_BothSides and order=Nag_ColMajor;
  • max1,n×pdvr when side=Nag_RightSide or Nag_BothSides and order=Nag_RowMajor;
  • 1 when side=Nag_LeftSide.
The i,jth element of the matrix is stored in
  • vr[j-1×pdvr+i-1] when order=Nag_ColMajor;
  • vr[i-1×pdvr+j-1] when order=Nag_RowMajor.
On entry: if initv=Nag_UserVec and side=Nag_RightSide or Nag_BothSides, vr must contain starting vectors for inverse iteration for the right eigenvectors. Each starting vector must be stored in the same row or column as will be used to store the corresponding eigenvector (see below).
If initv=Nag_NoVec, vr need not be set.
On exit: if side=Nag_RightSide or Nag_BothSides, vr contains the computed right eigenvectors (as specified by select). The eigenvectors are stored consecutively in the rows or columns of the array (depending on the value of order), in the same order as their eigenvalues.
If side=Nag_LeftSide, vr is not referenced.
13:   pdvrIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array vr.
Constraints:
  • if order=Nag_ColMajor,
    • if side=Nag_RightSide or Nag_BothSides, pdvrn;
    • if side=Nag_LeftSide, pdvr1;
  • if order=Nag_RowMajor,
    • if side=Nag_RightSide or Nag_BothSides, pdvrmax1,mm;
    • if side=Nag_LeftSide, pdvr1.
    • if side=Nag_RightSide or Nag_BothSides, pdvrmax1,m;
    • if side=Nag_LeftSide, pdvr1.
14:   mmIntegerInput
On entry: the number of columns in the arrays vl and/or vr if order=Nag_ColMajor or the number of rows in the arrays if order=Nag_RowMajor. The actual number of rows or columns required, required_rowcol, is obtained by counting 1 for each selected real eigenvector and 2 for each selected complex eigenvector (see select); 0required_rowcoln.
Constraint: mmrequired_rowcol.
15:   mInteger *Output
On exit: required_rowcol, the number of selected eigenvectors.
16:   ifaill[dim]IntegerOutput
Note: the dimension, dim, of the array ifaill must be at least
  • max1,mm when side=Nag_LeftSide or Nag_BothSides;
  • 1 when side=Nag_RightSide.
On exit: if side=Nag_LeftSide or Nag_BothSides, then ifaill[i-1]=0 if the selected left eigenvector converged and ifaill[i-1]=j0 if the eigenvector stored in the ith row or column of vl (corresponding to the jth eigenvalue) failed to converge.
If side=Nag_RightSide, ifaill is not referenced.
17:   ifailr[dim]IntegerOutput
Note: the dimension, dim, of the array ifailr must be at least
  • max1,mm when side=Nag_RightSide or Nag_BothSides;
  • 1 when side=Nag_LeftSide.
On exit: if side=Nag_RightSide or Nag_BothSides, then ifailr[i-1]=0 if the selected right eigenvector converged and ifailr[i-1]=j0 if the eigenvector stored in the ith column of vr (corresponding to the jth eigenvalue) failed to converge.
If side=Nag_LeftSide, ifailr is not referenced.
18:   failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_CONVERGENCE
value eigenvectors (as indicated by arguments ifaill and/or ifailr) failed to converge. The corresponding columns of vl and/or vr contain no useful information.
NE_ENUM_INT_2
On entry, side=value, pdvl=value, m=value.
Constraint: if side=Nag_LeftSide or Nag_BothSides, pdvlmax1,m;
if side=Nag_RightSide, pdvl1.
On entry, side=value, pdvl=value, mm=value.
Constraint: if side=Nag_LeftSide or Nag_BothSides, pdvlmax1,mm;
if side=Nag_RightSide, pdvl1.
On entry, side=value, pdvl=value and n=value.
Constraint: if side=Nag_LeftSide or Nag_BothSides, pdvln;
if side=Nag_RightSide, pdvl1.
On entry, side=value, pdvr=value, m=value.
Constraint: if side=Nag_RightSide or Nag_BothSides, pdvrmax1,m;
if side=Nag_LeftSide, pdvr1.
On entry, side=value, pdvr=value, mm=value.
Constraint: if side=Nag_RightSide or Nag_BothSides, pdvrmax1,mm;
if side=Nag_LeftSide, pdvr1.
On entry, side=value, pdvr=value and n=value.
Constraint: if side=Nag_RightSide or Nag_BothSides, pdvrn;
if side=Nag_LeftSide, pdvr1.
NE_INT
On entry, mm=value.
Constraint: mmrequired_rowcol, where required_rowcol is the number of selected eigenvectors.
On entry, n=value.
Constraint: n0.
On entry, pdh=value.
Constraint: pdh>0.
On entry, pdvl=value.
Constraint: pdvl>0.
On entry, pdvr=value.
Constraint: pdvr>0.
NE_INT_2
On entry, pdh=value and n=value.
Constraint: pdhmax1,n.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

7  Accuracy

Each computed right eigenvector xi is the exact eigenvector of a nearby matrix A+Ei, such that Ei=OεA. Hence the residual is small:
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.

8  Parallelism and Performance

nag_zhsein (f08pxc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_zhsein (f08pxc) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the Users' Note for your implementation for any additional implementation-specific information.

9  Further Comments

The real analogue of this function is nag_dhsein (f08pkc).

10  Example

See Section 10 in nag_zunmhr (f08nuc).

nag_zhsein (f08pxc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2014