NAG Library Function Document
nag_dtrexc (f08qfc)
1
Purpose
nag_dtrexc (f08qfc) reorders the Schur factorization of a real general matrix.
2
Specification
#include <nag.h> |
#include <nagf08.h> |
void |
nag_dtrexc (Nag_OrderType order,
Nag_ComputeQType compq,
Integer n,
double t[],
Integer pdt,
double q[],
Integer pdq,
Integer *ifst,
Integer *ilst,
NagError *fail) |
|
3
Description
nag_dtrexc (f08qfc) 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 .
4
References
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
5
Arguments
- 1:
– Nag_OrderTypeInput
-
On entry: the
order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by
. See
Section 3.3.1.3 in How to Use the NAG Library and its Documentation for a more detailed explanation of the use of this argument.
Constraint:
or .
- 2:
– Nag_ComputeQTypeInput
-
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:
– IntegerInput
-
On entry: , the order of the matrix .
Constraint:
.
- 4:
– doubleInput/Output
-
Note: the dimension,
dim, of the array
t
must be at least
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the
by
upper quasi-triangular matrix
in canonical Schur form, as returned by
nag_dhseqr (f08pec).
On exit:
t is overwritten by the updated matrix
. See also
Section 9.
- 5:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
t.
Constraint:
.
- 6:
– doubleInput/Output
-
Note: the dimension,
dim, of the array
q
must be at least
- when
;
- when
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: if
,
q must contain the
by
orthogonal matrix
of Schur vectors.
On exit: if
,
q contains the updated matrix of Schur vectors.
If
,
q is not referenced.
- 7:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
q.
Constraints:
- if , ;
- if , .
- 8:
– Integer *Input/Output
- 9:
– Integer *Input/Output
-
On entry:
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.
On exit: 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
).
Constraint:
and .
- 10:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.7 in How to Use the NAG Library and its Documentation).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_ENUM_INT_2
-
On entry, , and .
Constraint: if , ;
if , .
- NE_EXCHANGE
-
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
.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
- NE_INT_3
-
On entry, , and .
Constraint: and .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
7
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.
8
Parallelism and Performance
nag_dtrexc (f08qfc) 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 function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
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_ztrexc (f08qtc).
10
Example
This example reorders the Schur factorization of the matrix
so that the
by
block with row index
is moved to row
, where
10.1
Program Text
Program Text (f08qfce.c)
10.2
Program Data
Program Data (f08qfce.d)
10.3
Program Results
Program Results (f08qfce.r)