NAG CL Interface
f08ykc (dtgevc)
1
Purpose
f08ykc computes some or all of the right and/or left generalized eigenvectors of a pair of real matrices which are in generalized real Schur form.
2
Specification
void |
f08ykc (Nag_OrderType order,
Nag_SideType side,
Nag_HowManyType how_many,
const Nag_Boolean select[],
Integer n,
const double a[],
Integer pda,
const double b[],
Integer pdb,
double vl[],
Integer pdvl,
double vr[],
Integer pdvr,
Integer mm,
Integer *m,
NagError *fail) |
|
The function may be called by the names: f08ykc, nag_lapackeig_dtgevc or nag_dtgevc.
3
Description
f08ykc computes some or all of the right and/or left generalized eigenvectors of the matrix pair
which is assumed to be in generalized upper Schur form. If the matrix pair
is not in the generalized upper Schur form, then
f08xec should be called before invoking
f08ykc.
The right generalized eigenvector
and the left generalized eigenvector
of
corresponding to a generalized eigenvalue
are defined by
and
If a generalized eigenvalue is determined as
, which is due to zero diagonal elements at the same locations in both
and
, a unit vector is returned as the corresponding eigenvector.
Note that the generalized eigenvalues are computed using
f08xec but
f08ykc does not explicitly require the generalized eigenvalues to compute eigenvectors. The ordering of the eigenvectors is based on the ordering of the eigenvalues as computed by
f08ykc.
If all eigenvectors are requested, the function may either return the matrices
and/or
of right or left eigenvectors of
, or the products
and/or
, where
and
are two matrices supplied by you. Usually,
and
are chosen as the orthogonal matrices returned by
f08xec. Equivalently,
and
are the left and right Schur vectors of the matrix pair supplied to
f08xec. In that case,
and
are the left and right generalized eigenvectors, respectively, of the matrix pair supplied to
f08xec.
must be block upper triangular; with by and by diagonal blocks. Corresponding to each by diagonal block is a complex conjugate pair of eigenvalues and eigenvectors; only one eigenvector of the pair is computed, namely the one corresponding to the eigenvalue with positive imaginary part. Each by block gives a real generalized eigenvalue and a corresponding eigenvector.
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_OrderType
Input
-
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.1.3 in the Introduction to the NAG Library CL Interface for a more detailed explanation of the use of this argument.
Constraint:
or .
-
2:
– Nag_SideType
Input
-
On entry: specifies the required sets of generalized eigenvectors.
- Only right eigenvectors are computed.
- Only left eigenvectors are computed.
- Both left and right eigenvectors are computed.
Constraint:
, or .
-
3:
– Nag_HowManyType
Input
-
On entry: specifies further details of the required generalized eigenvectors.
- All right and/or left eigenvectors are computed.
- All right and/or left eigenvectors are computed; they are backtransformed using the input matrices supplied in arrays vr and/or vl.
- Selected right and/or left eigenvectors, defined by the array select, are computed.
Constraint:
, or .
-
4:
– const Nag_Boolean
Input
-
Note: the dimension,
dim, of the array
select
must be at least
- when ;
- otherwise select may be NULL.
On entry: specifies the eigenvectors to be computed if
. To select the generalized eigenvector corresponding to the
th generalized eigenvalue, the
th element of
select should be set to Nag_TRUE; if the eigenvalue corresponds to a complex conjugate pair, then real and imaginary parts of eigenvectors corresponding to the complex conjugate eigenvalue pair will be computed.
If
or
,
select is not referenced and may be
NULL.
Constraint:
if , or , for .
-
5:
– Integer
Input
-
On entry: , the order of the matrices and .
Constraint:
.
-
6:
– const double
Input
-
Note: the dimension,
dim, of the array
a
must be at least
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the matrix pair
must be in the generalized Schur form. Usually, this is the matrix
returned by
f08xec.
-
7:
– Integer
Input
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
a.
Constraint:
.
-
8:
– const double
Input
-
Note: the dimension,
dim, of the array
b
must be at least
.
The
th element of the matrix
is stored in
- when ;
- when .
On entry: the matrix pair
must be in the generalized Schur form. If
has a
by
diagonal block then the corresponding
by
block of
must be diagonal with positive elements. Usually, this is the matrix
returned by
f08xec.
-
9:
– Integer
Input
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
b.
Constraint:
.
-
10:
– double
Input/Output
-
Note: the dimension,
dim, of the array
vl
must be at least
- when
or and
;
- when
or and
;
- otherwise vl may be NULL.
The
th element of the matrix is stored in
- when ;
- when .
On entry: if
and
or
,
vl must be initialized to an
by
matrix
. Usually, this is the orthogonal matrix
of left Schur vectors returned by
f08xec.
On exit: if
or
,
vl contains:
- if , the matrix of left eigenvectors of ;
- if , the matrix ;
- if , the left eigenvectors of specified by select, stored consecutively in the rows or columns (depending on the value of order) of the array vl, in the same order as their corresponding eigenvalues.
A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive rows or columns, the first holding the real part, and the second the imaginary part.
If
,
vl is not referenced and may be
NULL.
-
11:
– Integer
Input
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
vl.
Constraints:
- if ,
- if or , ;
- if , vl may be NULL;
- if ,
- if or ,
;
- if ,
vl may be NULL.
-
12:
– double
Input/Output
-
Note: the dimension,
dim, of the array
vr
must be at least
- when
or and
;
- when
or and
;
- otherwise vr may be NULL.
The
th element of the matrix is stored in
- when ;
- when .
On entry: if
and
or
,
vr must be initialized to an
by
matrix
. Usually, this is the orthogonal matrix
of right Schur vectors returned by
f08xec.
On exit: if
or
,
vr contains:
- if , the matrix of right eigenvectors of ;
- if , the matrix ;
- if , the right eigenvectors of specified by select, stored consecutively in the rows or columns (depending on the value of order) of the array vr, in the same order as their corresponding eigenvalues.
A complex eigenvector corresponding to a complex eigenvalue is stored in two consecutive rows or columns, the first holding the real part, and the second the imaginary part.
If
,
vr is not referenced and may be
NULL.
-
13:
– Integer
Input
-
On entry: the stride separating row or column elements (depending on the value of
order) in the array
vr.
Constraints:
- if ,
- if or , ;
- if , vr may be NULL;
- if ,
- if or ,
;
- if ,
vr may be NULL.
-
14:
– Integer
Input
-
On entry: the number of columns in the arrays
vl and/or
vr.
Constraints:
- if or , ;
- if , mm must not be less than the number of requested eigenvectors.
-
15:
– Integer *
Output
-
On exit: the number of columns in the arrays
vl and/or
vr actually used to store the eigenvectors. If
or
,
m is set to
n. Each selected real eigenvector occupies one row or column and each selected complex eigenvector occupies two rows or columns.
-
16:
– NagError *
Input/Output
-
The NAG error argument (see
Section 7 in the Introduction to the NAG Library CL Interface).
6
Error Indicators and Warnings
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_CONSTRAINT
-
Constraint: if , or , for .
- NE_ENUM_INT_2
-
On entry,
,
and
.
Constraint: if
or
,
;
if
,
mm must not be less than the number of requested eigenvectors.
On entry, , and .
Constraint: if or ,
.
On entry, , and .
Constraint: if or , .
On entry, , and .
Constraint: if or ,
.
On entry, , and .
Constraint: if or , .
- 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_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 7.5 in the Introduction to the NAG Library CL Interface for further information.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 8 in the Introduction to the NAG Library CL Interface for further information.
- NE_NOT_COMPLEX
-
The by block does not have complex eigenvalues.
7
Accuracy
It is beyond the scope of this manual to summarise the accuracy of the solution of the generalized eigenvalue problem. Interested readers should consult Section 4.11 of the LAPACK Users' Guide (see
Anderson et al. (1999)) and Chapter 6 of
Stewart and Sun (1990).
8
Parallelism and Performance
f08ykc 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.
f08ykc is the sixth step in the solution of the real generalized eigenvalue problem and is called after
f08xec.
The complex analogue of this function is
f08yxc.
10
Example
This example computes the
and
arguments, which defines the generalized eigenvalues and the corresponding left and right eigenvectors, of the matrix pair
given by
To compute generalized eigenvalues, it is required to call five functions:
f08whc to balance the matrix,
f08aec to perform the
factorization of
,
f08agc to apply
to
,
f08wec to reduce the matrix pair to the generalized Hessenberg form and
f08xec to compute the eigenvalues via the
algorithm.
The computation of generalized eigenvectors is done by calling
f08ykc to compute the eigenvectors of the balanced matrix pair. The function
f08wjc is called to backward transform the eigenvectors to the user-supplied matrix pair. If both left and right eigenvectors are required then
f08wjc must be called twice.
10.1
Program Text
10.2
Program Data
10.3
Program Results