nag_ztgsen (f08yuc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_ztgsen (f08yuc)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_ztgsen (f08yuc) reorders the generalized Schur factorization of a complex matrix pair in generalized Schur form, so that a selected cluster of eigenvalues appears in the leading elements on the diagonal of the generalized Schur form. The function also, optionally, computes the reciprocal condition numbers of the cluster of eigenvalues and/or corresponding deflating subspaces.

2  Specification

#include <nag.h>
#include <nagf08.h>
void  nag_ztgsen (Nag_OrderType order, Integer ijob, Nag_Boolean wantq, Nag_Boolean wantz, const Nag_Boolean select[], Integer n, Complex a[], Integer pda, Complex b[], Integer pdb, Complex alpha[], Complex beta[], Complex q[], Integer pdq, Complex z[], Integer pdz, Integer *m, double *pl, double *pr, double dif[], NagError *fail)

3  Description

nag_ztgsen (f08yuc) factorizes the generalized complex n by n matrix pair S,T in generalized Schur form, using a unitary equivalence transformation as
S = Q^ S^ Z^H ,   T= Q^ T^ Z^H ,
where S^,T^ are also in generalized Schur form and have the selected eigenvalues as the leading diagonal elements. The leading columns of Q and Z are the generalized Schur vectors corresponding to the selected eigenvalues and form orthonormal subspaces for the left and right eigenspaces (deflating subspaces) of the pair S,T.
The pair S,T are in generalized Schur form if S and T are upper triangular as returned, for example, by nag_zgges (f08xnc), or nag_zhgeqz (f08xsc) with job=Nag_Schur. The diagonal elements define the generalized eigenvalues αi,βi, for i=1,2,,n, of the pair S,T. The eigenvalues are given by
λi = αi / βi ,
but are returned as the pair αi,βi in order to avoid possible overflow in computing λi. Optionally, the function returns reciprocals of condition number estimates for the selected eigenvalue cluster, p and q, the right and left projection norms, and of deflating subspaces, Difu and Difl. For more information see Sections 2.4.8 and 4.11 of Anderson et al. (1999).
If S and T are the result of a generalized Schur factorization of a matrix pair A,B 
A = QSZH ,   B= QTZH
then, optionally, the matrices Q and Z can be updated as QQ^ and ZZ^. Note that the condition numbers of the pair S,T are the same as those of the pair A,B.

4  References

Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999) LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia http://www.netlib.org/lapack/lug

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:     ijobIntegerInput
On entry: specifies whether condition numbers are required for the cluster of eigenvalues (p and q) or the deflating subspaces (Difu and Difl).
ijob=0
Only reorder with respect to select. No extras.
ijob=1
Reciprocal of norms of ‘projections’ onto left and right eigenspaces with respect to the selected cluster (p and q).
ijob=2
The upper bounds on Difu and Difl. F-norm-based estimate (stored in dif[0] and dif[1] respectively).
ijob=3
Estimate of Difu and Difl. 1-norm-based estimate (stored in dif[0] and dif[1] respectively). About five times as expensive as ijob=2.
ijob=4
Compute plpr and dif as in ijob=0, 1 and 2. Economic version to get it all.
ijob=5
Compute plpr and dif as in ijob=0, 1 and 3.
Constraint: 0ijob5.
3:     wantqNag_BooleanInput
On entry: if wantq=Nag_TRUE, update the left transformation matrix Q.
If wantq=Nag_FALSE, do not update Q.
4:     wantzNag_BooleanInput
On entry: if wantz=Nag_TRUE, update the right transformation matrix Z.
If wantz=Nag_FALSE, do not update Z.
5:     select[n]const Nag_BooleanInput
On entry: specifies the eigenvalues in the selected cluster. To select an eigenvalue λj, select[j-1] must be set to Nag_TRUE.
6:     nIntegerInput
On entry: n, the order of the matrices S and T.
Constraint: n0.
7:     a[dim]ComplexInput/Output
Note: the dimension, dim, of the array a must be at least max1,pda×n.
The i,jth element of the matrix A is stored in
  • a[j-1×pda+i-1] when order=Nag_ColMajor;
  • a[i-1×pda+j-1] when order=Nag_RowMajor.
On entry: the matrix S in the pair S,T.
On exit: the updated matrix S^.
8:     pdaIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array a.
Constraint: pdamax1,n.
9:     b[dim]ComplexInput/Output
Note: the dimension, dim, of the array b must be at least max1,pdb×n.
The i,jth element of the matrix B is stored in
  • b[j-1×pdb+i-1] when order=Nag_ColMajor;
  • b[i-1×pdb+j-1] when order=Nag_RowMajor.
On entry: the matrix T, in the pair S,T.
On exit: the updated matrix T^ 
10:   pdbIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array b.
Constraint: pdbmax1,n.
11:   alpha[n]ComplexOutput
12:   beta[n]ComplexOutput
On exit: alpha and beta contain diagonal elements of S^ and T^, respectively, when the pair S,T has been reduced to generalized Schur form. alpha[i-1]/beta[i-1], for i=1,2,,n, are the eigenvalues.
13:   q[dim]ComplexInput/Output
Note: the dimension, dim, of the array q must be at least
  • max1,pdq×n when wantq=Nag_TRUE;
  • 1 otherwise.
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 wantq=Nag_TRUE, the n by n matrix Q.
On exit: if wantq=Nag_TRUE, the updated matrix QQ^.
If wantq=Nag_FALSE, q is not referenced.
14:   pdqIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array q.
Constraints:
  • if wantq=Nag_TRUE, pdq max1,n ;
  • otherwise pdq1.
15:   z[dim]ComplexInput/Output
Note: the dimension, dim, of the array z must be at least
  • max1,pdz×n when wantz=Nag_TRUE;
  • 1 otherwise.
The i,jth element of the matrix Z is stored in
  • z[j-1×pdz+i-1] when order=Nag_ColMajor;
  • z[i-1×pdz+j-1] when order=Nag_RowMajor.
On entry: if wantz=Nag_TRUE, the n by n matrix Z.
On exit: if wantz=Nag_TRUE, the updated matrix ZZ^.
If wantz=Nag_FALSE, z is not referenced.
16:   pdzIntegerInput
On entry: the stride separating row or column elements (depending on the value of order) in the array z.
Constraints:
  • if wantz=Nag_TRUE, pdz max1,n ;
  • otherwise pdz1.
17:   mInteger *Output
On exit: the dimension of the specified pair of left and right eigenspaces (deflating subspaces).
Constraint: 0mn.
18:   pldouble *Output
19:   prdouble *Output
On exit: if ijob=1, 4 or 5, pl and pr are lower bounds on the reciprocal of the norm of ‘projections’ p and q onto left and right eigenspace with respect to the selected cluster. 0<pl, pr1.
If m=0 or m=n, pl=pr=1.
If ijob=0, 2 or 3, pl and pr are not referenced.
20:   dif[dim]doubleOutput
Note: the dimension, dim, of the array dif must be at least 2.
On exit: if ijob2, dif[0] and dif[1] store the estimates of Difu and Difl.
If ijob=2 or 4, dif[0] and dif[1] are F-norm-based upper bounds on Difu and Difl.
If ijob=3 or 5, dif[0] and dif[1] are 1-norm-based estimates of Difu and Difl.
If m=0 or n, dif[0] and dif[1] =A,BF.
If ijob=0 or 1, dif is not referenced.
21:   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_CONSTRAINT
On entry, wantq=value, pdq=value and n=value.
Constraint: if wantq=Nag_TRUE, pdq max1,n ;
otherwise pdq1.
On entry, wantz=value, pdz=value and n=value.
Constraint: if wantz=Nag_TRUE, pdz max1,n ;
otherwise pdz1.
NE_INT
On entry, ijob=value.
Constraint: 0ijob5.
On entry, n=value.
Constraint: n0.
On entry, pda=value.
Constraint: pda>0.
On entry, pdb=value.
Constraint: pdb>0.
On entry, pdq=value.
Constraint: pdq>0.
On entry, pdz=value.
Constraint: pdz>0.
NE_INT_2
On entry, pda=value and n=value.
Constraint: pdamax1,n.
On entry, pdb=value and n=value.
Constraint: pdbmax1,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.
NE_SCHUR
Reordering of S,T failed because the transformed matrix pair would be too far from generalized Schur form; the problem is very ill-conditioned. S,T may have been partially reordered. If requested, 0 is returned in dif[0] and dif[1], pl and pr.

7  Accuracy

The computed generalized Schur form is nearly the exact generalized Schur form for nearby matrices S+E and T+F, where
E2 = Oε S2   and   F2= Oε T2 ,
and ε is the machine precision. See Section 4.11 of Anderson et al. (1999) for further details of error bounds for the generalized nonsymmetric eigenproblem, and for information on the condition numbers returned.

8  Parallelism and Performance

nag_ztgsen (f08yuc) is not threaded by NAG in any implementation.
nag_ztgsen (f08yuc) 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_dtgsen (f08ygc).

10  Example

This example reorders the generalized Schur factors S and T and update the matrices Q and Z given by
S = 4.0+4.0i 1.0+1.0i 1.0+1.0i 2.0-1.0i 0.0i+0.0 2.0+1.0i 1.0+1.0i 1.0+1.0i 0.0i+0.0 0.0i+0.0 2.0-1.0i 1.0+1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 6.0-2.0i ,
T = 2.0 1.0+1.0i 1.0+1.0i 3.0-1.0i 0.0 1.0i+0.0 2.0+1.0i 1.0+1.0i 0.0 0.0i+0.0 1.0i+0.0 1.0+1.0i 0.0 0.0i+0.0 0.0i+0.0 2.0i+0.0 ,
Q = 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0   and  Z= 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 ,
selecting the second and third generalized eigenvalues to be moved to the leading positions. Bases for the left and right deflating subspaces, and estimates of the condition numbers for the eigenvalues and Frobenius norm based bounds on the condition numbers for the deflating subspaces are also output.

10.1  Program Text

Program Text (f08yuce.c)

10.2  Program Data

Program Data (f08yuce.d)

10.3  Program Results

Program Results (f08yuce.r)


nag_ztgsen (f08yuc) (PDF version)
f08 Chapter Contents
f08 Chapter Introduction
NAG Library Manual

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