NAG Library Routine Document
F08YGF (DTGSEN)
1 Purpose
F08YGF (DTGSEN) reorders the generalized Schur factorization of a matrix pair in real generalized Schur form, so that a selected cluster of eigenvalues appears in the leading elements, or blocks 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
SUBROUTINE F08YGF ( |
IJOB, WANTQ, WANTZ, SELECT, N, A, LDA, B, LDB, ALPHAR, ALPHAI, BETA, Q, LDQ, Z, LDZ, M, PL, PR, DIF, WORK, LWORK, IWORK, LIWORK, INFO) |
INTEGER |
IJOB, N, LDA, LDB, LDQ, LDZ, M, LWORK, IWORK(*), LIWORK, INFO |
REAL (KIND=nag_wp) |
A(LDA,*), B(LDB,*), ALPHAR(N), ALPHAI(N), BETA(N), Q(LDQ,*), Z(LDZ,*), PL, PR, DIF(*), WORK(max(1,LWORK)) |
LOGICAL |
WANTQ, WANTZ, SELECT(N) |
|
The routine may be called by its
LAPACK
name dtgsen.
3 Description
F08YGF (DTGSEN) factorizes the generalized real
n by
n matrix pair
S,T in real generalized Schur form, using an orthogonal equivalence transformation as
where
S^,T^ are also in real generalized Schur form and have the selected eigenvalues as the leading diagonal elements, or diagonal blocks. 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 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'. The diagonal elements, or blocks, define the generalized eigenvalues
αi,βi, for
i=1,2,…,n, of the pair
S,T. The eigenvalues are given by
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
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/lug5 Parameters
- 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:
0≤IJOB≤5.
- 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: SELECT(N) – LOGICAL arrayInput
On entry: specifies the eigenvalues in the selected cluster. To select a real eigenvalue
λj,
SELECTj must be set to .TRUE..
To select a complex conjugate pair of eigenvalues λj and λj+1, corresponding to a 2 by 2 diagonal block, either SELECTj or SELECTj+1 or both must be set to .TRUE.; a complex conjugate pair of eigenvalues must be either both included in the cluster or both excluded.
- 5: N – INTEGERInput
On entry: n, the order of the matrices S and T.
Constraint:
N≥0.
- 6: A(LDA,*) – 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^.
- 7: LDA – INTEGERInput
On entry: the first dimension of the array
A as declared in the (sub)program from which F08YGF (DTGSEN) is called.
Constraint:
LDA≥max1,N.
- 8: B(LDB,*) – 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^
- 9: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F08YGF (DTGSEN) is called.
Constraint:
LDB≥max1,N.
- 10: ALPHAR(N) – REAL (KIND=nag_wp) arrayOutput
On exit: see the description of
BETA.
- 11: ALPHAI(N) – REAL (KIND=nag_wp) arrayOutput
On exit: see the description of
BETA.
- 12: BETA(N) – REAL (KIND=nag_wp) arrayOutput
On exit:
ALPHARj / BETAj and
ALPHAIj / BETAj are the real and imaginary parts respectively of the
jth eigenvalue, for
j=1,2,…,N.
If ALPHAIj is zero, then the jth eigenvalue is real; if positive then ALPHAIj+1 is negative, and the jth and j+1st eigenvalues are a complex conjugate pair.
Conjugate pairs of eigenvalues correspond to the
2 by
2 diagonal blocks of
S^. These
2 by
2 blocks can be reduced by applying complex unitary transformations to
S^,T^ to obtain the complex Schur form
S~,T~ , where
S~ is triangular (and complex). In this form
ALPHAR+iALPHAI and
BETA are the diagonals of
S~ and
T~ respectively.
- 13: Q(LDQ,*) – 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 n by n matrix Q.
On exit: if
WANTQ=.TRUE., the updated matrix
QQ^.
If
WANTQ=.FALSE.,
Q is not referenced.
- 14: LDQ – INTEGERInput
On entry: the first dimension of the array
Q as declared in the (sub)program from which F08YGF (DTGSEN) is called.
Constraints:
- if WANTQ=.TRUE., LDQ≥ max1,N ;
- otherwise LDQ≥1.
- 15: Z(LDZ,*) – 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 n by n matrix Z.
On exit: if
WANTZ=.TRUE., the updated matrix
ZZ^.
If
WANTZ=.FALSE.,
Z is not referenced.
- 16: LDZ – INTEGERInput
On entry: the first dimension of the array
Z as declared in the (sub)program from which F08YGF (DTGSEN) is called.
Constraints:
- if WANTZ=.TRUE., LDZ≥ max1,N ;
- otherwise LDZ≥1.
- 17: M – INTEGEROutput
On exit: the dimension of the specified pair of left and right eigenspaces (deflating subspaces).
- 18: PL – REAL (KIND=nag_wp)Output
- 19: 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 eigenspaces with respect to the selected cluster.
0<PL,
PR≤1.
If M=0 or M=N, PL=PR=1.
If
IJOB=0,
2 or
3,
PL and
PR are not referenced.
- 20: DIF(*) – REAL (KIND=nag_wp) arrayOutput
-
Note: the dimension of the array
DIF
must be at least
2.
On exit: if
IJOB≥2,
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.
- 21: WORK(max1,LWORK) – REAL (KIND=nag_wp) arrayWorkspace
On exit: if
INFO=0,
WORK1 returns the minimum
LWORK.
If
IJOB=0,
WORK is not referenced.
- 22: LWORK – INTEGERInput
On entry: the dimension of the array
WORK as declared in the (sub)program from which F08YGF (DTGSEN) 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 N=0, LWORK≥1;
- if IJOB=1, 2 or 4, LWORK≥max4×N+16,2×M×N-M;
- if IJOB=3 or 5, LWORK≥max4×N+16,4×M×N-M;
- otherwise LWORK≥4×N+16.
- 23: IWORK(*) – INTEGER arrayWorkspace
-
Note: the dimension of the array
IWORK
must be at least
max1,LIWORK.
On exit: if
INFO=0,
IWORK1 returns the minimum
LIWORK.
If
IJOB=0,
IWORK is not referenced.
- 24: LIWORK – INTEGERInput
On entry: the dimension of the array
IWORK as declared in the (sub)program from which F08YGF (DTGSEN) 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, LIWORK≥N+6;
- if IJOB=3 or 5, LIWORK≥max2×M×N-M,N+6;
- otherwise LIWORK≥1.
- 25: INFO – INTEGEROutput
On exit:
INFO=0 unless the routine detects an error (see
Section 6).
6 Error Indicators and Warnings
Errors or warnings detected by the routine:
- 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
S^,T^ 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:2,
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
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 Further Comments
The complex analogue of this routine is
F08YUF (ZTGSEN).
9 Example
This example reorders the generalized Schur factors
S and
T and update the matrices
Q and
Z given by
selecting the first and fourth 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.
9.1 Program Text
Program Text (f08ygfe.f90)
9.2 Program Data
Program Data (f08ygfe.d)
9.3 Program Results
Program Results (f08ygfe.r)