hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_dtrsen (f08qg)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

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 A=QTQT, so that a selected cluster of eigenvalues appears in the leading diagonal elements or blocks of the Schur form.
The reordered Schur form T~ is computed by an orthogonal similarity transformation: T~=ZTTZ. Optionally the updated matrix Q~ of Schur vectors is computed as Q~=QZ, giving A=Q~T~Q~T.
Let T~= T11 T12 0 T22 , where the selected eigenvalues are precisely the eigenvalues of the leading m by m sub-matrix T11. Let Q~ be correspondingly partitioned as Q1 Q2  where Q1 consists of the first m columns of Q. Then AQ1=Q1T11, and so the m columns of Q1 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:     job – string (length ≥ 1)
Indicates whether condition numbers are required for the cluster of eigenvalues and/or the invariant subspace.
job='N'
No condition numbers are required.
job='E'
Only the condition number for the cluster of eigenvalues is computed.
job='V'
Only the condition number for the invariant subspace is computed.
job='B'
Condition numbers for both the cluster of eigenvalues and the invariant subspace are computed.
Constraint: job='N', 'E', 'V' or 'B'.
2:     compq – string (length ≥ 1)
Indicates whether the matrix Q of Schur vectors is to be updated.
compq='V'
The matrix Q of Schur vectors is updated.
compq='N'
No Schur vectors are updated.
Constraint: compq='V' or 'N'.
3:     select: – logical array
The dimension of the array select must be at least max1,n
The eigenvalues in the selected cluster. To select a real eigenvalue λj, selectj must be set true. To select a complex conjugate pair of eigenvalues λj and λj+1 (corresponding to a 2 by 2 diagonal block), selectj and/or selectj+1 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:     tldt: – double array
The first dimension of the array t must be at least max1,n.
The second dimension of the array t must be at least max1,n.
The n by n upper quasi-triangular matrix T in canonical Schur form, as returned by nag_lapack_dhseqr (f08pe). See also Further Comments.
5:     qldq: – double array
The first dimension, ldq, of the array q must satisfy
  • if compq='V', ldq max1,n ;
  • if compq='N', ldq1.
The second dimension of the array q must be at least max1,n if compq='V' and at least 1 if compq='N'.
If compq='V', q must contain the n by n orthogonal matrix Q of Schur vectors, as returned by nag_lapack_dhseqr (f08pe).

Optional Input Parameters

1:     n 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.)
n, the order of the matrix T.
Constraint: n0.

Output Parameters

1:     tldt: – double array
The first dimension of the array t will be max1,n.
The second dimension of the array t will be max1,n.
t stores the updated matrix T~.
2:     qldq: – double array
The first dimension, ldq, of the array q will be
  • if compq='V', ldq= max1,n ;
  • if compq='N', ldq=1.
The second dimension of the array q will be max1,n if compq='V' and at least 1 if compq='N'.
If compq='V', q contains the updated matrix of Schur vectors; the first m columns of Q form an orthonormal basis for the specified invariant subspace.
If compq='N', q is not referenced.
3:     wr: – double array
4:     wi: – double array
The dimension of the arrays wr and wi will be max1,n
The real and imaginary parts, respectively, of the reordered eigenvalues of T~. The eigenvalues are stored in the same order as on the diagonal of T~; 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:     m int64int32nag_int scalar
m, the dimension of the specified invariant subspace. The value of m is obtained by counting 1 for each selected real eigenvalue and 2 for each selected complex conjugate pair of eigenvalues (see select); 0mn.
6:     s – double scalar
If job='E' or 'B', s is a lower bound on the reciprocal condition number of the average of the selected cluster of eigenvalues. If m=0​ or ​n, s=1; if info=1 (see Error Indicators and Warnings), s is set to zero.
If job='N' or 'V', s is not referenced.
7:     sep – double scalar
If job='V' or 'B', sep is the estimated reciprocal condition number of the specified invariant subspace. If m=0​ or ​n, sep=T; if info=1 (see Error Indicators and Warnings), sep is set to zero.
If job='N' or 'E', sep is not referenced.
8:     info int64int32nag_int scalar
info=0 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.

   info=-i
If info=-i, parameter i 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  info=1
The reordering of T 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, T may have been partially reordered, but wr, wi and Q (if requested) are updated consistently with T; s and sep (if requested) are both set to zero.

Accuracy

The computed matrix T~ is similar to a matrix T+E, where
E2 = Oε T2 ,  
and ε is the machine precision.
s cannot underestimate the true reciprocal condition number by more than a factor of minm,n-m. sep may differ from the true value by mn-m. The angle between the computed invariant subspace and the true subspace is OεA2sep .
Note that if a 2 by 2 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 2 by 2 block to break into two 1 by 1 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 T must be in canonical Schur form, as is the output matrix T~. This has the following structure.
If all the computed eigenvalues are real, T~ is upper triangular, and the diagonal elements of T~ are the eigenvalues; wri=t~ii, for i=1,2,,n and wii=0.0.
If some of the computed eigenvalues form complex conjugate pairs, then T~ has 2 by 2 diagonal blocks. Each diagonal block has the form
t~ii t~i,i+1 t~i+1,i t~i+1,i+1 = α β γ α  
where βγ<0. The corresponding eigenvalues are α±βγ; wri=wri+1=α; wii=+βγ; wii+1=-wii.
The complex analogue of this function is nag_lapack_ztrsen (f08qu).

Example

This example reorders the Schur factorization of the matrix A=QTQT such that the two real eigenvalues appear as the leading elements on the diagonal of the reordered matrix T~, where
T = 0.7995 -0.1144 0.0060 0.0336 0.0000 -0.0994 0.2478 0.3474 0.0000 -0.6483 -0.0994 0.2026 0.0000 0.0000 0.0000 -0.1007  
and
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 .  
The example program for nag_lapack_dtrsen (f08qg) illustrates the computation of error bounds for the eigenvalues.
The original matrix A is given in Example in nag_lapack_dorghr (f08nf).
function f08qg_example


fprintf('f08qg example results\n\n');

% Matrices Q and T from reduction of a matrix A to Schur form
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];

% Recombine to form A
a = q*t*transpose(q);
disp('Original matrix A from Schur factors')
disp(a);

% First and last eigenvalues and correponding invariant subspace
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)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015