F08QGF (DTRSEN) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F08QGF (DTRSEN)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

F08QGF (DTRSEN) reorders the Schur factorization of a real general matrix so that a selected cluster of eigenvalues appears in the leading elements or blocks on the diagonal of the Schur form. The routine also optionally computes the reciprocal condition numbers of the cluster of eigenvalues and/or the invariant subspace.

2  Specification

SUBROUTINE F08QGF ( JOB, COMPQ, SELECT, N, T, LDT, Q, LDQ, WR, WI, M, S, SEP, WORK, LWORK, IWORK, LIWORK, INFO)
INTEGER  N, LDT, LDQ, M, LWORK, IWORK(max(1,LIWORK)), LIWORK, INFO
REAL (KIND=nag_wp)  T(LDT,*), Q(LDQ,*), WR(*), WI(*), S, SEP, WORK(max(1,LWORK))
LOGICAL  SELECT(*)
CHARACTER(1)  JOB, COMPQ
The routine may be called by its LAPACK name dtrsen.

3  Description

F08QGF (DTRSEN) reorders the Schur factorization of a real general matrix A=QTQT, so that a selected cluster of eigenvalues appears in the leading diagonal elements or blocks of the Schur form.
The reordered Schur form T~ is computed by an orthogonal similarity transformation: T~=ZTTZ. Optionally the updated matrix Q~ of Schur vectors is computed as Q~=QZ, giving A=Q~T~Q~T.
Let T~= T11 T12 0 T22 , where the selected eigenvalues are precisely the eigenvalues of the leading m by m sub-matrix T11. Let Q~ be correspondingly partitioned as Q1 Q2  where Q1 consists of the first m columns of Q. Then AQ1=Q1T11, and so the m columns of Q1 form an orthonormal basis for the invariant subspace corresponding to the selected cluster of eigenvalues.
Optionally the routine also computes estimates of the reciprocal condition numbers of the average of the cluster of eigenvalues and of the invariant subspace.

4  References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

5  Parameters

1:     JOB – CHARACTER(1)Input
On entry: indicates whether condition numbers are required for the cluster of eigenvalues and/or the invariant subspace.
JOB='N'
No condition numbers are required.
JOB='E'
Only the condition number for the cluster of eigenvalues is computed.
JOB='V'
Only the condition number for the invariant subspace is computed.
JOB='B'
Condition numbers for both the cluster of eigenvalues and the invariant subspace are computed.
Constraint: JOB='N', 'E', 'V' or 'B'.
2:     COMPQ – CHARACTER(1)Input
On entry: indicates whether the matrix Q of Schur vectors is to be updated.
COMPQ='V'
The matrix Q of Schur vectors is updated.
COMPQ='N'
No Schur vectors are updated.
Constraint: COMPQ='V' or 'N'.
3:     SELECT(*) – LOGICAL arrayInput
Note: the dimension of the array SELECT must be at least max1,N.
On entry: the eigenvalues in the selected cluster. To select a real eigenvalue λj, SELECTj must be set .TRUE.. To select a complex conjugate pair of eigenvalues λj and λj+1 (corresponding to a 2 by 2 diagonal block), SELECTj and/or SELECTj+1 must be set to .TRUE.. A complex conjugate pair of eigenvalues must be either both included in the cluster or both excluded. See also Section 8.
4:     N – INTEGERInput
On entry: n, the order of the matrix T.
Constraint: N0.
5:     T(LDT,*) – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array T must be at least max1,N.
On entry: the n by n upper quasi-triangular matrix T in canonical Schur form, as returned by F08PEF (DHSEQR). See also Section 8.
On exit: T is overwritten by the updated matrix T~.
6:     LDT – INTEGERInput
On entry: the first dimension of the array T as declared in the (sub)program from which F08QGF (DTRSEN) is called.
Constraint: LDT max1,N .
7:     Q(LDQ,*) – REAL (KIND=nag_wp) arrayInput/Output
Note: the second dimension of the array Q must be at least max1,N if COMPQ='V' and at least 1 if COMPQ='N'.
On entry: if COMPQ='V', Q must contain the n by n orthogonal matrix Q of Schur vectors, as returned by F08PEF (DHSEQR).
On exit: if COMPQ='V', Q contains the updated matrix of Schur vectors; the first m columns of Q form an orthonormal basis for the specified invariant subspace.
If COMPQ='N', Q is not referenced.
8:     LDQ – INTEGERInput
On entry: the first dimension of the array Q as declared in the (sub)program from which F08QGF (DTRSEN) is called.
Constraints:
  • if COMPQ='V', LDQ max1,N ;
  • if COMPQ='N', LDQ1.
9:     WR(*) – REAL (KIND=nag_wp) arrayOutput
10:   WI(*) – REAL (KIND=nag_wp) arrayOutput
Note: the dimension of the arrays WR and WI must be at least max1,N.
On exit: the real and imaginary parts, respectively, of the reordered eigenvalues of T~. The eigenvalues are stored in the same order as on the diagonal of T~; see Section 8 for details. Note that if a complex eigenvalue is sufficiently ill-conditioned, then its value may differ significantly from its value before reordering.
11:   M – INTEGEROutput
On exit: m, the dimension of the specified invariant subspace. The value of m is obtained by counting 1 for each selected real eigenvalue and 2 for each selected complex conjugate pair of eigenvalues (see SELECT); 0mn.
12:   S – REAL (KIND=nag_wp)Output
On exit: if JOB='E' or 'B', S is a lower bound on the reciprocal condition number of the average of the selected cluster of eigenvalues. If M=0​ or ​N, S=1; if INFO=1 (see Section 6), S is set to zero.
If JOB='N' or 'V', S is not referenced.
13:   SEP – REAL (KIND=nag_wp)Output
On exit: if JOB='V' or 'B', SEP is the estimated reciprocal condition number of the specified invariant subspace. If M=0​ or ​N, SEP=T; if INFO=1 (see Section 6), SEP is set to zero.
If JOB='N' or 'E', SEP is not referenced.
14:   WORK(max1,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 F08QGF (DTRSEN) is called, unless LWORK=-1, in which case a workspace query is assumed and the routine only calculates the minimum dimension of WORK.
Constraints:
  • if JOB='N', LWORKmax1,N or LWORK=-1;
  • if JOB='E', LWORKmax1,m×N-m or LWORK=-1;
  • if JOB='V' or 'B', LWORKmax1,2m×N-m or LWORK=-1.
The actual amount of workspace required cannot exceed N2/4 if JOB='E' or N2/2 if JOB='V' or 'B'.
16:   IWORK(max1,LIWORK) – INTEGER arrayWorkspace
On exit: if INFO=0, IWORK1 contains the required minimal size of LIWORK.
17:   LIWORK – INTEGERInput
On entry: the dimension of the array IWORK as declared in the (sub)program from which F08QGF (DTRSEN) is called, unless LIWORK=-1, in which case a workspace query is assumed and the routine only calculates the minimum dimension of IWORK.
Constraints:
  • if JOB='N' or 'E', LIWORK1 or LIWORK=-1;
  • if JOB='V' or 'B', LIWORKmax1,m×N-m or LIWORK=-1.
The actual amount of workspace required cannot exceed N2/2 if JOB='V' or 'B'.
18:   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
The reordering of T failed because a selected eigenvalue was too close to an eigenvalue which was not selected; this error exit can only occur if at least one of the eigenvalues involved was complex. The problem is too ill-conditioned: consider modifying the selection of eigenvalues so that eigenvalues which are very close together are either all included in the cluster or all excluded. On exit, T may have been partially reordered, but WR, WI and Q (if requested) are updated consistently with T; S and SEP (if requested) are both set to zero.

7  Accuracy

The computed matrix T~ is similar to a matrix T+E, where
E2 = Oε T2 ,
and ε is the machine precision.
S cannot underestimate the true reciprocal condition number by more than a factor of minm,n-m. SEP may differ from the true value by mn-m. The angle between the computed invariant subspace and the true subspace is OεA2sep .
Note that if a 2 by 2 diagonal block is involved in the reordering, its off-diagonal elements are in general changed; the diagonal elements and the eigenvalues of the block are unchanged unless the block is sufficiently ill-conditioned, in which case they may be noticeably altered. It is possible for a 2 by 2 block to break into two 1 by 1 blocks, i.e., for a pair of complex eigenvalues to become purely real. The values of real eigenvalues however are never changed by the reordering.

8  Further Comments

The input matrix T must be in canonical Schur form, as is the output matrix T~. This has the following structure.
If all the computed eigenvalues are real, T~ is upper triangular, and the diagonal elements of T~ are the eigenvalues; WRi=t~ii, for i=1,2,,n and WIi=0.0.
If some of the computed eigenvalues form complex conjugate pairs, then T~ has 2 by 2 diagonal blocks. Each diagonal block has the form
t~ii t~i,i+1 t~i+1,i t~i+1,i+1 = α β γ α
where βγ<0. The corresponding eigenvalues are α±βγ; WRi=WRi+1=α; WIi=+βγ; WIi+1=-WIi.
The complex analogue of this routine is F08QUF (ZTRSEN).

9  Example

This example reorders the Schur factorization of the matrix A=QTQT such that the two real eigenvalues appear as the leading elements on the diagonal of the reordered matrix T~, where
T = 0.7995 -0.1144 0.0060 0.0336 0.0000 -0.0994 0.2478 0.3474 0.0000 -0.6483 -0.0994 0.2026 0.0000 0.0000 0.0000 -0.1007
and
Q = 0.6551 0.1037 0.3450 0.6641 0.5236 -0.5807 -0.6141 -0.1068 -0.5362 -0.3073 -0.2935 0.7293 0.0956 0.7467 -0.6463 0.1249 .
The example program for F08QGF (DTRSEN) illustrates the computation of error bounds for the eigenvalues.
The original matrix A is given in Section 9 in F08NFF (DORGHR).

9.1  Program Text

Program Text (f08qgfe.f90)

9.2  Program Data

Program Data (f08qgfe.d)

9.3  Program Results

Program Results (f08qgfe.r)


F08QGF (DTRSEN) (PDF version)
F08 Chapter Contents
F08 Chapter Introduction
NAG Library Manual

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