NAG Library Routine Document

f08yff  (dtgexc)

 Contents

    1  Purpose
    7  Accuracy

1
Purpose

f08yff (dtgexc) reorders the generalized Schur factorization of a matrix pair in real generalized Schur form.

2
Specification

Fortran Interface
Subroutine f08yff ( wantq, wantz, n, a, lda, b, ldb, q, ldq, z, ldz, ifst, ilst, work, lwork, info)
Integer, Intent (In):: n, lda, ldb, ldq, ldz, lwork
Integer, Intent (Inout):: ifst, ilst
Integer, Intent (Out):: info
Real (Kind=nag_wp), Intent (Inout):: a(lda,*), b(ldb,*), q(ldq,*), z(ldz,*)
Real (Kind=nag_wp), Intent (Out):: work(max(1,lwork))
Logical, Intent (In):: wantq, wantz
C Header Interface
#include nagmk26.h
void  f08yff_ ( const logical *wantq, const logical *wantz, const Integer *n, double a[], const Integer *lda, double b[], const Integer *ldb, double q[], const Integer *ldq, double z[], const Integer *ldz, Integer *ifst, Integer *ilst, double work[], const Integer *lwork, Integer *info)
The routine may be called by its LAPACK name dtgexc.

3
Description

f08yff (dtgexc) reorders the generalized real n by n matrix pair S,T in real generalized Schur form, so that the diagonal element or block of S,T with row index i1 is moved to row i2, using an orthogonal equivalence transformation. That is, S and T are factorized as
S = Q^ S^ Z^T ,   T= Q^ T^ Z^T ,  
where S^,T^ are also in real generalized Schur form.
The pair S,T are in real generalized Schur form if S is block upper triangular with 1 by 1 and 2 by 2 diagonal blocks and T is upper triangular as returned, for example, by f08xaf (dgges), or f08xef (dhgeqz) with job='S'.
If S and T are the result of a generalized Schur factorization of a matrix pair A,B 
A = QSZT ,   B= QTZT  
then, optionally, the matrices Q and Z can be updated as QQ^ and ZZ^.

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:     wantq – LogicalInput
On entry: if wantq=.TRUE., update the left transformation matrix Q.
If wantq=.FALSE., do not update Q.
2:     wantz – LogicalInput
On entry: if wantz=.TRUE., update the right transformation matrix Z.
If wantz=.FALSE., do not update Z.
3:     n – IntegerInput
On entry: n, the order of the matrices S and T.
Constraint: n0.
4:     alda* – Real (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^.
5:     lda – IntegerInput
On entry: the first dimension of the array a as declared in the (sub)program from which f08yff (dtgexc) is called.
Constraint: ldamax1,n.
6:     bldb* – Real (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^ 
7:     ldb – IntegerInput
On entry: the first dimension of the array b as declared in the (sub)program from which f08yff (dtgexc) is called.
Constraint: ldbmax1,n.
8:     qldq* – Real (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 orthogonal matrix Q.
On exit: if wantq=.TRUE., the updated matrix QQ^.
If wantq=.FALSE., q is not referenced.
9:     ldq – IntegerInput
On entry: the first dimension of the array q as declared in the (sub)program from which f08yff (dtgexc) is called.
Constraints:
  • if wantq=.TRUE., ldq max1,n ;
  • otherwise ldq1.
10:   zldz* – Real (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 orthogonal matrix Z.
On exit: if wantz=.TRUE., the updated matrix ZZ^.
If wantz=.FALSE., z is not referenced.
11:   ldz – IntegerInput
On entry: the first dimension of the array z as declared in the (sub)program from which f08yff (dtgexc) is called.
Constraints:
  • if wantz=.TRUE., ldz max1,n ;
  • otherwise ldz1.
12:   ifst – IntegerInput/Output
13:   ilst – IntegerInput/Output
On entry: the indices i1 and i2 that specify the reordering of the diagonal blocks of S,T. The block with row index ifst is moved to row ilst, by a sequence of swapping between adjacent blocks.
On exit: if ifst pointed on entry to the second row of a 2 by 2 block, it is changed to point to the first row; ilst always points to the first row of the block in its final position (which may differ from its input value by +1 or -1).
Constraint: 1ifstn and 1ilstn.
14:   workmax1,lwork – Real (Kind=nag_wp) arrayWorkspace
On exit: if info=0, work1 contains the minimum value of lwork required for optimal performance.
15:   lwork – IntegerInput
On entry: the dimension of the array work as declared in the (sub)program from which f08yff (dtgexc) is called.
If lwork=-1, a workspace query is assumed; the routine only calculates the minimum size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued.
Constraints:
if lwork-1,
  • if n1, lwork1;
  • otherwise lwork4×n+16.
16:   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
The transformed matrix pair would be too far from generalized Schur form; the problem is ill-conditioned. S,T may have been partially reordered, and ilst points to the first row of the current position of the block being moved.

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.

8
Parallelism and Performance

f08yff (dtgexc) 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 complex analogue of this routine is f08ytf (ztgexc).

10
Example

This example exchanges blocks 2 and 1 of the matrix pair S,T, where
S = 4.0 1.0 1.0 2.0 0.0 3.0 4.0 1.0 0.0 1.0 3.0 1.0 0.0 0.0 0.0 6.0   and   T= 2.0 1.0 1.0 3.0 0.0 1.0 2.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 2.0 .  

10.1
Program Text

Program Text (f08yffe.f90)

10.2
Program Data

Program Data (f08yffe.d)

10.3
Program Results

Program Results (f08yffe.r)

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