PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_ztgevc (f08yx)
Purpose
nag_lapack_ztgevc (f08yx) computes some or all of the right and/or left generalized eigenvectors of a pair of complex upper triangular matrices .
Syntax
[
vl,
vr,
m,
info] = f08yx(
side,
howmny,
select,
a,
b,
vl,
vr,
mm, 'n',
n)
[
vl,
vr,
m,
info] = nag_lapack_ztgevc(
side,
howmny,
select,
a,
b,
vl,
vr,
mm, 'n',
n)
Description
nag_lapack_ztgevc (f08yx) computes some or all of the right and/or left generalized eigenvectors of the matrix pair
which is assumed to be in upper triangular form. If the matrix pair
is not upper triangular then the function
nag_lapack_zhgeqz (f08xs) should be called before invoking
nag_lapack_ztgevc (f08yx).
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
nag_lapack_zhgeqz (f08xs) but
nag_lapack_ztgevc (f08yx) 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
nag_lapack_ztgevc (f08yx).
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 unitary matrices returned by
nag_lapack_zhgeqz (f08xs). Equivalently,
and
are the left and right Schur vectors of the matrix pair supplied to
nag_lapack_zhgeqz (f08xs). In that case,
and
are the left and right generalized eigenvectors, respectively, of the matrix pair supplied to
nag_lapack_zhgeqz (f08xs).
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 required sets of generalized eigenvectors.
- Only right eigenvectors are computed.
- Only left eigenvectors are computed.
- Both left and right eigenvectors are computed.
Constraint:
, or .
- 2:
– string (length ≥ 1)
-
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 .
- 3:
– logical array
-
The dimension of the array
select
must be at least
if
, and at least
otherwise
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
true.
Constraint:
if , or , for .
- 4:
– 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 matrix
must be in upper triangular form. Usually, this is the matrix
returned by
nag_lapack_zhgeqz (f08xs).
- 5:
– 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 matrix
must be in upper triangular form with non-negative real diagonal elements. Usually, this is the matrix
returned by
nag_lapack_zhgeqz (f08xs).
- 6:
– complex array
-
The first dimension,
, of the array
vl must satisfy
- if or , ;
- if , .
The second dimension of the array
vl must be at least
if
or
and at least
if
.
If
and
or
,
vl must be initialized to an
by
matrix
. Usually, this is the unitary matrix
of left Schur vectors returned by
nag_lapack_zhgeqz (f08xs).
- 7:
– complex array
-
The first dimension,
, of the array
vr must satisfy
- if or , ;
- if , .
The second dimension of the array
vr must be at least
if
or
and at least
if
.
If
and
or
,
vr must be initialized to an
by
matrix
. Usually, this is the unitary matrix
of right Schur vectors returned by
nag_lapack_dhgeqz (f08xe).
- 8:
– int64int32nag_int scalar
-
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.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the arrays
vl,
vr. (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
vl will be
- if or , ;
- if , .
The second dimension of the array
vl will be
if
or
and at least
if
.
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 columns of the array vl, in the same order as their corresponding eigenvalues.
- 2:
– complex array
-
The first dimension,
, of the array
vr will be
- if or , ;
- if , .
The second dimension of the array
vr will be
if
or
and at least
if
.
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 columns of the array vr, in the same order as their corresponding eigenvalues.
- 3:
– int64int32nag_int scalar
-
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 eigenvector occupies one column.
- 4:
– 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:
side, 2:
howmny, 3:
select, 4:
n, 5:
a, 6:
lda, 7:
b, 8:
ldb, 9:
vl, 10:
ldvl, 11:
vr, 12:
ldvr, 13:
mm, 14:
m, 15:
work, 16:
rwork, 17:
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.
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).
Further Comments
nag_lapack_ztgevc (f08yx) is the sixth step in the solution of the complex generalized eigenvalue problem and is usually called after
nag_lapack_zhgeqz (f08xs).
The real analogue of this function is
nag_lapack_dtgevc (f08yk).
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
and
To compute generalized eigenvalues, it is required to call 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 via the
algorithm.
The computation of generalized eigenvectors is done by calling
nag_lapack_ztgevc (f08yx) to compute the eigenvectors of the balanced matrix pair. The function
nag_lapack_zggbak (f08ww) is called to backward transform the eigenvectors to the user-supplied matrix pair. If both left and right eigenvectors are required then
nag_lapack_zggbak (f08ww) must be called twice.
Open in the MATLAB editor:
f08yx_example
function f08yx_example
fprintf('f08yx 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 = 'Vectors Q';
compz = 'Vectors Z';
[q, info] = f08at(QR, tau);
z = complex(eye(4));
jlo = int64(1);
jhi = int64(ihi-ilo+1);
[H, T, q, z, info] = ...
f08ws(...
compq, compz, jlo, jhi, c, QR, q, z);
job = 'Schur form';
ilo = int64(1);
ihi = int64(4);
[HS, TS, alpha, beta, q, z, info] = ...
f08xs(...
job, compq, compz, jlo, jhi, H, T, q, z);
disp('Generalized eigenvalues of (A,B):');
disp(alpha./beta);
side = 'Both sides';
howmny = 'Backtransformed using Q and Z';
select = [false];
[q, z, m, info] = f08yx(...
side, howmny, select, HS, TS, q, z, jhi);
job = 'Back scale';
side = 'Left';
[VL, info] = f08ww( ...
job, side, jlo, jhi, lscale, rscale, q);
side = 'Right';
[VR, info] = f08ww( ...
job, side, jlo, jhi, lscale, rscale, z);
incv = int64(1);
n = int64(4);
for j = 1:n
[k, r] = f16js(n, VL(:,j), incv);
scal = conj(VL(k,j))/abs(VL(k,j))/norm(VL(:,j),2);
VL(:,j) = VL(:,j)*scal;
end
for j = 1:n
[k, r] = f16js(n, VR(:,j), incv);
scal = conj(VR(k,j))/abs(VR(k,j))/norm(VR(:,j),2);
VR(:,j) = VR(:,j)*scal;
end
disp('Right Eigenvectors');
disp(VR);
disp('Left Eigenvectors');
disp(VL);
f08yx example results
Generalized eigenvalues of (A,B):
-0.6354 + 1.6529i
0.4580 - 0.8426i
0.4934 + 0.9102i
0.6744 - 0.0499i
Right Eigenvectors
0.7186 + 0.0000i -0.4649 + 0.0156i -0.3946 + 0.0246i -0.6788 - 0.1233i
-0.6208 - 0.2009i 0.7652 + 0.0000i 0.7921 + 0.0000i 0.7184 + 0.0000i
0.2251 + 0.0762i -0.4275 - 0.0912i -0.4554 + 0.0334i -0.0886 - 0.0067i
-0.0372 - 0.0088i 0.0707 + 0.0442i 0.0824 - 0.0322i -0.0048 + 0.0006i
Left Eigenvectors
0.7397 + 0.0000i -0.3722 - 0.0016i -0.3240 - 0.1559i -0.4118 - 0.2276i
-0.5812 + 0.2589i 0.8003 + 0.0000i 0.8063 - 0.0000i 0.8681 - 0.0000i
0.1875 - 0.1097i -0.4606 - 0.0279i -0.4523 + 0.0903i -0.1564 + 0.0136i
-0.0219 + 0.0195i 0.0839 + 0.0311i 0.0755 - 0.0453i 0.0206 - 0.0038i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015