NAG CL Interface
f08yfc (dtgexc)

Settings help

CL Name Style:


1 Purpose

f08yfc reorders the generalized Schur factorization of a matrix pair in real generalized Schur form.

2 Specification

#include <nag.h>
void  f08yfc (Nag_OrderType order, Nag_Boolean wantq, Nag_Boolean wantz, Integer n, double a[], Integer pda, double b[], Integer pdb, double q[], Integer pdq, double z[], Integer pdz, Integer *ifst, Integer *ilst, NagError *fail)
The function may be called by the names: f08yfc, nag_lapackeig_dtgexc or nag_dtgexc.

3 Description

f08yfc reorders the generalized real n×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×1 and 2×2 diagonal blocks and T is upper triangular as returned, for example, by f08xcc, or f08xec with job=Nag_Schur.
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 https://www.netlib.org/lapack/lug

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: wantq Nag_Boolean Input
On entry: if wantq=Nag_TRUE, update the left transformation matrix Q.
If wantq=Nag_FALSE, do not update Q.
3: wantz Nag_Boolean Input
On entry: if wantz=Nag_TRUE, update the right transformation matrix Z.
If wantz=Nag_FALSE, do not update Z.
4: n Integer Input
On entry: n, the order of the matrices S and T.
Constraint: n0.
5: a[dim] double Input/Output
Note: the dimension, dim, of the array a must be at least max(1,pda×n).
The (i,j)th 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^.
6: pda Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array a.
Constraint: pdamax(1,n).
7: b[dim] double Input/Output
Note: the dimension, dim, of the array b must be at least max(1,pdb×n).
The (i,j)th 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^
8: pdb Integer Input
On entry: the stride separating row or column elements (depending on the value of order) in the array b.
Constraint: pdbmax(1,n).
9: q[dim] double Input/Output
Note: the dimension, dim, of the array q must be at least
  • max(1,pdq×n) when wantq=Nag_TRUE;
  • 1 otherwise.
The (i,j)th 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 orthogonal matrix Q.
On exit: if wantq=Nag_TRUE, the updated matrix QQ^.
If wantq=Nag_FALSE, q is not referenced.
10: pdq Integer Input
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 max(1,n) ;
  • otherwise pdq1.
11: z[dim] double Input/Output
Note: the dimension, dim, of the array z must be at least
  • max(1,pdz×n) when wantz=Nag_TRUE;
  • 1 otherwise.
The (i,j)th 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 orthogonal matrix Z.
On exit: if wantz=Nag_TRUE, the updated matrix ZZ^.
If wantz=Nag_FALSE, z is not referenced.
12: pdz Integer Input
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 max(1,n) ;
  • otherwise pdz1.
13: ifst Integer * Input/Output
14: ilst Integer * Input/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×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.
15: 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_CONSTRAINT
Constraint: if wantq=Nag_TRUE, pdq max(1,n) ;
otherwise pdq1.
Constraint: if wantz=Nag_TRUE, pdz max(1,n) ;
otherwise pdz1.
NE_INT
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: pdamax(1,n).
On entry, pdb=value and n=value.
Constraint: pdbmax(1,n).
NE_INT_3
On entry, ifst=value, ilst=value and n=value.
Constraint: 1ifstn and 1ilstn.
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.
NE_SCHUR
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

Background information to multithreading can be found in the Multithreading documentation.
f08yfc 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 complex analogue of this function is f08ytc.

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 (f08yfce.c)

10.2 Program Data

Program Data (f08yfce.d)

10.3 Program Results

Program Results (f08yfce.r)