PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dtrsen (f08qg)
Purpose
nag_lapack_dtrsen (f08qg) 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 function also optionally computes the reciprocal condition numbers of the cluster of eigenvalues and/or the invariant subspace.
Syntax
[
t,
q,
wr,
wi,
m,
s,
sep,
info] = f08qg(
job,
compq,
select,
t,
q, 'n',
n)
[
t,
q,
wr,
wi,
m,
s,
sep,
info] = nag_lapack_dtrsen(
job,
compq,
select,
t,
q, 'n',
n)
Description
nag_lapack_dtrsen (f08qg) 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 function also computes estimates of the reciprocal condition numbers of the average of the cluster of eigenvalues and of the invariant subspace.
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
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:
– string (length ≥ 1)
-
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 array
-
The dimension of the array
select
must be at least
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
Further Comments.
- 4:
– double array
-
The first dimension of the array
t must be at least
.
The second dimension of the array
t must be at least
.
The
by
upper quasi-triangular matrix
in canonical Schur form, as returned by
nag_lapack_dhseqr (f08pe). See also
Further Comments.
- 5:
– double array
-
The first dimension,
, of the array
q must satisfy
- if , ;
- if , .
The second dimension of the array
q must be at least
if
and at least
if
.
If
,
q must contain the
by
orthogonal matrix
of Schur vectors, as returned by
nag_lapack_dhseqr (f08pe).
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the array
t and the second dimension of the array
t. (An error is raised if these dimensions are not equal.)
, the order of the matrix .
Constraint:
.
Output Parameters
- 1:
– double array
-
The first dimension of the array
t will be
.
The second dimension of the array
t will be
.
t stores the updated matrix
.
- 2:
– double array
-
The first dimension,
, of the array
q will be
- if , ;
- if , .
The second dimension of the array
q will be
if
and at least
if
.
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.
- 3:
– double array
- 4:
– double array
-
The dimension of the arrays
wr and
wi will be
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
Further Comments for details. Note that if a complex eigenvalue is sufficiently ill-conditioned, then its value may differ significantly from its value before reordering.
- 5:
– int64int32nag_int scalar
-
, 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);
.
- 6:
– double scalar
-
If
or
,
s is a lower bound on the reciprocal condition number of the average of the selected cluster of eigenvalues. If
,
; if
(see
Error Indicators and Warnings),
s is set to zero.
If
or
,
s is not referenced.
- 7:
– double scalar
-
If
or
,
sep is the estimated reciprocal condition number of the specified invariant subspace. If
,
; if
(see
Error Indicators and Warnings),
sep is set to zero.
If
or
,
sep is not referenced.
- 8:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
job, 2:
compq, 3:
select, 4:
n, 5:
t, 6:
ldt, 7:
q, 8:
ldq, 9:
wr, 10:
wi, 11:
m, 12:
s, 13:
sep, 14:
work, 15:
lwork, 16:
iwork, 17:
liwork, 18:
info.
It is possible that
info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
- W
-
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.
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.
Further Comments
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 function is
nag_lapack_ztrsen (f08qu).
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 nag_lapack_dtrsen (f08qg) illustrates the computation of error bounds for the eigenvalues.
The original matrix
is given in
Example in
nag_lapack_dorghr (f08nf).
Open in the MATLAB editor:
f08qg_example
function f08qg_example
fprintf('f08qg example results\n\n');
t = [0.7995, -0.1144, 0.0060, 0.0336;
0, -0.0994, 0.2478, 0.3474;
0, -0.6483, -0.0994, 0.2026;
0, 0, 0, -0.1007];
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];
a = q*t*transpose(q);
disp('Original matrix A from Schur factors')
disp(a);
job = 'Both';
compq = 'Vectors';
select = [true; false; false; true];
[t, q, wr, wi, m, s, sep, info] = f08qg( ...
job, compq, select, t, q);
fprintf('%s = %10.2e\n\n', ...
'Condition number estimate of the selected eigenvalues', 1/s);
fprintf('%s = %10.2e\n', ...
'Condition number estimate of the invariant subspace ', 1/sep);
f08qg example results
Original matrix A from Schur factors
0.3500 0.4500 -0.1400 -0.1700
0.0900 0.0700 -0.5399 0.3500
-0.4400 -0.3300 -0.0300 0.1700
0.2500 -0.3200 -0.1300 0.1100
Condition number estimate of the selected eigenvalues = 1.75e+00
Condition number estimate of the invariant subspace = 3.22e+00
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015