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_dtgsen (f08yg)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_dtgsen (f08yg) reorders the generalized Schur factorization of a matrix pair in real generalized Schur form, so that a selected cluster of eigenvalues appears in the leading elements, or blocks on the diagonal of the generalized Schur form. The function also, optionally, computes the reciprocal condition numbers of the cluster of eigenvalues and/or corresponding deflating subspaces.

Syntax

[a, b, alphar, alphai, beta, q, z, m, pl, pr, dif, info] = f08yg(ijob, wantq, wantz, select, a, b, q, z, 'n', n)
[a, b, alphar, alphai, beta, q, z, m, pl, pr, dif, info] = nag_lapack_dtgsen(ijob, wantq, wantz, select, a, b, q, z, 'n', n)

Description

nag_lapack_dtgsen (f08yg) factorizes the generalized real n by n matrix pair S,T in real generalized Schur form, using an orthogonal equivalence transformation as
S = Q^ S^ Z^T ,   T= Q^ T^ Z^T ,  
where S^,T^ are also in real generalized Schur form and have the selected eigenvalues as the leading diagonal elements, or diagonal blocks. The leading columns of Q and Z are the generalized Schur vectors corresponding to the selected eigenvalues and form orthonormal subspaces for the left and right eigenspaces (deflating subspaces) of the pair S,T.
The pair S,T are in real generalized Schur form if S is block upper triangular with 1 by 1 and 2 by 2 diagonal blocks and T is upper triangular as returned, for example, by nag_lapack_dgges (f08xa), or nag_lapack_dhgeqz (f08xe) with job='S'. The diagonal elements, or blocks, define the generalized eigenvalues αi,βi, for i=1,2,,n, of the pair S,T. The eigenvalues are given by
λi = αi / βi ,  
but are returned as the pair αi,βi in order to avoid possible overflow in computing λi. Optionally, the function returns reciprocals of condition number estimates for the selected eigenvalue cluster, p and q, the right and left projection norms, and of deflating subspaces, Difu and Difl. For more information see Sections 2.4.8 and 4.11 of Anderson et al. (1999).
If S and T are the result of a generalized Schur factorization of a matrix pair A,B 
A = QSZT ,   B= QTZT  
then, optionally, the matrices Q and Z can be updated as QQ^ and ZZ^. Note that the condition numbers of the pair S,T are the same as those of the pair A,B.

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:     ijob int64int32nag_int scalar
Specifies whether condition numbers are required for the cluster of eigenvalues (p and q) or the deflating subspaces (Difu and Difl).
ijob=0
Only reorder with respect to select. No extras.
ijob=1
Reciprocal of norms of ‘projections’ onto left and right eigenspaces with respect to the selected cluster (p and q).
ijob=2
The upper bounds on Difu and Difl. F-norm-based estimate (dif1:2).
ijob=3
Estimate of Difu and Difl. 1-norm-based estimate (dif1:2). About five times as expensive as ijob=2.
ijob=4
Compute pl, pr and dif as in ijob=0, 1 and 2. Economic version to get it all.
ijob=5
Compute pl, pr and dif as in ijob=0, 1 and 3.
Constraint: 0ijob5.
2:     wantq – logical scalar
If wantq=true, update the left transformation matrix Q.
If wantq=false, do not update Q.
3:     wantz – logical scalar
If wantz=true, update the right transformation matrix Z.
If wantz=false, do not update Z.
4:     selectn – logical array
Specifies the eigenvalues in the selected cluster. To select a real eigenvalue λj, selectj must be set to true.
To select a complex conjugate pair of eigenvalues λj and λj+1, corresponding to a 2 by 2 diagonal block, either selectj or selectj+1 or both must be set to true; a complex conjugate pair of eigenvalues must be either both included in the cluster or both excluded.
5:     alda: – double array
The first dimension of the array a must be at least max1,n.
The second dimension of the array a must be at least max1,n.
The matrix S in the pair S,T.
6:     bldb: – double array
The first dimension of the array b must be at least max1,n.
The second dimension of the array b must be at least max1,n.
The matrix T, in the pair S,T.
7:     qldq: – double array
The first dimension, ldq, of the array q must satisfy
  • if wantq=true, ldq max1,n ;
  • otherwise ldq1.
The second dimension of the array q must be at least max1,n if wantq=true, and at least 1 otherwise.
If wantq=true, the n by n matrix Q.
8:     zldz: – double array
The first dimension, ldz, of the array z must satisfy
  • if wantz=true, ldz max1,n ;
  • otherwise ldz1.
The second dimension of the array z must be at least max1,n if wantz=true, and at least 1 otherwise.
If wantz=true, the n by n matrix Z.

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the dimension of the array select and 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.)
n, the order of the matrices S and T.
Constraint: n0.

Output Parameters

1:     alda: – double array
The first dimension of the array a will be max1,n.
The second dimension of the array a will be max1,n.
The updated matrix S^.
2:     bldb: – double array
The first dimension of the array b will be max1,n.
The second dimension of the array b will be max1,n.
The updated matrix T^
3:     alpharn – double array
See the description of beta.
4:     alphain – double array
See the description of beta.
5:     betan – double array
alpharj / betaj and alphaij / betaj are the real and imaginary parts respectively of the jth eigenvalue, for j=1,2,,n.
If alphaij is zero, then the jth eigenvalue is real; if positive then alphaij+1 is negative, and the jth and j+1st eigenvalues are a complex conjugate pair.
Conjugate pairs of eigenvalues correspond to the 2 by 2 diagonal blocks of S^. These 2 by 2 blocks can be reduced by applying complex unitary transformations to S^,T^ to obtain the complex Schur form S~,T~ , where S~ is triangular (and complex). In this form alphar+ialphai and beta are the diagonals of S~ and T~ respectively.
6:     qldq: – double array
The first dimension, ldq, of the array q will be
  • if wantq=true, ldq= max1,n ;
  • otherwise ldq=1.
The second dimension of the array q will be max1,n if wantq=true and 1 otherwise.
If wantq=true, the updated matrix QQ^.
If wantq=false, q is not referenced.
7:     zldz: – double array
The first dimension, ldz, of the array z will be
  • if wantz=true, ldz= max1,n ;
  • otherwise ldz=1.
The second dimension of the array z will be max1,n if wantz=true and 1 otherwise.
If wantz=true, the updated matrix ZZ^.
If wantz=false, z is not referenced.
8:     m int64int32nag_int scalar
The dimension of the specified pair of left and right eigenspaces (deflating subspaces).
9:     pl – double scalar
10:   pr – double scalar
If ijob=1, 4 or 5, pl and pr are lower bounds on the reciprocal of the norm of ‘projections’ p and q onto left and right eigenspaces with respect to the selected cluster. 0<pl, pr1.
If m=0 or m=n, pl=pr=1.
If ijob=0, 2 or 3, pl and pr are not referenced.
11:   dif: – double array
The dimension of the array dif will be 2
If ijob2, dif1:2 store the estimates of Difu and Difl.
If ijob=2 or 4, dif1:2 are F-norm-based upper bounds on Difu and Difl.
If ijob=3 or 5, dif1:2 are 1-norm-based estimates of Difu and Difl.
If m=0 or n, dif1:2 =A,BF.
If ijob=0 or 1, dif is not referenced.
12:   info int64int32nag_int scalar
info=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

   info=-i
If info=-i, parameter i had an illegal value on entry. The parameters are numbered as follows:
1: ijob, 2: wantq, 3: wantz, 4: select, 5: n, 6: a, 7: lda, 8: b, 9: ldb, 10: alphar, 11: alphai, 12: beta, 13: q, 14: ldq, 15: z, 16: ldz, 17: m, 18: pl, 19: pr, 20: dif, 21: work, 22: lwork, 23: iwork, 24: liwork, 25: 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.
   info=1
Reordering of S,T failed because the transformed matrix pair S^,T^ would be too far from generalized Schur form; the problem is very ill-conditioned. S,T may have been partially reordered. If requested, 0 is returned in dif1:2, pl and pr.

Accuracy

The computed generalized Schur form is nearly the exact generalized Schur form for nearby matrices S+E and T+F, where
E2 = Oε S2   and   F2= Oε T2 ,  
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, and for information on the condition numbers returned.

Further Comments

The complex analogue of this function is nag_lapack_ztgsen (f08yu).

Example

This example reorders the generalized Schur factors S and T and update the matrices Q and Z given by
S = 4.0 1.0 1.0 2.0 0.0 3.0 4.0 1.0 0.0 1.0 3.0 1.0 0.0 0.0 0.0 6.0 ,   T= 2.0 1.0 1.0 3.0 0.0 1.0 2.0 1.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 2.0 ,  
Q = 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0   and   Z= 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 ,  
selecting the first and fourth generalized eigenvalues to be moved to the leading positions. Bases for the left and right deflating subspaces, and estimates of the condition numbers for the eigenvalues and Frobenius norm based bounds on the condition numbers for the deflating subspaces are also output.
function f08yg_example


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

% Generalized Schur form matrix pair
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];

% Want equivalence transformation matrices Q and Z
wantq = true;
wantz = true;
Q = eye(n);
Z = Q;

% reorder 1st and 4th eigenvalues, and
% get projection norms and upper bound estimates
select = [true;     false;     false;     true];
ijob = int64(4);

% Reorder the Schur factors a and b and update the matrices q and z
[S, T, alphar, alphai, beta, Q, Z, m, pl, pr, dif, info] = ...
f08yg( ...
       ijob, wantq, wantz, select, S, T, Q, Z);

fprintf('Number of selected eigenvalues  = %4d\n\n', m);
eigs = alphar./beta + i*alphai./beta;
disp('Selected Generalized Eigenvalues')
disp(eigs(1:m));
fprintf('%s%s\n%10.2e\n', ...
        'Norm estimate of projection onto  left eigenspace ', ...
        'for selected cluster', 1/pl);
fprintf('\n%s%s\n%10.2e\n', ...
        'Norm estimate of projection onto right eigenspace ', ...
        'for selected cluster', 1/pr);
fprintf('\nF-norm based upper bound on Difu\n%10.2e\n', dif(1));
fprintf('\nF-norm based upper bound on Difl\n%10.2e\n', dif(2));


f08yg example results

Number of selected eigenvalues  =    2

Selected Generalized Eigenvalues
    2.0000
    3.0000

Norm estimate of projection onto  left eigenspace for selected cluster
  2.69e+00

Norm estimate of projection onto right eigenspace for selected cluster
  1.50e+00

F-norm based upper bound on Difu
  2.52e-01

F-norm based upper bound on Difl
  2.45e-01

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