PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dtrexc (f08qf)
Purpose
nag_lapack_dtrexc (f08qf) reorders the Schur factorization of a real general matrix.
Syntax
[
t,
q,
ifst,
ilst,
info] = f08qf(
compq,
t,
q,
ifst,
ilst, 'n',
n)
[
t,
q,
ifst,
ilst,
info] = nag_lapack_dtrexc(
compq,
t,
q,
ifst,
ilst, 'n',
n)
Description
nag_lapack_dtrexc (f08qf) reorders the Schur factorization of a real general matrix
, so that the diagonal element or block of
with row index
ifst is moved to row
ilst.
The reordered Schur form is computed by an orthogonal similarity transformation: . Optionally the updated matrix of Schur vectors is computed as , giving .
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 the matrix
of Schur vectors is to be updated.
- The matrix of Schur vectors is updated.
- No Schur vectors are updated.
Constraint:
or .
- 2:
– 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).
- 3:
– 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.
- 4:
– int64int32nag_int scalar
- 5:
– int64int32nag_int scalar
-
ifst and
ilst must specify the reordering of the diagonal elements or blocks of
. The element or block with row index
ifst is moved to row
ilst by a sequence of exchanges between adjacent elements or blocks.
Constraint:
and .
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
. See also
Further Comments.
- 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.
If
,
q is not referenced.
- 3:
– int64int32nag_int scalar
- 4:
– int64int32nag_int scalar
-
If
ifst pointed to the second row of a
by
block on entry, 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
).
- 5:
– 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:
compq, 2:
n, 3:
t, 4:
ldt, 5:
q, 6:
ldq, 7:
ifst, 8:
ilst, 9:
work, 10:
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
-
Two adjacent diagonal elements or blocks could not be successfully exchanged. This error can only occur if the exchange involves at least one
by
block; it implies that the problem is very ill-conditioned, and that the eigenvalues of the two blocks are very close. On exit,
may have been partially reordered, and
ilst points to the first row of the current position of the block being moved;
(if requested) is updated consistently with
.
Accuracy
The computed matrix
is exactly similar to a matrix
, where
and
is the
machine precision.
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 total number of floating-point operations is approximately if , and if , where .
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 its diagonal elements are the eigenvalues.
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_ztrexc (f08qt).
Example
This example reorders the Schur factorization of the matrix
so that the
by
block with row index
is moved to row
, where
Open in the MATLAB editor:
f08qf_example
function f08qf_example
fprintf('f08qf example results\n\n');
t = [0.8, -0.11, 0.01, 0.03;
0, -0.11, 0.25, 0.35;
0, -0.65, -0.10, 0.20;
0, 0, 0, -0.10];
compq = 'No update';
q = [0];
ifst = int64(2);
ilst = int64(1);
[t, q, ifst, ilst, info] = f08qf( ...
compq, t, q, ifst, ilst);
disp('Reordered Schur Form');
disp(t);
f08qf example results
Reordered Schur Form
-0.1050 -0.6465 0.0877 0.2054
0.2513 -0.1050 0.0919 0.3480
0 0 0.8000 -0.0113
0 0 0 -0.1000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015