PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dtgexc (f08yf)
Purpose
nag_lapack_dtgexc (f08yf) reorders the generalized Schur factorization of a matrix pair in real generalized Schur form.
Syntax
[
a,
b,
q,
z,
ifst,
ilst,
info] = f08yf(
wantq,
wantz,
a,
b,
q,
z,
ifst,
ilst, 'n',
n)
[
a,
b,
q,
z,
ifst,
ilst,
info] = nag_lapack_dtgexc(
wantq,
wantz,
a,
b,
q,
z,
ifst,
ilst, 'n',
n)
Description
nag_lapack_dtgexc (f08yf) reorders the generalized real
by
matrix pair
in real generalized Schur form, so that the diagonal element or block of
with row index
is moved to row
, using an orthogonal equivalence transformation. That is,
and
are factorized as
where
are also in real generalized Schur form.
The pair
are in real generalized Schur form if
is block upper triangular with
by
and
by
diagonal blocks and
is upper triangular as returned, for example, by
nag_lapack_dgges (f08xa), or
nag_lapack_dhgeqz (f08xe) with
.
If
and
are the result of a generalized Schur factorization of a matrix pair
then, optionally, the matrices
and
can be updated as
and
.
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/lug
Parameters
Compulsory Input Parameters
- 1:
– logical scalar
-
If
, update the left transformation matrix
.
If , do not update .
- 2:
– logical scalar
-
If
, update the right transformation matrix
.
If , do not update .
- 3:
– double array
-
The first dimension of the array
a must be at least
.
The second dimension of the array
a must be at least
.
The matrix in the pair .
- 4:
– double array
-
The first dimension of the array
b must be at least
.
The second dimension of the array
b must be at least
.
The matrix , in the pair .
- 5:
– double array
-
The first dimension,
, of the array
q must satisfy
- if , ;
- otherwise .
The second dimension of the array
q must be at least
if
, and at least
otherwise.
If , the orthogonal matrix .
- 6:
– double array
-
The first dimension,
, of the array
z must satisfy
- if , ;
- otherwise .
The second dimension of the array
z must be at least
if
, and at least
otherwise.
If , the orthogonal matrix .
- 7:
– int64int32nag_int scalar
- 8:
– int64int32nag_int scalar
-
The indices
and
that specify the reordering of the diagonal blocks of
. The block with row index
ifst is moved to row
ilst, by a sequence of swapping between adjacent blocks.
Constraint:
and .
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the arrays
a,
b and the second dimension of the arrays
a,
b. (An error is raised if these dimensions are not equal.)
, the order of the matrices and .
Constraint:
.
Output Parameters
- 1:
– double array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
The updated matrix .
- 2:
– double array
-
The first dimension of the array
b will be
.
The second dimension of the array
b will be
.
The updated matrix
- 3:
– double array
-
The first dimension,
, of the array
q will be
- if , ;
- otherwise .
The second dimension of the array
q will be
if
and
otherwise.
If
, the updated matrix
.
If
,
q is not referenced.
- 4:
– double array
-
The first dimension,
, of the array
z will be
- if , ;
- otherwise .
The second dimension of the array
z will be
if
and
otherwise.
If
, the updated matrix
.
If
,
z is not referenced.
- 5:
– int64int32nag_int scalar
- 6:
– int64int32nag_int scalar
-
If
ifst pointed on entry to the second row of a
by
block, 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
or
).
- 7:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
-
If , parameter had an illegal value on entry. The parameters are numbered as follows:
1:
wantq, 2:
wantz, 3:
n, 4:
a, 5:
lda, 6:
b, 7:
ldb, 8:
q, 9:
ldq, 10:
z, 11:
ldz, 12:
ifst, 13:
ilst, 14:
work, 15:
lwork, 16:
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.
-
-
The transformed matrix pair
would be too far from generalized Schur form; the problem is ill-conditioned.
may have been partially reordered, and
ilst points to the first row of the current position of the block being moved.
Accuracy
The computed generalized Schur form is nearly the exact generalized Schur form for nearby matrices
and
, 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.
Further Comments
The complex analogue of this function is
nag_lapack_ztgexc (f08yt).
Example
This example exchanges blocks
and
of the matrix pair
, where
Open in the MATLAB editor:
f08yf_example
function f08yf_example
fprintf('f08yf example results\n\n');
n = 4;
S = [4, 1, 1, 2;
0, 3, 4, 1;
0, 1, 3, 1;
0, 0, 0, 6];
T = [2, 1, 1, 3;
0, 1, 2, 1;
0, 0, 1, 1;
0, 0, 0, 2];
ifst = int64(2);
ilst = int64(1);
wantq = false;
wantz = false;
q = zeros(n,1);
z = q;
[S, T, ~, ~, ifst, ilst, info] = ...
f08yf( ...
wantq, wantz, S, T, q, z, ifst, ilst);
for i = 1:n
j = max(i-1,1);
while (S(i,j)==0 && j<n)
j = j + 1;
end
if S(i,j)<0
S(i,j:n) = -S(i,j:n);
T(i,i:n) = -T(i,i:n);
end
end
disp('Reordered Schur matrix S');
disp(S);
disp('Reordered Schur matrix T');
disp(T);
f08yf example results
Reordered Schur matrix S
4.1926 1.2591 2.5578 0.4520
0.8712 -0.8627 -2.7912 -1.1383
0 0 4.2426 2.1213
0 0 0 6.0000
Reordered Schur matrix T
1.7439 0 0.7533 0.0661
0 -0.5406 -1.8972 -1.7308
0 0 2.1213 2.8284
0 0 0 2.0000
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015