NAG Library Routine Document

f08pkf  (dhsein)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

1
Purpose

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

2
Specification

Fortran Interface
Subroutine f08pkf ( job, eigsrc, initv, select, n, h, ldh, wr, wi, vl, ldvl, vr, ldvr, mm, m, work, ifaill, ifailr, info)
Integer, Intent (In):: n, ldh, ldvl, ldvr, mm
Integer, Intent (Inout):: ifaill(*), ifailr(*)
Integer, Intent (Out):: m, info
Real (Kind=nag_wp), Intent (In):: h(ldh,*), wi(*)
Real (Kind=nag_wp), Intent (Inout):: wr(*), vl(ldvl,*), vr(ldvr,*)
Real (Kind=nag_wp), Intent (Out):: work((n+2)*n)
Logical, Intent (Inout):: select(*)
Character (1), Intent (In):: job, eigsrc, initv
C Header Interface
#include nagmk26.h
void  f08pkf_ ( const char *job, const char *eigsrc, const char *initv, logical sel[], const Integer *n, const double h[], const Integer *ldh, double wr[], const double wi[], double vl[], const Integer *ldvl, double vr[], const Integer *ldvr, const Integer *mm, Integer *m, double work[], Integer ifaill[], Integer ifailr[], Integer *info, const Charlen length_job, const Charlen length_eigsrc, const Charlen length_initv)
The routine may be called by its LAPACK name dhsein.

3
Description

f08pkf (dhsein) computes left and/or right eigenvectors of a real 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  HTy = λ-y .  
Note that even though H is real, λ, x and y may be complex. If x is an eigenvector corresponding to a complex eigenvalue λ, then the complex conjugate vector x- is the eigenvector corresponding to the complex conjugate eigenvalue λ-.
The eigenvectors are computed by inverse iteration. They are scaled so that, for a real eigenvector x, maxxi = 1 , and for a complex eigenvector, max Rexi + Imxi = 1 .
If H has been formed by reduction of a real general matrix A to upper Hessenberg form, then the eigenvectors of H may be transformed to eigenvectors of A by a call to f08ngf (dormhr).

4
References

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

5
Arguments

1:     job – Character(1)Input
On entry: indicates whether left and/or right eigenvectors are to be computed.
job='R'
Only right eigenvectors are computed.
job='L'
Only left eigenvectors are computed.
job='B'
Both left and right eigenvectors are computed.
Constraint: job='R', 'L' or 'B'.
2:     eigsrc – Character(1)Input
On entry: indicates whether the eigenvalues of H (stored in wr and wi) were found using f08pef (dhseqr).
eigsrc='Q'
The eigenvalues of H were found using f08pef (dhseqr); 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 routine to perform inverse iteration on just one diagonal block.
eigsrc='N'
No such assumption is made and the routine performs inverse iteration using the whole matrix.
Constraint: eigsrc='Q' or 'N'.
3:     initv – Character(1)Input
On entry: indicates whether you are supplying initial estimates for the selected eigenvectors.
initv='N'
No initial estimates are supplied.
initv='U'
Initial estimates are supplied in vl and/or vr.
Constraint: initv='N' or 'U'.
4:     select* – Logical arrayInput/Output
Note: the dimension of the array select must be at least max1,n.
On entry: specifies which eigenvectors are to be computed. To obtain the real eigenvector corresponding to the real eigenvalue wrj, selectj must be set .TRUE.. To select the complex eigenvector corresponding to the complex eigenvalue wrj,wij with complex conjugate (wrj+1,wij+1), selectj and/or selectj+1 must be set .TRUE.; the eigenvector corresponding to the first eigenvalue in the pair is computed.
On exit: if a complex eigenvector was selected as specified above, selectj is set to .TRUE. and selectj+1 to .FALSE..
5:     n – IntegerInput
On entry: n, the order of the matrix H.
Constraint: n0.
6:     hldh* – Real (Kind=nag_wp) arrayInput
Note: the second dimension of the array h must be at least max1,n.
On entry: the n by n upper Hessenberg matrix H. If a NaN is detected in h, the routine will return with info=-6.
Constraint: No element of h is equal to NaN.
7:     ldh – IntegerInput
On entry: the first dimension of the array h as declared in the (sub)program from which f08pkf (dhsein) is called.
Constraint: ldhmax1,n.
8:     wr* – Real (Kind=nag_wp) arrayInput/Output
9:     wi* – Real (Kind=nag_wp) arrayInput
Note: the dimension of the arrays wr and wi must be at least max1,n.
On entry: the real and imaginary parts, respectively, of the eigenvalues of the matrix H. Complex conjugate pairs of values must be stored in consecutive elements of the arrays. If eigsrc='Q', the arrays must be exactly as returned by f08pef (dhseqr).
On exit: some elements of wr may be modified, as close eigenvalues are perturbed slightly in searching for independent eigenvectors.
10:   vlldvl* – Real (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array vl must be at least max1,mm if job='L' or 'B' and at least 1 if job='R'.
On entry: if initv='U' and job='L' or 'B', vl must contain starting vectors for inverse iteration for the left eigenvectors. Each starting vector must be stored in the same column or columns as will be used to store the corresponding eigenvector (see below).
If initv='N', vl need not be set.
On exit: if job='L' or '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. Corresponding to each selected real eigenvalue is a real eigenvector, occupying one column. Corresponding to each selected complex eigenvalue is a complex eigenvector, occupying two columns: the first column holds the real part and the second column holds the imaginary part.
If job='R', vl is not referenced.
11:   ldvl – IntegerInput
On entry: the first dimension of the array vl as declared in the (sub)program from which f08pkf (dhsein) is called.
Constraints:
  • if job='L' or 'B', ldvln;
  • if job='R', ldvl1.
12:   vrldvr* – Real (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array vr must be at least max1,mm if job='R' or 'B' and at least 1 if job='L'.
On entry: if initv='U' and job='R' or 'B', vr must contain starting vectors for inverse iteration for the right eigenvectors. Each starting vector must be stored in the same column or columns as will be used to store the corresponding eigenvector (see below).
If initv='N', vr need not be set.
On exit: if job='R' or '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. Corresponding to each selected real eigenvalue is a real eigenvector, occupying one column. Corresponding to each selected complex eigenvalue is a complex eigenvector, occupying two columns: the first column holds the real part and the second column holds the imaginary part.
If job='L', vr is not referenced.
13:   ldvr – IntegerInput
On entry: the first dimension of the array vr as declared in the (sub)program from which f08pkf (dhsein) is called.
Constraints:
  • if job='R' or 'B', ldvrn;
  • if job='L', ldvr1.
14:   mm – IntegerInput
On entry: the number of columns in the arrays vl and/or vr . The actual number of columns required, m, is obtained by counting 1 for each selected real eigenvector and 2 for each selected complex eigenvector (see select); 0mn.
Constraint: mmm.
15:   m – IntegerOutput
On exit: m, the number of columns of vl and/or vr required to store the selected eigenvectors.
16:   workn+2×n – Real (Kind=nag_wp) arrayWorkspace
17:   ifaill* – Integer arrayOutput
Note: the dimension of the array ifaill must be at least max1,mm if job='L' or 'B' and at least 1 if job='R'.
On exit: if job='L' or 'B', then ifailli=0 if the selected left eigenvector converged and ifailli=j>0 if the eigenvector stored in the ith column of vl (corresponding to the jth eigenvalue as held in wrj,wij failed to converge. If the ith and i+1th columns of vl contain a selected complex eigenvector, then ifailli and ifailli+1 are set to the same value.
If job='R', ifaill is not referenced.
18:   ifailr* – Integer arrayOutput
Note: the dimension of the array ifailr must be at least max1,mm if job='R' or 'B' and at least 1 if job='L'.
On exit: if job='R' or 'B', then ifailri=0 if the selected right eigenvector converged and ifailri=j>0 if the eigenvector stored in the ith row or column of vr (corresponding to the jth eigenvalue as held in wrj,wij) failed to converge. If the ith and i+1th rows or columns of vr contain a selected complex eigenvector, then ifailri and ifailri+1 are set to the same value.
If job='L', ifailr is not referenced.
19:   info – IntegerOutput
On exit: info=0 unless the routine detects an error (see Section 6).

6
Error Indicators and Warnings

info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
info>0
If info=i, then i eigenvectors (as indicated by the arguments ifaill and/or ifailr above) failed to converge. The corresponding columns of vl and/or vr contain no useful information.

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

f08pkf (dhsein) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
f08pkf (dhsein) 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 X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9
Further Comments

The complex analogue of this routine is f08pxf (zhsein).

10
Example

See Section 10 in f08ngf (dormhr).
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017