NAG Library Routine Document
f08qgf
(dtrsen)
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
Fortran Interface
Subroutine f08qgf ( |
job,
compq,
select,
n,
t,
ldt,
q,
ldq,
wr,
wi,
m,
s,
sep,
work,
lwork,
iwork,
liwork,
info) |
Integer, Intent (In) | :: |
n,
ldt,
ldq,
lwork,
liwork | Integer, Intent (Out) | :: |
m,
iwork(max(1,liwork)),
info | Real (Kind=nag_wp), Intent (Inout) | :: |
t(ldt,*),
q(ldq,*),
wr(*),
wi(*) | Real (Kind=nag_wp), Intent (Out) | :: |
s,
sep,
work(max(1,lwork)) | Logical, Intent (In) | :: |
select(*) | Character (1), Intent (In) | :: |
job,
compq |
|
C Header Interface
#include nagmk26.h
void |
f08qgf_ (
const char *job,
const char *compq,
const logical sel[],
const Integer *n,
double t[],
const Integer *ldt,
double q[],
const Integer *ldq,
double wr[],
double wi[],
Integer *m,
double *s,
double *sep,
double work[],
const Integer *lwork,
Integer iwork[],
const Integer *liwork,
Integer *info,
const Charlen length_job,
const Charlen length_compq) |
|
The routine may be called by its
LAPACK
name dtrsen.
3
Description
f08qgf (dtrsen) reorders the Schur factorization of a real general matrix , so that a selected cluster of eigenvalues appears in the leading diagonal elements or blocks of the Schur form.
The reordered Schur form is computed by an orthogonal similarity transformation: . Optionally the updated matrix of Schur vectors is computed as , giving .
Let , where the selected eigenvalues are precisely the eigenvalues of the leading by sub-matrix . Let be correspondingly partitioned as where consists of the first columns of . Then , and so the columns of 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
Arguments
- 1: – Character(1)Input
-
On entry: indicates whether condition numbers are required for the cluster of eigenvalues and/or the invariant subspace.
- No condition numbers are required.
- Only the condition number for the cluster of eigenvalues is computed.
- Only the condition number for the invariant subspace is computed.
- Condition numbers for both the cluster of eigenvalues and the invariant subspace are computed.
Constraint:
, , or .
- 2: – Character(1)Input
-
On entry: indicates whether the matrix
of Schur vectors is to be updated.
- The matrix of Schur vectors is updated.
- No Schur vectors are updated.
Constraint:
or .
- 3: – Logical arrayInput
-
Note: the dimension of the array
select
must be at least
.
On entry: the eigenvalues in the selected cluster. To select a real eigenvalue
,
must be set .TRUE.. To select a complex conjugate pair of eigenvalues
and
(corresponding to a
by
diagonal block),
and/or
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 9.
- 4: – IntegerInput
-
On entry: , the order of the matrix .
Constraint:
.
- 5: – Real (Kind=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
t
must be at least
.
On entry: the
by
upper quasi-triangular matrix
in canonical Schur form, as returned by
f08pef (dhseqr). See also
Section 9.
On exit:
t is overwritten by the updated matrix
.
- 6: – IntegerInput
-
On entry: the first dimension of the array
t as declared in the (sub)program from which
f08qgf (dtrsen) is called.
Constraint:
.
- 7: – Real (Kind=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
q
must be at least
if
and at least
if
.
On entry: if
,
q must contain the
by
orthogonal matrix
of Schur vectors, as returned by
f08pef (dhseqr).
On exit: if
,
q contains the updated matrix of Schur vectors; the first
columns of
form an orthonormal basis for the specified invariant subspace.
If
,
q is not referenced.
- 8: – IntegerInput
-
On entry: the first dimension of the array
q as declared in the (sub)program from which
f08qgf (dtrsen) is called.
Constraints:
- if , ;
- if , .
- 9: – Real (Kind=nag_wp) arrayOutput
- 10: – Real (Kind=nag_wp) arrayOutput
-
Note: the dimension of the arrays
wr and
wi
must be at least
.
On exit: the real and imaginary parts, respectively, of the reordered eigenvalues of
. The eigenvalues are stored in the same order as on the diagonal of
; see
Section 9 for details. Note that if a complex eigenvalue is sufficiently ill-conditioned, then its value may differ significantly from its value before reordering.
- 11: – IntegerOutput
-
On exit:
, the dimension of the specified invariant subspace. The value of
is obtained by counting
for each selected real eigenvalue and
for each selected complex conjugate pair of eigenvalues (see
select);
.
- 12: – Real (Kind=nag_wp)Output
-
On exit: if
or
,
s is a lower bound on the reciprocal condition number of the average of the selected cluster of eigenvalues. If
,
; if
(see
Section 6),
s is set to zero.
If
or
,
s is not referenced.
- 13: – Real (Kind=nag_wp)Output
-
On exit: if
or
,
sep is the estimated reciprocal condition number of the specified invariant subspace. If
,
; if
(see
Section 6),
sep is set to zero.
If
or
,
sep is not referenced.
- 14: – Real (Kind=nag_wp) arrayWorkspace
-
On exit: if
,
contains the minimum value of
lwork required for optimal performance.
- 15: – IntegerInput
-
On entry: the dimension of the array
work as declared in the (sub)program from which
f08qgf (dtrsen) is called, unless
, in which case a workspace query is assumed and the routine only calculates the minimum dimension of
work.
Constraints:
- if , or ;
- if , or ;
- if or , or .
The actual amount of workspace required cannot exceed if or if or .
- 16: – Integer arrayWorkspace
-
On exit: if
,
contains the required minimal size of
liwork.
- 17: – IntegerInput
-
On entry: the dimension of the array
iwork as declared in the (sub)program from which
f08qgf (dtrsen) is called, unless
, in which case a workspace query is assumed and the routine only calculates the minimum dimension of
iwork.
Constraints:
- if or , or ;
- if or , or .
The actual amount of workspace required cannot exceed if or .
- 18: – IntegerOutput
On exit:
unless the routine detects an error (see
Section 6).
6
Error Indicators and Warnings
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
The reordering of
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,
may have been partially reordered, but
wr,
wi and
(if requested) are updated consistently with
;
s and
sep (if requested) are both set to zero.
7
Accuracy
The computed matrix
is similar to a matrix
, where
and
is the
machine precision.
s cannot underestimate the true reciprocal condition number by more than a factor of
.
sep may differ from the true value by
. The angle between the computed invariant subspace and the true subspace is
.
Note that if a by 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 by block to break into two by 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
Parallelism and Performance
f08qgf (dtrsen) 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.
The input matrix must be in canonical Schur form, as is the output matrix . This has the following structure.
If all the computed eigenvalues are real, is upper triangular, and the diagonal elements of are the eigenvalues; , for and .
If some of the computed eigenvalues form complex conjugate pairs, then
has
by
diagonal blocks. Each diagonal block has the form
where
. The corresponding eigenvalues are
;
;
;
.
The complex analogue of this routine is
f08quf (ztrsen).
10
Example
This example reorders the Schur factorization of the matrix
such that the two real eigenvalues appear as the leading elements on the diagonal of the reordered matrix
, where
and
The example program for f08qgf (dtrsen) illustrates the computation of error bounds for the eigenvalues.
The original matrix
is given in
Section 10 in
f08nff (dorghr).
10.1
Program Text
Program Text (f08qgfe.f90)
10.2
Program Data
Program Data (f08qgfe.d)
10.3
Program Results
Program Results (f08qgfe.r)