PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zhgeqz (f08xs)
Purpose
nag_lapack_zhgeqz (f08xs) implements the method for finding generalized eigenvalues of the complex matrix pair of order , which is in the generalized upper Hessenberg form.
Syntax
[
a,
b,
alpha,
beta,
q,
z,
info] = f08xs(
job,
compq,
compz,
ilo,
ihi,
a,
b,
q,
z, 'n',
n)
[
a,
b,
alpha,
beta,
q,
z,
info] = nag_lapack_zhgeqz(
job,
compq,
compz,
ilo,
ihi,
a,
b,
q,
z, 'n',
n)
Description
nag_lapack_zhgeqz (f08xs) implements a single-shift version of the
method for finding the generalized eigenvalues of the complex 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_zgghrd (f08ws) should be called before invoking
nag_lapack_zhgeqz (f08xs).
This problem is mathematically equivalent to solving the matrix 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 matrices and are upper triangular and the diagonal values of and provide and .
The argument
job specifies two options. If
then the matrix pair
is simultaneously reduced to Schur form by applying one unitary transformation (usually called
) on the left and another (usually called
) on the right. That is,
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 unitary 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
rather than
.
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 in 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_zggbal (f08wv) if the matrix pair was previously balanced; otherwise,
and
.
Constraints:
- if , ;
- if , and .
- 6:
– complex 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:
– complex 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:
– complex 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_zgghrd (f08ws).
If
,
q is not referenced.
- 9:
– complex 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_zgghrd (f08ws).
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:
– complex 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:
– complex 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:
– complex array
-
, for .
- 4:
– complex array
-
, for .
- 5:
– complex 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
.
- 6:
– complex 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
.
- 7:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and 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:
alpha, 12:
beta, 13:
q, 14:
ldq, 15:
z, 16:
ldz, 17:
work, 18:
lwork, 19:
rwork, 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.
-
-
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_zhgeqz (f08xs) is the fifth step in the solution of the complex generalized eigenvalue problem and is called after
nag_lapack_zgghrd (f08ws).
The number of floating-point operations taken by this function is proportional to .
The real analogue of this function is
nag_lapack_dhgeqz (f08xe).
Example
This example computes the
and
arguments, which defines the generalized eigenvalues, of the matrix pair
given by
and
This requires calls to five functions:
nag_lapack_zggbal (f08wv) to balance the matrix,
nag_lapack_zgeqrf (f08as) to perform the
factorization of
,
nag_lapack_zunmqr (f08au) to apply
to
,
nag_lapack_zgghrd (f08ws) to reduce the matrix pair to the generalized Hessenberg form and
nag_lapack_zhgeqz (f08xs) to compute the eigenvalues using the
algorithm.
Open in the MATLAB editor:
f08xs_example
function f08xs_example
fprintf('f08xs example results\n\n');
a = [ 1.0+3.0i 1.0+4.0i 1.0+5.0i 1.0+6.0i;
2.0+2.0i 4.0+3.0i 8.0+4.0i 16.0+5.0i;
3.0+1.0i 9.0+2.0i 27.0+3.0i 81.0+4.0i;
4.0+0.0i 16.0+1.0i 64.0+2.0i 256.0+3.0i];
b = [ 1.0+0.0i 2.0+1.0i 3.0+2.0i 4.0+3.0i;
1.0+1.0i 4.0+2.0i 9.0+3.0i 16.0+4.0i;
1.0+2.0i 8.0+3.0i 27.0+4.0i 64.0+5.0i;
1.0+3.0i 16.0+4.0i 81.0+5.0i 256.0+6.0i];
job = 'B';
[a, b, ilo, ihi, lscale, rscale, info] = ...
f08wv(job, a, b);
bbal = b(ilo:ihi,ilo:ihi);
abal = a(ilo:ihi,ilo:ihi);
[QR, tau, info] = f08as(bbal);
side = 'Left';
trans = 'Conjugate transpose';
[c, info] = f08au( ...
side, trans, QR, tau, abal);
compq = 'No Q';
compz = 'No Z';
z = complex(eye(4));
q = complex(eye(4));
jlo = int64(1);
jhi = int64(ihi-ilo+1);
[H, T, ~, ~, info] = ...
f08ws( ...
compq, compz, jlo, jhi, c, QR, q, z);
job = 'Eigenvalues';
ilo = int64(1);
ihi = int64(4);
[~, ~, alpha, beta, ~, ~, info] = ...
f08xs( ...
job, compq, compz, jlo, jhi, H, T, q, z);
disp('Generalized eigenvalues of (A,B):');
disp(alpha./beta);
f08xs example results
Generalized eigenvalues of (A,B):
-0.6354 + 1.6529i
0.4580 - 0.8426i
0.4934 + 0.9102i
0.6744 - 0.0499i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015