NAG Library Routine Document
F08XEF (DHGEQZ)
1 Purpose
F08XEF (DHGEQZ) implements the method for finding generalized eigenvalues of the real matrix pair of order , which is in the generalized upper Hessenberg form.
2 Specification
SUBROUTINE F08XEF ( |
JOB, COMPQ, COMPZ, N, ILO, IHI, A, LDA, B, LDB, ALPHAR, ALPHAI, BETA, Q, LDQ, Z, LDZ, WORK, LWORK, INFO) |
INTEGER |
N, ILO, IHI, LDA, LDB, LDQ, LDZ, LWORK, INFO |
REAL (KIND=nag_wp) |
A(LDA,*), B(LDB,*), ALPHAR(N), ALPHAI(N), BETA(N), Q(LDQ,*), Z(LDZ,*), WORK(max(1,LWORK)) |
CHARACTER(1) |
JOB, COMPQ, COMPZ |
|
The routine may be called by its
LAPACK
name dhgeqz.
3 Description
F08XEF (DHGEQZ) 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 routine
F08WEF (DGGHRD) should be called before invoking F08XEF (DHGEQZ).
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 routine but defined as ratios between two computed values,
and
:
The parameters , 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 parameter
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.
4 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
5 Parameters
- 1: JOB – CHARACTER(1)Input
On entry: 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: COMPQ – CHARACTER(1)Input
On entry: 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: COMPZ – CHARACTER(1)Input
On entry: 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: N – INTEGERInput
On entry: , the order of the matrices , , and .
Constraint:
.
- 5: ILO – INTEGERInput
- 6: IHI – INTEGERInput
On entry: the indices
and
, respectively which define the upper triangular parts of
. The submatrices
and
are then upper triangular. These parameters are provided by
F08WHF (DGGBAL) if the matrix pair was previously balanced; otherwise,
and
.
Constraints:
- if , ;
- if , and .
- 7: A(LDA,) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
A
must be at least
.
On entry: the by upper Hessenberg matrix . The elements below the first subdiagonal must be set to zero.
On exit: 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.
- 8: LDA – INTEGERInput
On entry: the first dimension of the array
A as declared in the (sub)program from which F08XEF (DHGEQZ) is called.
Constraint:
.
- 9: B(LDB,) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
B
must be at least
.
On entry: the by upper triangular matrix . The elements below the diagonal must be zero.
On exit: 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.
- 10: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F08XEF (DHGEQZ) is called.
Constraint:
.
- 11: ALPHAR(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the real parts of
, for .
- 12: ALPHAI(N) – REAL (KIND=nag_wp) arrayOutput
On exit: the imaginary parts of
, for .
- 13: BETA(N) – REAL (KIND=nag_wp) arrayOutput
On exit: , for .
- 14: Q(LDQ,) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
Q
must be at least
if
or
and at least
if
.
On entry: if
, the matrix
. The matrix
is usually the matrix
returned by
F08WEF (DGGHRD).
If
,
Q is not referenced.
On exit: if
,
Q contains the matrix product
.
If
,
Q contains the transformation matrix
.
- 15: LDQ – INTEGERInput
On entry: the first dimension of the array
Q as declared in the (sub)program from which F08XEF (DHGEQZ) is called.
Constraints:
- if or , ;
- if , .
- 16: Z(LDZ,) – REAL (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
Z
must be at least
if
or
and at least
if
.
On entry: if
, the matrix
. The matrix
is usually the matrix
returned by
F08WEF (DGGHRD).
If
,
Z is not referenced.
On exit: if
,
Z contains the matrix product
.
If
,
Z contains the transformation matrix
.
- 17: LDZ – INTEGERInput
On entry: the first dimension of the array
Z as declared in the (sub)program from which F08XEF (DHGEQZ) is called.
Constraints:
- if or , ;
- if , .
- 18: WORK() – REAL (KIND=nag_wp) arrayWorkspace
On exit: if
,
contains the minimum value of
LWORK required for optimal performance.
- 19: LWORK – INTEGERInput
On entry: the dimension of the array
WORK as declared in the (sub)program from which F08XEF (DHGEQZ) is called.
If
, a workspace query is assumed; the routine only calculates the minimum size of the
WORK array, returns this value as the first entry of the
WORK array, and no error message related to
LWORK is issued.
Constraint:
or .
- 20: INFO – INTEGEROutput
On exit:
unless the routine detects an error (see
Section 6).
6 Error Indicators and Warnings
Errors or warnings detected by the routine:
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
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.
7 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.
F08XEF (DHGEQZ) is the fifth step in the solution of the real generalized eigenvalue problem and is called after
F08WEF (DGGHRD).
The complex analogue of this routine is
F08XSF (ZHGEQZ).
9 Example
This example computes the
and
parameters, which defines the generalized eigenvalues, of the matrix pair
given by
This requires calls to five routines:
F08WHF (DGGBAL) to balance the matrix,
F08AEF (DGEQRF) to perform the
factorization of
,
F08AGF (DORMQR) to apply
to
,
F08WEF (DGGHRD) to reduce the matrix pair to the generalized Hessenberg form and F08XEF (DHGEQZ) to compute the eigenvalues using the
algorithm.
9.1 Program Text
Program Text (f08xefe.f90)
9.2 Program Data
Program Data (f08xefe.d)
9.3 Program Results
Program Results (f08xefe.r)