NAG CL Interface
f08qxc (ztrevc)

Settings help

CL Name Style:


1 Purpose

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

2 Specification

#include <nag.h>
void  f08qxc (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)
The function may be called by the names: f08qxc, nag_lapackeig_ztrevc or nag_ztrevc.

3 Description

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 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( |Re(xi)| +|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: order Nag_OrderType Input
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.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint: order=Nag_RowMajor or Nag_ColMajor.
2: side Nag_SideType Input
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_many Nag_HowManyType Input
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_Boolean Input
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: n Integer Input
On entry: n, the order of the matrix T.
Constraint: n0.
6: t[dim] Complex Input/Output
Note: the dimension, dim, of the array t must be at least pdt×n.
The (i,j)th 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×n upper triangular matrix T, as returned by f08psc.
On exit: is used as internal workspace prior to being restored and hence is unchanged.
7: pdt Integer Input
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 max(1,n) ;
  • if order=Nag_RowMajor, pdtn.
8: vl[dim] Complex Input/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,j)th 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×n matrix Q (usually the matrix of Schur vectors returned by 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: pdvl Integer Input
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] Complex Input/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,j)th 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×n matrix Q (usually the matrix of Schur vectors returned by 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: pdvr Integer Input
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: mm Integer Input
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, m, is n if how_many=Nag_ComputeAll or Nag_BackTransform; if how_many=Nag_ComputeSelected, m is the number of selected eigenvectors (see select), in which case 0mn.
Constraints:
  • if how_many=Nag_ComputeAll or Nag_BackTransform, mmn;
  • otherwise mmm.
13: m Integer * Output
On exit: m, the number of selected eigenvectors. If how_many=Nag_ComputeAll or Nag_BackTransform, m is set to n.
14: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
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, how_many=value, mm=value and n=value.
Constraint: if how_many=Nag_ComputeAll or Nag_BackTransform, mmn;
otherwise mmm.
On entry, side=value, pdvl=value and 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 and 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 max(1,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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.

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 f08qyc.

8 Parallelism and Performance

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 X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

The real analogue of this function is f08qkc.

10 Example

See f08nvc.