nag_ztrevc (f08qxc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_ztrevc (f08qxc)

+ Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

nag_ztrevc (f08qxc) computes selected left and/or right eigenvectors of a complex upper triangular matrix.

2  Specification

#include <nag.h>
#include <nagf08.h>
void  nag_ztrevc (Nag_OrderType order, Nag_SideType side, Nag_HowManyType how_many, const Nag_Boolean select[], Integer n, Complex t[], Integer pdt, Complex vl[], Integer pdvl, Complex vr[], Integer pdvr, Integer mm, Integer *m, NagError *fail)

3  Description

nag_ztrevc (f08qxc) computes left and/or right eigenvectors of a complex upper triangular matrix T. Such a matrix arises from the Schur factorization of a complex general matrix, as computed by nag_zhseqr (f08psc), for example.
The right eigenvector x, and the left eigenvector y, corresponding to an eigenvalue λ, are defined by:
Tx = λx   and   yHT = λyH or ​ THy = λ-y .
The function can compute the eigenvectors corresponding to selected eigenvalues, or it can compute all the eigenvectors. In the latter case the eigenvectors may optionally be pre-multiplied by an input matrix Q. Normally Q is a unitary matrix from the Schur factorization of a matrix A as A=QTQH; if x is a (left or right) eigenvector of T, then Qx is an eigenvector of A.
The eigenvectors are computed by forward or backward substitution. They are scaled so that max Rexi + Imxi =1.

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:     how_manyNag_HowManyTypeInput
On entry: indicates how many eigenvectors are to be computed.
how_many=Nag_ComputeAll
All eigenvectors (as specified by side) are computed.
how_many=Nag_BackTransform
All eigenvectors (as specified by side) are computed and then pre-multiplied by the matrix Q (which is overwritten).
how_many=Nag_ComputeSelected
Selected eigenvectors (as specified by side and select) are computed.
Constraint: how_many=Nag_ComputeAll, Nag_BackTransform or Nag_ComputeSelected.
4:     select[dim]const Nag_BooleanInput
Note: the dimension, dim, of the array select must be at least
  • n when how_many=Nag_ComputeSelected;
  • otherwise select may be NULL.
On entry: specifies which eigenvectors are to be computed if how_many=Nag_ComputeSelected. To obtain the eigenvector corresponding to the eigenvalue λj, select[j-1] must be set Nag_TRUE.
If how_many=Nag_ComputeAll or Nag_BackTransform, select is not referenced and may be NULL.
5:     nIntegerInput
On entry: n, the order of the matrix T.
Constraint: n0.
6:     t[dim]ComplexInput/Output
Note: the dimension, dim, of the array t must be at least pdt×n.
The i,jth element of the matrix T is stored in
  • t[j-1×pdt+i-1] when order=Nag_ColMajor;
  • t[i-1×pdt+j-1] when order=Nag_RowMajor.
On entry: the n by n upper triangular matrix T, as returned by nag_zhseqr (f08psc).
On exit: is used as internal workspace prior to being restored and hence is unchanged.
7:     pdtIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array t.
Constraints:
  • if order=Nag_ColMajor, pdt max1,n ;
  • if order=Nag_RowMajor, pdtn.
8:     vl[dim]ComplexInput/Output
Note: the dimension, dim, of the array vl must be at least
  • pdvl×mm when side=Nag_LeftSide or Nag_BothSides and order=Nag_ColMajor;
  • n×pdvl when side=Nag_LeftSide or Nag_BothSides and order=Nag_RowMajor;
  • otherwise vl may be NULL.
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 how_many=Nag_BackTransform and side=Nag_LeftSide or Nag_BothSides, vl must contain an n by n matrix Q (usually the matrix of Schur vectors returned by nag_zhseqr (f08psc)).
If how_many=Nag_ComputeAll or Nag_ComputeSelected, vl need not be set.
On exit: if side=Nag_LeftSide or Nag_BothSides, vl contains the computed left eigenvectors (as specified by how_many and select). The eigenvectors are stored consecutively in the rows or columns (depending on the value of order) of the array, in the same order as their eigenvalues.
If side=Nag_RightSide, vl is not referenced and may be NULL.
9:     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, vl may be NULL;
  • if order=Nag_RowMajor,
    • if side=Nag_LeftSide or Nag_BothSides, pdvlmm;
    • if side=Nag_RightSide, vl may be NULL.
10:   vr[dim]ComplexInput/Output
Note: the dimension, dim, of the array vr must be at least
  • pdvr×mm when side=Nag_RightSide or Nag_BothSides and order=Nag_ColMajor;
  • n×pdvr when side=Nag_RightSide or Nag_BothSides and order=Nag_RowMajor;
  • otherwise vr may be NULL.
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 how_many=Nag_BackTransform and side=Nag_RightSide or Nag_BothSides, vr must contain an n by n matrix Q (usually the matrix of Schur vectors returned by nag_zhseqr (f08psc)).
If how_many=Nag_ComputeAll or Nag_ComputeSelected, vr need not be set.
On exit: if side=Nag_RightSide or Nag_BothSides, vr contains the computed right eigenvectors (as specified by how_many and select). The eigenvectors are stored consecutively in the rows or columns (depending on the value of order) of the array, in the same order as their eigenvalues.
If side=Nag_LeftSide, vr is not referenced and may be NULL.
11:   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, vr may be NULL;
  • if order=Nag_RowMajor,
    • if side=Nag_RightSide or Nag_BothSides, pdvrmm;
    • if side=Nag_LeftSide, vr may be NULL.
12:   mmIntegerInput
On entry: the number of rows or columns (depending on the value of order) in the arrays vl and/or vr. The precise number of rows or columns required, required_rowcol, is n if how_many=Nag_ComputeAll or Nag_BackTransform; if how_many=Nag_ComputeSelected, required_rowcol is the number of selected eigenvectors (see select), in which case 0required_rowcoln.
Constraints:
  • if how_many=Nag_ComputeAll or Nag_BackTransform, mmn;
  • otherwise mmrequired_rowcol.
13:   mInteger *Output
On exit: required_rowcol, the number of selected eigenvectors. If how_many=Nag_ComputeAll or Nag_BackTransform, m is set to n.
14:   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_ENUM_INT
On entry, side=value and mm=value.
Constraint: mm>0.
NE_ENUM_INT_2
On entry, mm=value, n=value and how_many=value.
Constraint: if how_many=Nag_ComputeAll or Nag_BackTransform, mmn;
otherwise mmrequired_rowcol.
On entry, side=value, pdvl=value, mm=value.
Constraint: if side=Nag_LeftSide or Nag_BothSides, pdvlmm.
On entry, side=value, pdvl=value and n=value.
Constraint: if side=Nag_LeftSide or Nag_BothSides, pdvln.
On entry, side=value, pdvr=value, mm=value.
Constraint: if side=Nag_RightSide or Nag_BothSides, pdvrmm.
On entry, side=value, pdvr=value and n=value.
Constraint: if side=Nag_RightSide or Nag_BothSides, pdvrn.
NE_INT
On entry, n=value.
Constraint: n>0.
On entry, n=value.
Constraint: n0.
On entry, pdt=value.
Constraint: pdt>0.
On entry, pdvl=value.
Constraint: pdvl>0.
On entry, pdvr=value.
Constraint: pdvr>0.
NE_INT_2
On entry, pdt=value and n=value.
Constraint: pdt max1,n .
On entry, pdt=value and n=value.
Constraint: pdtn.
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

If xi is an exact right eigenvector, and x~i is the corresponding computed eigenvector, then the angle θx~i,xi between them is bounded as follows:
θ x~i,xi c n ε T2 sepi
where sepi is the reciprocal condition number of xi.
The condition number sepi may be computed by calling nag_ztrsna (f08qyc).

8  Parallelism and Performance

nag_ztrevc (f08qxc) is not threaded by NAG in any implementation.
nag_ztrevc (f08qxc) 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_dtrevc (f08qkc).

10  Example

See Section 10 in nag_zgebal (f08nvc).

nag_ztrevc (f08qxc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

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