PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zgghrd (f08ws)
Purpose
nag_lapack_zgghrd (f08ws) reduces a pair of complex matrices , where is upper triangular, to the generalized upper Hessenberg form using unitary transformations.
Syntax
[
a,
b,
q,
z,
info] = f08ws(
compq,
compz,
ilo,
ihi,
a,
b,
q,
z, 'n',
n)
[
a,
b,
q,
z,
info] = nag_lapack_zgghrd(
compq,
compz,
ilo,
ihi,
a,
b,
q,
z, 'n',
n)
Description
nag_lapack_zgghrd (f08ws) is usually the third step in the solution of the complex generalized eigenvalue problem
The (optional) first step balances the two matrices using
nag_lapack_zggbal (f08wv). In the second step, matrix
is reduced to upper triangular form using the
factorization function
nag_lapack_zgeqrf (f08as) and this unitary transformation
is applied to matrix
by calling
nag_lapack_zunmqr (f08au).
nag_lapack_zgghrd (f08ws) reduces a pair of complex matrices
, where
is triangular, to the generalized upper Hessenberg form using unitary transformations. This two-sided transformation is of the form
where
is an upper Hessenberg matrix,
is an upper triangular matrix and
and
are unitary matrices determined as products of Givens rotations. They may either be formed explicitly, or they may be postmultiplied into input matrices
and
, so that
References
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
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Specifies the form of the computed unitary matrix
.
- Do not compute .
- The unitary matrix is returned.
- q must contain a unitary matrix , and the product is returned.
Constraint:
, or .
- 2:
– string (length ≥ 1)
-
Specifies the form of the computed unitary matrix
.
- Do not compute .
- z must contain a unitary matrix , and the product is returned.
- The unitary matrix is returned.
Constraint:
, or .
- 3:
– int64int32nag_int scalar
- 4:
– int64int32nag_int scalar
-
and
as determined by a previous call to
nag_lapack_zggbal (f08wv). Otherwise, they should be set to
and
, respectively.
Constraints:
- if , ;
- if , and .
- 5:
– 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
of the matrix pair
. Usually, this is the matrix
returned by
nag_lapack_zunmqr (f08au).
- 6:
– 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 upper triangular matrix
of the matrix pair
. Usually, this is the matrix
returned by the
factorization function
nag_lapack_zgeqrf (f08as).
- 7:
– complex array
-
The first dimension,
, of the array
q must satisfy
- if or , ;
- if , .
The second dimension of the array
q must be at least
if
or
and at least
if
.
If
,
q must contain a unitary matrix
.
If
,
q is not referenced.
- 8:
– complex array
-
The first dimension,
, of the array
z must satisfy
- if or , ;
- if , .
The second dimension of the array
z must be at least
if
or
and at least
if
.
If
,
z must contain a unitary matrix
.
If
,
z is not referenced.
Optional Input Parameters
- 1:
– int64int32nag_int scalar
-
Default:
the first dimension of the arrays
a,
b and the second dimension of the arrays
a,
b.
, the order of the matrices and .
Constraint:
.
Output Parameters
- 1:
– complex array
-
The first dimension of the array
a will be
.
The second dimension of the array
a will be
.
a stores the upper Hessenberg matrix
.
- 2:
– complex array
-
The first dimension of the array
b will be
.
The second dimension of the array
b will be
.
b stores the upper triangular matrix
.
- 3:
– complex array
-
The first dimension,
, of the array
q will be
- if or , ;
- if , .
The second dimension of the array
q will be
if
or
and at least
if
.
If
,
q contains the unitary matrix
.
Iif
,
q stores
.
- 4:
– complex array
-
The first dimension,
, of the array
z will be
- if or , ;
- if , .
The second dimension of the array
z will be
if
or
and at least
if
.
If
,
z contains the unitary matrix
.
If
,
z stores
.
- 5:
– 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:
compq, 2:
compz, 3:
n, 4:
ilo, 5:
ihi, 6:
a, 7:
lda, 8:
b, 9:
ldb, 10:
q, 11:
ldq, 12:
z, 13:
ldz, 14:
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
The reduction to the generalized Hessenberg form is implemented using unitary transformations which are backward stable.
Further Comments
This function is usually followed by
nag_lapack_zhgeqz (f08xs) which implements the
algorithm for computing generalized eigenvalues of a reduced pair of matrices.
The real analogue of this function is
nag_lapack_dgghrd (f08we).
Example
Open in the MATLAB editor:
f08ws_example
function f08ws_example
fprintf('f08ws 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 = 'Balance';
[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 = 'No Q';
compz = 'No Z';
z = complex(eye(4));
q = complex(eye(4));
jlo = int64(1);
jhi = int64(ihi-ilo+1);
[H, T, ~, ~, info] = ...
f08ws( ...
compq, compz, jlo, jhi, c, QR, q, z);
job = 'Eigenvalues';
[~, ~, alpha, beta, ~, ~, info] = ...
f08xs( ...
job, compq, compz, jlo, jhi, H, T, q, z);
disp('Generalized eigenvalues of (A,B):');
disp(sort(alpha./beta));
f08ws example results
Generalized eigenvalues of (A,B):
0.6744 - 0.0499i
0.4580 - 0.8426i
0.4934 + 0.9102i
-0.6354 + 1.6529i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015