NAG FL Interface
f08xsf (zhgeqz)
1
Purpose
f08xsf implements the method for finding generalized eigenvalues of the complex matrix pair of order , which is in the generalized upper Hessenberg form.
2
Specification
Fortran Interface
Subroutine f08xsf ( |
job, compq, compz, n, ilo, ihi, a, lda, b, ldb, alpha, beta, q, ldq, z, ldz, work, lwork, rwork, info) |
Integer, Intent (In) |
:: |
n, ilo, ihi, lda, ldb, ldq, ldz, lwork |
Integer, Intent (Out) |
:: |
info |
Real (Kind=nag_wp), Intent (Out) |
:: |
rwork(n) |
Complex (Kind=nag_wp), Intent (Inout) |
:: |
a(lda,*), b(ldb,*), q(ldq,*), z(ldz,*) |
Complex (Kind=nag_wp), Intent (Out) |
:: |
alpha(n), beta(n), work(max(1,lwork)) |
Character (1), Intent (In) |
:: |
job, compq, compz |
|
C Header Interface
#include <nag.h>
void |
f08xsf_ (const char *job, const char *compq, const char *compz, const Integer *n, const Integer *ilo, const Integer *ihi, Complex a[], const Integer *lda, Complex b[], const Integer *ldb, Complex alpha[], Complex beta[], Complex q[], const Integer *ldq, Complex z[], const Integer *ldz, Complex work[], const Integer *lwork, double rwork[], Integer *info, const Charlen length_job, const Charlen length_compq, const Charlen length_compz) |
|
C++ Header Interface
#include <nag.h> extern "C" {
void |
f08xsf_ (const char *job, const char *compq, const char *compz, const Integer &n, const Integer &ilo, const Integer &ihi, Complex a[], const Integer &lda, Complex b[], const Integer &ldb, Complex alpha[], Complex beta[], Complex q[], const Integer &ldq, Complex z[], const Integer &ldz, Complex work[], const Integer &lwork, double rwork[], Integer &info, const Charlen length_job, const Charlen length_compq, const Charlen length_compz) |
}
|
The routine may be called by the names f08xsf, nagf_lapackeig_zhgeqz or its LAPACK name zhgeqz.
3
Description
f08xsf 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 routine
f08wsf should be called before invoking
f08xsf.
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 routine 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.
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:
– 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:
– 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:
– 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:
– Integer
Input
-
On entry: , the order of the matrices , , and .
Constraint:
.
-
5:
– Integer
Input
-
6:
– Integer
Input
-
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
f08wvf if the matrix pair was previously balanced; otherwise,
and
.
Constraints:
- if , ;
- if , and .
-
7:
– Complex (Kind=nag_wp) array
Input/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:
– Integer
Input
-
On entry: the first dimension of the array
a as declared in the (sub)program from which
f08xsf is called.
Constraint:
.
-
9:
– Complex (Kind=nag_wp) array
Input/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:
– Integer
Input
-
On entry: the first dimension of the array
b as declared in the (sub)program from which
f08xsf is called.
Constraint:
.
-
11:
– Complex (Kind=nag_wp) array
Output
-
On exit: , for .
-
12:
– Complex (Kind=nag_wp) array
Output
-
On exit: , for .
-
13:
– Complex (Kind=nag_wp) array
Input/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
f08wsf.
If
,
q is not referenced.
On exit: if
,
q contains the matrix product
.
If
,
q contains the transformation matrix
.
-
14:
– Integer
Input
-
On entry: the first dimension of the array
q as declared in the (sub)program from which
f08xsf is called.
Constraints:
- if or , ;
- if , .
-
15:
– Complex (Kind=nag_wp) array
Input/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
f08wsf.
If
,
z is not referenced.
On exit: if
,
z contains the matrix product
.
If
,
z contains the transformation matrix
.
-
16:
– Integer
Input
-
On entry: the first dimension of the array
z as declared in the (sub)program from which
f08xsf is called.
Constraints:
- if or , ;
- if , .
-
17:
– Complex (Kind=nag_wp) array
Workspace
-
On exit: if
, the real part of
contains the minimum value of
lwork required for optimal performance.
-
18:
– Integer
Input
-
On entry: the dimension of the array
work as declared in the (sub)program from which
f08xsf 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 .
-
19:
– Real (Kind=nag_wp) array
Workspace
-
-
20:
– Integer
Output
On exit:
unless the routine detects an error (see
Section 6).
6
Error Indicators and Warnings
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
The iteration did not converge and the matrix pair is not in the generalized Schur form. The computed and should be correct for .
- and
-
The computation of shifts failed and the matrix pair is not in the generalized Schur form. The computed and should be correct for .
-
An unexpected Library error has occurred.
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
f08xsf 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 routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
f08xsf is the fifth step in the solution of the complex generalized eigenvalue problem and is called after
f08wsf.
The number of floating-point operations taken by this routine is proportional to .
The real analogue of this routine is
f08xef.
10
Example
This example computes the
and
arguments, which defines the generalized eigenvalues, of the matrix pair
given by
and
This requires calls to five routines:
f08wvf to balance the matrix,
f08asf to perform the
factorization of
,
f08auf to apply
to
,
f08wsf to reduce the matrix pair to the generalized Hessenberg form and
f08xsf to compute the eigenvalues using the
algorithm.
10.1
Program Text
10.2
Program Data
10.3
Program Results