NAG Library Function Document
nag_dhgeqz (f08xec)
1
Purpose
nag_dhgeqz (f08xec) implements the method for finding generalized eigenvalues of the real matrix pair of order , which is in the generalized upper Hessenberg form.
2
Specification
#include <nag.h> |
#include <nagf08.h> |
void |
nag_dhgeqz (Nag_OrderType order,
Nag_JobType job,
Nag_ComputeQType compq,
Nag_ComputeZType compz,
Integer n,
Integer ilo,
Integer ihi,
double a[],
Integer pda,
double b[],
Integer pdb,
double alphar[],
double alphai[],
double beta[],
double q[],
Integer pdq,
double z[],
Integer pdz,
NagError *fail) |
|
3
Description
nag_dhgeqz (f08xec) 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_dgghrd (f08wec) should be called before invoking
nag_dhgeqz (f08xec).
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.
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
Arguments
- 1:
– Nag_OrderTypeInput
-
On entry: the
order argument specifies the two-dimensional storage scheme being used, i.e., row-major ordering or column-major ordering. C language defined storage is specified by
. See
Section 3.3.1.3 in How to Use the NAG Library and its Documentation for a more detailed explanation of the use of this argument.
Constraint:
or .
- 2:
– Nag_JobTypeInput
-
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 .
- 3:
– Nag_ComputeQTypeInput
-
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 .
- 4:
– Nag_ComputeZTypeInput
-
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 .
- 5:
– IntegerInput
-
On entry: , the order of the matrices , , and .
Constraint:
.
- 6:
– IntegerInput
- 7:
– IntegerInput
-
On entry: the indices
and
, respectively which define the upper triangular parts of
. The submatrices
and
are then upper triangular. These arguments are provided by
nag_dggbal (f08whc) if the matrix pair was previously balanced; otherwise,
and
.
Constraints:
- if , ;
- if , and .
- 8:
– doubleInput/Output
-
Note: the dimension,
dim, of the array
a
must be at least
.
Where
appears in this document, it refers to the array element
- when ;
- when .
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.
- 9:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
a.
Constraint:
.
- 10:
– doubleInput/Output
-
Note: the dimension,
dim, of the array
b
must be at least
.
Where
appears in this document, it refers to the array element
- when ;
- when .
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.
- 11:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraint:
.
- 12:
– doubleOutput
-
On exit: the real parts of
, for .
- 13:
– doubleOutput
-
On exit: the imaginary parts of
, for .
- 14:
– doubleOutput
-
On exit: , for .
- 15:
– doubleInput/Output
-
Note: the dimension,
dim, of the array
q
must be at least
- when
or ;
- when
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: if
, the matrix
. The matrix
is usually the matrix
returned by
nag_dgghrd (f08wec).
If
,
q is not referenced.
On exit: if
,
q contains the matrix product
.
If
,
q contains the transformation matrix
.
- 16:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
q.
Constraints:
- if ,
- if or , ;
- if , ;
- if ,
- if or ,
;
- if ,
.
- 17:
– doubleInput/Output
-
Note: the dimension,
dim, of the array
z
must be at least
- when
or ;
- when
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: if
, the matrix
. The matrix
is usually the matrix
returned by
nag_dgghrd (f08wec).
If
,
z is not referenced.
On exit: if
,
z contains the matrix product
.
If
,
z contains the transformation matrix
.
- 18:
– IntegerInput
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
z.
Constraints:
- if ,
- if or , ;
- if , ;
- if ,
- if or ,
;
- if ,
.
- 19:
– NagError *Input/Output
-
The NAG error argument (see
Section 3.7 in How to Use the NAG Library and its Documentation).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_ENUM_INT_2
-
On entry, , , .
Constraint: if or ,
;
if ,
.
On entry, , and .
Constraint: if or , ;
if , .
On entry, , , .
Constraint: if or ,
;
if ,
.
On entry, , and .
Constraint: if or , ;
if , .
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, and .
Constraint: .
On entry, and .
Constraint: .
- NE_INT_3
-
On entry, , and .
Constraint: if , ;
if , and .
- NE_INTERNAL_ERROR
-
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact
NAG for assistance.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
An unexpected Library error has occurred.
- NE_ITERATION_QZ
-
The iteration did not converge and the matrix pair is not in the generalized Schur form.
The computed and should be correct for .
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
- NE_SCHUR
-
The computation of shifts failed and the matrix pair is not in the generalized Schur form. The computed and should be correct for .
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.
8
Parallelism and Performance
nag_dhgeqz (f08xec) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
x06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
nag_dhgeqz (f08xec) is the fifth step in the solution of the real generalized eigenvalue problem and is called after
nag_dgghrd (f08wec).
The complex analogue of this function is
nag_zhgeqz (f08xsc).
10
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_dggbal (f08whc) to balance the matrix,
nag_dgeqrf (f08aec) to perform the
factorization of
,
nag_dormqr (f08agc) to apply
to
,
nag_dgghrd (f08wec) to reduce the matrix pair to the generalized Hessenberg form and
nag_dhgeqz (f08xec) to compute the eigenvalues using the
algorithm.
10.1
Program Text
Program Text (f08xece.c)
10.2
Program Data
Program Data (f08xece.d)
10.3
Program Results
Program Results (f08xece.r)