PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_dhgeqz (f08xe)
Purpose
nag_lapack_dhgeqz (f08xe) implements the method for finding generalized eigenvalues of the real matrix pair of order , which is in the generalized upper Hessenberg form.
Syntax
[
a,
b,
alphar,
alphai,
beta,
q,
z,
info] = f08xe(
job,
compq,
compz,
ilo,
ihi,
a,
b,
q,
z, 'n',
n)
[
a,
b,
alphar,
alphai,
beta,
q,
z,
info] = nag_lapack_dhgeqz(
job,
compq,
compz,
ilo,
ihi,
a,
b,
q,
z, 'n',
n)
Description
nag_lapack_dhgeqz (f08xe) implements a single-double-shift version of the
method for finding the generalized eigenvalues of the real matrix pair
which is in the generalized upper Hessenberg form. If the matrix pair
is not in the generalized upper Hessenberg form, then the function
nag_lapack_dgghrd (f08we) should be called before invoking
nag_lapack_dhgeqz (f08xe).
This problem is mathematically equivalent to solving the equation
Note that, to avoid underflow, overflow and other arithmetic problems, the generalized eigenvalues
are never computed explicitly by this function but defined as ratios between two computed values,
and
:
The arguments , in general, are finite complex values and are finite real non-negative values.
If desired, the matrix pair may be reduced to generalized Schur form. That is, the transformed matrix is upper triangular and the transformed matrix is block upper triangular, where the diagonal blocks are either by or by . The by blocks provide generalized eigenvalues which are real and the by blocks give complex generalized eigenvalues.
The argument
job specifies two options. If
then the matrix pair
is simultaneously reduced to Schur form by applying one orthogonal transformation (usually called
) on the left and another (usually called
) on the right. That is,
The
by
upper-triangular diagonal blocks of
corresponding to
by
blocks of
a will be reduced to non-negative diagonal matrices. That is, if
is nonzero, then
and
and
will be non-negative.
If , then at each iteration the same transformations are computed but they are only applied to those parts of and which are needed to compute and . This option could be used if generalized eigenvalues are required but not generalized eigenvectors.
If
and
or
, and
or
, then the orthogonal transformations used to reduce the pair
are accumulated into the input arrays
q and
z. If generalized eigenvectors are required then
job must be set to
and if left (right) generalized eigenvectors are to be computed then
compq (
compz) must be set to
or
and not
.
If
, then eigenvectors are accumulated on the identity matrix and on exit the array
q contains the left eigenvector matrix
. However, if
then the transformations are accumulated on the user-supplied matrix
in array
q on entry and thus on exit
q contains the matrix product
. A similar convention is used for
compz.
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
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
Moler C B and Stewart G W (1973) An algorithm for generalized matrix eigenproblems SIAM J. Numer. Anal. 10 241–256
Stewart G W and Sun J-G (1990) Matrix Perturbation Theory Academic Press, London
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Specifies the operations to be performed on
.
- The matrix pair on exit might not be in the generalized Schur form.
- The matrix pair on exit will be in the generalized Schur form.
Constraint:
or .
- 2:
– string (length ≥ 1)
-
Specifies the operations to be performed on
:
- The array q is unchanged.
- The left transformation is accumulated on the array q.
- The array q is initialized to the identity matrix before the left transformation is accumulated in q.
Constraint:
, or .
- 3:
– string (length ≥ 1)
-
Specifies the operations to be performed on
.
- The array z is unchanged.
- The right transformation is accumulated on the array z.
- The array z is initialized to the identity matrix before the right transformation is accumulated in z.
Constraint:
, or .
- 4:
– int64int32nag_int scalar
- 5:
– int64int32nag_int scalar
-
The indices
and
, respectively which define the upper triangular parts of
. The submatrices
and
are then upper triangular. These arguments are provided by
nag_lapack_dggbal (f08wh) if the matrix pair was previously balanced; otherwise,
and
.
Constraints:
- if , ;
- if , and .
- 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 by upper Hessenberg matrix . The elements below the first subdiagonal must be set to zero.
- 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 by upper triangular matrix . The elements below the diagonal must be zero.
- 8:
– double array
-
The first dimension,
, of the array
q must satisfy
- if or , ;
- if , .
The second dimension of the array
q must be at least
if
or
and at least
if
.
If
, the matrix
. The matrix
is usually the matrix
returned by
nag_lapack_dgghrd (f08we).
If
,
q is not referenced.
- 9:
– double array
-
The first dimension,
, of the array
z must satisfy
- if or , ;
- if , .
The second dimension of the array
z must be at least
if
or
and at least
if
.
If
, the matrix
. The matrix
is usually the matrix
returned by
nag_lapack_dgghrd (f08we).
If
,
z is not referenced.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the second dimension of the arrays
a,
b,
q,
z and the first dimension of the arrays
a,
b,
q,
z. (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
.
If
, the matrix pair
will be simultaneously reduced to generalized Schur form.
If , the by and by diagonal blocks of the matrix pair will give generalized eigenvalues but the remaining elements will be irrelevant.
- 2:
– double array
-
The first dimension of the array
b will be
.
The second dimension of the array
b will be
.
If
, the matrix pair
will be simultaneously reduced to generalized Schur form.
If , the by and by diagonal blocks of the matrix pair will give generalized eigenvalues but the remaining elements will be irrelevant.
- 3:
– double array
-
The real parts of
, for .
- 4:
– double array
-
The imaginary parts of
, for .
- 5:
– double array
-
, for .
- 6:
– double array
-
The first dimension,
, of the array
q will be
- if or , ;
- if , .
The second dimension of the array
q will be
if
or
and at least
if
.
If
,
q contains the matrix product
.
If
,
q contains the transformation matrix
.
- 7:
– double array
-
The first dimension,
, of the array
z will be
- if or , ;
- if , .
The second dimension of the array
z will be
if
or
and at least
if
.
If
,
z contains the matrix product
.
If
,
z contains the transformation matrix
.
- 8:
– 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:
job, 2:
compq, 3:
compz, 4:
n, 5:
ilo, 6:
ihi, 7:
a, 8:
lda, 9:
b, 10:
ldb, 11:
alphar, 12:
alphai, 13:
beta, 14:
q, 15:
ldq, 16:
z, 17:
ldz, 18:
work, 19:
lwork, 20:
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
-
If , the iteration did not converge and the matrix pair is not in the generalized Schur form at exit. However, if , then the computed and should be correct for .
If , the computation of shifts failed and the matrix pair is not in the generalized Schur form at exit. However, if , then the computed and should be correct for .
If
, then an unexpected
Library error has occurred. Please contact
NAG with details of your program.
Accuracy
Please consult Section 4.11 of the LAPACK Users' Guide (see
Anderson et al. (1999)) and Chapter 6 of
Stewart and Sun (1990), for more information.
Further Comments
nag_lapack_dhgeqz (f08xe) is the fifth step in the solution of the real generalized eigenvalue problem and is called after
nag_lapack_dgghrd (f08we).
The complex analogue of this function is
nag_lapack_zhgeqz (f08xs).
Example
This example computes the
and
arguments, which defines the generalized eigenvalues, of the matrix pair
given by
This requires calls to five functions:
nag_lapack_dggbal (f08wh) to balance the matrix,
nag_lapack_dgeqrf (f08ae) to perform the
factorization of
,
nag_lapack_dormqr (f08ag) to apply
to
,
nag_lapack_dgghrd (f08we) to reduce the matrix pair to the generalized Hessenberg form and
nag_lapack_dhgeqz (f08xe) to compute the eigenvalues using the
algorithm.
Open in the MATLAB editor:
f08xe_example
function f08xe_example
fprintf('f08xe example results\n\n');
a = [ 1.0 1.0 1.0 1.0 1.0;
2.0 4.0 8.0 16.0 32.0;
3.0 9.0 27.0 81.0 243.0;
4.0 16.0 64.0 256.0 1024.0;
5.0 25.0 125.0 625.0 3125.0];
b = a';
%' Balance A and B
job = 'B';
[a, b, ilo, ihi, lscale, rscale, info] = ...
f08wh(job, a, b);
bbal = b(ilo:ihi,ilo:ihi);
abal = a(ilo:ihi,ilo:ihi);
[QR, tau, info] = f08ae(bbal);
side = 'Left';
trans = 'Transpose';
[c, info] = f08ag(...
side, trans, QR, tau, abal);
compq = 'No Q';
compz = 'No Z';
z = eye(4);
q = eye(4);
jlo = int64(1);
jhi = int64(ihi-ilo+1);
[H, T, ~, ~, info] = ...
f08we(...
compq, compz, jlo, jhi, c, QR, q, z);
job = 'Eigenvalues';
[~, ~, alphar, alphai, beta, ~, ~, info] = ...
f08xe(...
job, compq, compz, jlo, jhi, H, T, q, z);
disp('Generalized eigenvalues of (A,B):');
w = complex(alphar+i*alphai);
disp(w./beta);
f08xe example results
Generalized eigenvalues of (A,B):
-2.4367 + 0.0000i
0.6069 + 0.7948i
0.6069 - 0.7948i
1.0000 + 0.0000i
-0.4104 + 0.0000i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015