PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dggesx (f08xb)
Purpose
nag_lapack_dggesx (f08xb) computes the generalized eigenvalues, the generalized real Schur form and, optionally, the left and/or right generalized Schur vectors for a pair of by real nonsymmetric matrices .
Estimates of condition numbers for selected generalized eigenvalue clusters and Schur vectors are also computed.
Syntax
[
a,
b,
sdim,
alphar,
alphai,
beta,
vsl,
vsr,
rconde,
rcondv,
info] = f08xb(
jobvsl,
jobvsr,
sort,
selctg,
sense,
a,
b, 'n',
n)
[
a,
b,
sdim,
alphar,
alphai,
beta,
vsl,
vsr,
rconde,
rcondv,
info] = nag_lapack_dggesx(
jobvsl,
jobvsr,
sort,
selctg,
sense,
a,
b, 'n',
n)
Description
The generalized real Schur factorization of
is given by
where
and
are orthogonal,
is upper triangular and
is upper quasi-triangular with
by
and
by
diagonal blocks. The generalized eigenvalues,
, of
are computed from the diagonals of
and
and satisfy
where
is the corresponding generalized eigenvector.
is actually returned as the pair
such that
since
, or even both
and
can be zero. The columns of
and
are the left and right generalized Schur vectors of
.
Optionally, nag_lapack_dggesx (f08xb) can order the generalized eigenvalues on the diagonals of so that selected eigenvalues are at the top left. The leading columns of and then form an orthonormal basis for the corresponding eigenspaces, the deflating subspaces.
nag_lapack_dggesx (f08xb) computes to have non-negative diagonal elements, and the by blocks of correspond to complex conjugate pairs of generalized eigenvalues. The generalized Schur factorization, before reordering, is computed by the algorithm.
The reciprocals of the condition estimates, the reciprocal values of the left and right projection norms, are returned in
and
respectively, for the selected generalized eigenvalues, together with reciprocal condition estimates for the corresponding left and right deflating subspaces, in
and
. See Section 4.11 of
Anderson et al. (1999) for further information.
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
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)
-
If
, do not compute the left Schur vectors.
If , compute the left Schur vectors.
Constraint:
or .
- 2:
– string (length ≥ 1)
-
If
, do not compute the right Schur vectors.
If , compute the right Schur vectors.
Constraint:
or .
- 3:
– string (length ≥ 1)
-
Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.
- Eigenvalues are not ordered.
- Eigenvalues are ordered (see selctg).
Constraint:
or .
- 4:
– function handle or string containing name of m-file
-
If
,
selctg is used to select generalized eigenvalues to the top left of the generalized Schur form.
If
,
selctg is not referenced by
nag_lapack_dggesx (f08xb), and may be called with the string
'f08xaz'.
[result] = selctg(ar, ai, b)
Input Parameters
- 1:
– double scalar
- 2:
– double scalar
- 3:
– double scalar
-
An eigenvalue
is selected if
is
true. If either one of a complex conjugate pair is selected, then both complex generalized eigenvalues are selected.
Note that in the ill-conditioned case, a selected complex generalized eigenvalue may no longer satisfy after ordering. in this case.
Output Parameters
- 1:
– logical scalar
-
for selected eigenvalues.
- 5:
– string (length ≥ 1)
-
Determines which reciprocal condition numbers are computed.
- None are computed.
- Computed for average of selected eigenvalues only.
- Computed for selected deflating subspaces only.
- Computed for both.
If , or , .
Constraint:
, , or .
- 6:
– 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 first of the pair of matrices, .
- 7:
– 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 second of the pair of matrices, .
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
.
a stores its generalized Schur form
.
- 2:
– double array
-
The first dimension of the array
b will be
.
The second dimension of the array
b will be
.
b stores its generalized Schur form
.
- 3:
– int64int32nag_int scalar
-
If
,
.
If
,
number of eigenvalues (after sorting) for which
selctg is
true. (Complex conjugate pairs for which
selctg is
true for either eigenvalue count as
.)
- 4:
– double array
-
See the description of
beta.
- 5:
– double array
-
See the description of
beta.
- 6:
– double array
-
, for
, will be the generalized eigenvalues.
, and
, for
, are the diagonals of the complex Schur form
that would result if the
by
diagonal blocks of the real Schur form of
were further reduced to triangular form using
by
complex unitary transformations.
If is zero, then the th eigenvalue is real; if positive, then the th and st eigenvalues are a complex conjugate pair, with negative.
Note: the quotients
and
may easily overflow or underflow, and
may even be zero. Thus, you should avoid naively computing the ratio
. However,
alphar and
alphai will always be less than and usually comparable with
in magnitude, and
beta will always be less than and usually comparable with
.
- 7:
– double array
-
The first dimension,
, of the array
vsl will be
- if , ;
- otherwise .
The second dimension of the array
vsl will be
if
and
otherwise.
If
,
vsl will contain the left Schur vectors,
.
If
,
vsl is not referenced.
- 8:
– double array
-
The first dimension,
, of the array
vsr will be
- if , ;
- otherwise .
The second dimension of the array
vsr will be
if
and
otherwise.
If
,
vsr will contain the right Schur vectors,
.
If
,
vsr is not referenced.
- 9:
– double array
-
If
or
,
and
contain the reciprocal condition numbers for the average of the selected eigenvalues.
If
or
,
rconde is not referenced.
- 10:
– double array
-
If
or
,
and
contain the reciprocal condition numbers for the selected deflating subspaces.
if
or
,
rcondv is not referenced.
- 11:
– 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:
jobvsl, 2:
jobvsr, 3:
sort, 4:
selctg, 5:
sense, 6:
n, 7:
a, 8:
lda, 9:
b, 10:
ldb, 11:
sdim, 12:
alphar, 13:
alphai, 14:
beta, 15:
vsl, 16:
ldvsl, 17:
vsr, 18:
ldvsr, 19:
rconde, 20:
rcondv, 21:
work, 22:
lwork, 23:
iwork, 24:
liwork, 25:
bwork, 26:
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
-
The iteration failed. are not in Schur form, but , , and should be correct for .
-
-
Unexpected error returned from
nag_lapack_dhgeqz (f08xe).
- W
-
After reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the generalized Schur form no longer satisfy . This could also be caused by underflow due to scaling.
- W
-
The eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned).
Accuracy
The computed generalized Schur factorization satisfies
where
and
is the
machine precision. See Section 4.11 of
Anderson et al. (1999) for further details.
Further Comments
The total number of floating-point operations is proportional to .
The complex analogue of this function is
nag_lapack_zggesx (f08xp).
Example
This example finds the generalized Schur factorization of the matrix pair
, where
such that the real positive eigenvalues of
correspond to the top left diagonal elements of the generalized Schur form,
. Estimates of the condition numbers for the selected eigenvalue cluster and corresponding deflating subspaces are also returned.
Note that the block size (NB) of assumed in this example is not realistic for such a small problem, but should be suitable for large problems.
Open in the MATLAB editor:
f08xb_example
function f08xb_example
fprintf('f08xb example results\n\n');
A = [3.9, 12.5, -34.5, -0.5;
4.3, 21.5, -47.5, 7.5;
4.3, 21.5, -43.5, 3.5;
4.4, 26.0, -46.0, 6.0];
B = [1, 2, -3, 1;
1, 3, -5, 4;
1, 3, -4, 3;
1, 3, -4, 4];
jobvsl = 'Vectors (left)';
jobvsr = 'Vectors (right)';
sortp = 'Sort';
selctg = @(ar, ai, b) (ai == 0) ;
sense = 'Both reciprocal condition numbers';
[S, T, sdim, alphar, alphai, beta, VSL, VSR, rconde, rcondv, info] = ...
f08xb( ...
jobvsl, jobvsr, sortp, selctg, sense, A, B);
fprintf('Number of selected eigenvalues = %4d\n\n', sdim);
disp('Selected generalized eigenvalues')
eigs = alphar./beta + i*alphai./beta;
disp(eigs(1:sdim));
fprintf('%s\n%s\n%s = %8.1e, %s = %8.1e\n\n', ...
'Reciprocals of left and right projection norms onto', ...
'the deflating subspaces for the selected eigenvalues', ...
'rconde(1)', rconde(1), 'rconde(2)', rconde(2));
fprintf('%s\n%s\n%s = %8.1e, %s = %8.1e\n\n', ...
'Reciprocals condition numbers for the left and right', ...
'deflating subspaces', 'rcondv(1)', rcondv(1), ...
'rcondv(2)', rcondv(2));
anorm = norm(A,2);
bnorm = norm(B,2);
abnorm = sqrt(anorm^2+bnorm^2);
fprintf('%s = %8.1e\n', ...
'Approximate asymptotic error bound for selected eigenvalues ', ...
x02aj*abnorm/rconde(1));
fprintf('%s = %8.1e\n', ...
'Approximate asymptotic error bound for the deflating subspaces', ...
x02aj*abnorm/rcondv(2));
f08xb example results
Number of selected eigenvalues = 2
Selected generalized eigenvalues
2.0000
4.0000
Reciprocals of left and right projection norms onto
the deflating subspaces for the selected eigenvalues
rconde(1) = 1.9e-01, rconde(2) = 1.8e-02
Reciprocals condition numbers for the left and right
deflating subspaces
rcondv(1) = 5.4e-02, rcondv(2) = 9.0e-02
Approximate asymptotic error bound for selected eigenvalues = 5.7e-14
Approximate asymptotic error bound for the deflating subspaces = 1.2e-13
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015