nag_ztrsen (f08quc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_ztrsen (f08quc)

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_ztrsen (f08quc) reorders the Schur factorization of a complex general matrix so that a selected cluster of eigenvalues appears in the leading elements on the diagonal of the Schur form. The function also optionally computes the reciprocal condition numbers of the cluster of eigenvalues and/or the invariant subspace.

2  Specification

#include <nag.h>
#include <nagf08.h>
void  nag_ztrsen (Nag_OrderType order, Nag_JobType job, Nag_ComputeQType compq, const Nag_Boolean select[], Integer n, Complex t[], Integer pdt, Complex q[], Integer pdq, Complex w[], Integer *m, double *s, double *sep, NagError *fail)

3  Description

nag_ztrsen (f08quc) reorders the Schur factorization of a complex general matrix A=QTQH, so that a selected cluster of eigenvalues appears in the leading diagonal elements of the Schur form.
The reordered Schur form T~ is computed by a unitary similarity transformation: T~=ZHTZ. Optionally the updated matrix Q~ of Schur vectors is computed as Q~=QZ, giving A=Q~T~Q~H.
Let T~= T11 T12 0 T22 , where the selected eigenvalues are precisely the eigenvalues of the leading m by m sub-matrix T11. Let Q~ be correspondingly partitioned as Q1 Q2  where Q1 consists of the first m columns of Q. Then AQ1=Q1T11, and so the m columns of Q1 form an orthonormal basis for the invariant subspace corresponding to the selected cluster of eigenvalues.
Optionally the function also computes estimates of the reciprocal condition numbers of the average of the cluster of eigenvalues and of the invariant subspace.

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_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:     job Nag_JobTypeInput
On entry: indicates whether condition numbers are required for the cluster of eigenvalues and/or the invariant subspace.
job=Nag_DoNothing
No condition numbers are required.
job=Nag_EigVals
Only the condition number for the cluster of eigenvalues is computed.
job=Nag_Subspace
Only the condition number for the invariant subspace is computed.
job=Nag_DoBoth
Condition numbers for both the cluster of eigenvalues and the invariant subspace are computed.
Constraint: job=Nag_DoNothing, Nag_EigVals, Nag_Subspace or Nag_DoBoth.
3:     compq Nag_ComputeQTypeInput
On entry: indicates whether the matrix Q of Schur vectors is to be updated.
compq=Nag_UpdateSchur
The matrix Q of Schur vectors is updated.
compq=Nag_NotQ
No Schur vectors are updated.
Constraint: compq=Nag_UpdateSchur or Nag_NotQ.
4:     select[dim] const Nag_BooleanInput
Note: the dimension, dim, of the array select must be at least max1,n.
On entry: specifies the eigenvalues in the selected cluster. To select a complex eigenvalue λj, select[j-1] must be set Nag_TRUE.
5:     n IntegerInput
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 max1,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: t is overwritten by the updated matrix T~.
7:     pdt IntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array t.
Constraint: pdt max1,n .
8:     q[dim] ComplexInput/Output
Note: the dimension, dim, of the array q must be at least
  • max1,pdq×n when compq=Nag_UpdateSchur;
  • 1 when compq=Nag_NotQ.
The i,jth element of the matrix Q is stored in
  • q[j-1×pdq+i-1] when order=Nag_ColMajor;
  • q[i-1×pdq+j-1] when order=Nag_RowMajor.
On entry: if compq=Nag_UpdateSchur, q must contain the n by n unitary matrix Q of Schur vectors, as returned by nag_zhseqr (f08psc).
On exit: if compq=Nag_UpdateSchur, q contains the updated matrix of Schur vectors; the first m columns of Q form an orthonormal basis for the specified invariant subspace.
If compq=Nag_NotQ, q is not referenced.
9:     pdq IntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array q.
Constraints:
  • if compq=Nag_UpdateSchur, pdq max1,n ;
  • if compq=Nag_NotQ, pdq1.
10:   w[dim] ComplexOutput
Note: the dimension, dim, of the array w must be at least max1,n.
On exit: the reordered eigenvalues of T~. The eigenvalues are stored in the same order as on the diagonal of T~.
11:   m Integer *Output
On exit: m, the dimension of the specified invariant subspace, which is the same as the number of selected eigenvalues (see select); 0mn.
12:   s double *Output
On exit: if job=Nag_EigVals or Nag_DoBoth, s is a lower bound on the reciprocal condition number of the average of the selected cluster of eigenvalues. If m=0​ or ​n, s=1.
If job=Nag_DoNothing or Nag_Subspace, s is not referenced.
13:   sep double *Output
On exit: if job=Nag_Subspace or Nag_DoBoth, sep is the estimated reciprocal condition number of the specified invariant subspace. If m=0​ or ​n, sep=T.
If job=Nag_DoNothing or Nag_EigVals, sep is not referenced.
14:   fail NagError *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.
See Section 3.2.1.2 in the Essential Introduction for further information.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_ENUM_INT_2
On entry, compq=value, pdq=value and n=value.
Constraint: if compq=Nag_UpdateSchur, pdq max1,n ;
if compq=Nag_NotQ, pdq1.
NE_INT
On entry, n=value.
Constraint: n0.
On entry, pdq=value.
Constraint: pdq>0.
On entry, pdt=value.
Constraint: pdt>0.
NE_INT_2
On entry, pdt=value and n=value.
Constraint: pdt max1,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.
An unexpected error has been triggered by this function. Please contact NAG.
See Section 3.6.6 in the Essential Introduction for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 3.6.5 in the Essential Introduction for further information.

7  Accuracy

The computed matrix T~ is similar to a matrix T+E, where
E2 = Oε T2 ,  
and ε is the machine precision.
s cannot underestimate the true reciprocal condition number by more than a factor of minm,n-m. sep may differ from the true value by mn-m. The angle between the computed invariant subspace and the true subspace is OεA2sep .
The values of the eigenvalues are never changed by the reordering.

8  Parallelism and Performance

nag_ztrsen (f08quc) is not threaded by NAG in any implementation.
nag_ztrsen (f08quc) 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 nag_dtrsen (f08qgc).

10  Example

This example reorders the Schur factorization of the matrix A=QTQH such that the eigenvalues stored in elements t11 and t44 appear as the leading elements on the diagonal of the reordered matrix T~, where
T = -6.0004-6.9999i 0.3637-0.3656i -0.1880+0.4787i 0.8785-0.2539i 0.0000+0.0000i -5.0000+2.0060i -0.0307-0.7217i -0.2290+0.1313i 0.0000+0.0000i 0.0000+0.0000i 7.9982-0.9964i 0.9357+0.5359i 0.0000+0.0000i 0.0000+0.0000i 0.0000+0.0000i 3.0023-3.9998i  
and
Q = -0.8347-0.1364i -0.0628+0.3806i 0.2765-0.0846i 0.0633-0.2199i 0.0664-0.2968i 0.2365+0.5240i -0.5877-0.4208i 0.0835+0.2183i -0.0362-0.3215i 0.3143-0.5473i 0.0576-0.5736i 0.0057-0.4058i 0.0086+0.2958i -0.3416-0.0757i -0.1900-0.1600i 0.8327-0.1868i .  
The original matrix A is given in Section 10 in nag_zunghr (f08ntc).

10.1  Program Text

Program Text (f08quce.c)

10.2  Program Data

Program Data (f08quce.d)

10.3  Program Results

Program Results (f08quce.r)


nag_ztrsen (f08quc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

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