NAG Library Routine Document

f08yuf (ztgsen)

1
Purpose

f08yuf (ztgsen) 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 routine also, optionally, computes the reciprocal condition numbers of the cluster of eigenvalues and/or corresponding deflating subspaces.

2
Specification

Fortran Interface
Subroutine f08yuf ( ijob, wantq, wantz, select, n, a, lda, b, ldb, alpha, beta, q, ldq, z, ldz, m, pl, pr, dif, work, lwork, iwork, liwork, info)
Integer, Intent (In):: ijob, n, lda, ldb, ldq, ldz, lwork, liwork
Integer, Intent (Out):: m, iwork(max(1,liwork)), info
Real (Kind=nag_wp), Intent (Inout):: dif(*)
Real (Kind=nag_wp), Intent (Out):: pl, pr
Complex (Kind=nag_wp), Intent (Inout):: a(lda,*), b(ldb,*), q(ldq,*), z(ldz,*)
Complex (Kind=nag_wp), Intent (Out):: alpha(n), beta(n), work(max(1,lwork))
Logical, Intent (In):: wantq, wantz, select(n)
C Header Interface
#include <nagmk26.h>
void  f08yuf_ (const Integer *ijob, const logical *wantq, const logical *wantz, const logical sel[], const Integer *n, Complex a[], const Integer *lda, Complex b[], const Integer *ldb, Complex alpha[], Complex beta[], Complex q[], const Integer *ldq, Complex z[], const Integer *ldz, Integer *m, double *pl, double *pr, double dif[], Complex work[], const Integer *lwork, Integer iwork[], const Integer *liwork, Integer *info)
The routine may be called by its LAPACK name ztgsen.

3
Description

f08yuf (ztgsen) 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 f08xnf (zgges), or f08xsf (zhgeqz) with job='S'. 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 routine 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:     ijob – IntegerInput
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 (dif1:2).
ijob=3
Estimate of Difu and Difl. 1-norm-based estimate (dif1:2). About five times as expensive as ijob=2.
ijob=4
Compute pl, pr and dif as in ijob=0, 1 and 2. Economic version to get it all.
ijob=5
Compute pl, pr and dif as in ijob=0, 1 and 3.
Constraint: 0ijob5.
2:     wantq – LogicalInput
On entry: if wantq=.TRUE., update the left transformation matrix Q.
If wantq=.FALSE., do not update Q.
3:     wantz – LogicalInput
On entry: if wantz=.TRUE., update the right transformation matrix Z.
If wantz=.FALSE., do not update Z.
4:     selectn – Logical arrayInput
On entry: specifies the eigenvalues in the selected cluster. To select an eigenvalue λj, selectj must be set to .TRUE..
5:     n – IntegerInput
On entry: n, the order of the matrices S and T.
Constraint: n0.
6:     alda* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array a must be at least max1,n.
On entry: the matrix S in the pair S,T.
On exit: the updated matrix S^.
7:     lda – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f08yuf (ztgsen) is called.
Constraint: ldamax1,n.
8:     bldb* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array b must be at least max1,n.
On entry: the matrix T, in the pair S,T.
On exit: the updated matrix T^ 
9:     ldb – IntegerInput
On entry: the first dimension of the array b as declared in the (sub)program from which f08yuf (ztgsen) is called.
Constraint: ldbmax1,n.
10:   alphan – Complex (Kind=nag_wp) arrayOutput
11:   betan – Complex (Kind=nag_wp) arrayOutput
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. alphai/betai, for i=1,2,,n, are the eigenvalues.
12:   qldq* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array q must be at least max1,n if wantq=.TRUE., and at least 1 otherwise.
On entry: if wantq=.TRUE., the n by n matrix Q.
On exit: if wantq=.TRUE., the updated matrix QQ^.
If wantq=.FALSE., q is not referenced.
13:   ldq – IntegerInput
On entry: the first dimension of the array q as declared in the (sub)program from which f08yuf (ztgsen) is called.
Constraints:
  • if wantq=.TRUE., ldq max1,n ;
  • otherwise ldq1.
14:   zldz* – Complex (Kind=nag_wp) arrayInput/Output
Note: the second dimension of the array z must be at least max1,n if wantz=.TRUE., and at least 1 otherwise.
On entry: if wantz=.TRUE., the n by n matrix Z.
On exit: if wantz=.TRUE., the updated matrix ZZ^.
If wantz=.FALSE., z is not referenced.
15:   ldz – IntegerInput
On entry: the first dimension of the array z as declared in the (sub)program from which f08yuf (ztgsen) is called.
Constraints:
  • if wantz=.TRUE., ldz max1,n ;
  • otherwise ldz1.
16:   m – IntegerOutput
On exit: the dimension of the specified pair of left and right eigenspaces (deflating subspaces), where m will be in the range 0mn.
17:   pl – Real (Kind=nag_wp)Output
18:   pr – Real (Kind=nag_wp)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.
19:   dif* – Real (Kind=nag_wp) arrayOutput
Note: the dimension of the array dif must be at least 2.
On exit: if ijob2, dif1:2 store the estimates of Difu and Difl.
If ijob=2 or 4, dif1:2 are F-norm-based upper bounds on Difu and Difl.
If ijob=3 or 5, dif1:2 are 1-norm-based estimates of Difu and Difl.
If m=0 or n, dif1:2 =A,BF.
If ijob=0 or 1, dif is not referenced.
20:   workmax1,lwork – Complex (Kind=nag_wp) arrayWorkspace
On exit: if info=0, the real part of work1 contains the minimum value of lwork required for optimal performance.
21:   lwork – IntegerInput
On entry: the dimension of the array work as declared in the (sub)program from which f08yuf (ztgsen) is called.
If lwork=-1, a workspace query is assumed; the routine only calculates the minimum sizes of the work and iwork arrays, returns these values as the first entries of the work and iwork arrays, and no error message related to lwork or liwork is issued.
Constraints:
if lwork-1,
  • if ijob=1, 2 or 4, lworkmax1,2×m×n-m;
  • if ijob=3 or 5, lworkmax1,4×m×n-m;
  • otherwise lwork1.
22:   iworkmax1,liwork – Integer arrayWorkspace
On exit: if info=0, iwork1 returns the minimum liwork.
23:   liwork – IntegerInput
On entry: the dimension of the array iwork as declared in the (sub)program from which f08yuf (ztgsen) is called.
If liwork=-1, a workspace query is assumed; the routine only calculates the minimum sizes of the work and iwork arrays, returns these values as the first entries of the work and iwork arrays, and no error message related to lwork or liwork is issued.
Constraints:
if liwork-1,
  • if ijob=1, 2 or 4, liworkn+2;
  • if ijob=3 or 5, liworkmaxn+2,2×m×n-m;
  • otherwise liwork1.
24:   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=1
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 dif1 and dif2, 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

f08yuf (ztgsen) 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 real analogue of this routine is f08ygf (dtgsen).

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 (f08yufe.f90)

10.2
Program Data

Program Data (f08yufe.d)

10.3
Program Results

Program Results (f08yufe.r)