hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_lapack_dhgeqz (f08xe)

Purpose

nag_lapack_dhgeqz (f08xe) implements the QZQZ method for finding generalized eigenvalues of the real matrix pair (A,B)(A,B) of order nn, which is in the generalized upper Hessenberg form.

Syntax

[a, b, alphar, alphai, beta, q, z, info] = f08xe(job, compq, compz, ilo, ihi, a, b, q, z, 'n', n)
[a, b, alphar, alphai, beta, q, z, info] = nag_lapack_dhgeqz(job, compq, compz, ilo, ihi, a, b, q, z, 'n', n)

Description

nag_lapack_dhgeqz (f08xe) implements a single-double-shift version of the QZQZ method for finding the generalized eigenvalues of the real matrix pair (A,B)(A,B) which is in the generalized upper Hessenberg form. If the matrix pair (A,B)(A,B) is not in the generalized upper Hessenberg form, then the function nag_lapack_dgghrd (f08we) should be called before invoking nag_lapack_dhgeqz (f08xe).
This problem is mathematically equivalent to solving the equation
det(AλB) = 0.
det(A-λB)=0.
Note that, to avoid underflow, overflow and other arithmetic problems, the generalized eigenvalues λjλj are never computed explicitly by this function but defined as ratios between two computed values, αjαj and βjβj:
λj = αj / βj.
λj=αj/βj.
The parameters αjαj, in general, are finite complex values and βjβj are finite real non-negative values.
If desired, the matrix pair (A,B)(A,B) may be reduced to generalized Schur form. That is, the transformed matrix BB is upper triangular and the transformed matrix AA is block upper triangular, where the diagonal blocks are either 11 by 11 or 22 by 22. The 11 by 11 blocks provide generalized eigenvalues which are real and the 22 by 22 blocks give complex generalized eigenvalues.
The parameter job specifies two options. If job = 'S'job='S' then the matrix pair (A,B)(A,B) is simultaneously reduced to Schur form by applying one orthogonal transformation (usually called QQ) on the left and another (usually called ZZ) on the right. That is,
AQTAZ
BQTBZ
AQTAZ BQTBZ
The 22 by 22 upper-triangular diagonal blocks of BB corresponding to 22 by 22 blocks of a will be reduced to non-negative diagonal matrices. That is, if a(j + 1,j)aj+1j is nonzero, then b(j + 1,j) = b(j,j + 1) = 0bj+1j=bjj+1=0 and b(j,j)bjj and b(j + 1,j + 1)bj+1j+1 will be non-negative.
If job = 'E'job='E', then at each iteration the same transformations are computed but they are only applied to those parts of AA and BB which are needed to compute αα and ββ. This option could be used if generalized eigenvalues are required but not generalized eigenvectors.
If job = 'S'job='S' and compq = 'V'compq='V' or 'I''I', and compz = 'V'compz='V' or 'I''I', then the orthogonal transformations used to reduce the pair (A,B)(A,B) are accumulated into the input arrays q and z. If generalized eigenvectors are required then job must be set to job = 'S'job='S' and if left (right) generalized eigenvectors are to be computed then compq (compz) must be set to compq = 'V'compq='V' or 'I''I' and not compq'N'compq'N'.
If compq = 'I'compq='I', then eigenvectors are accumulated on the identity matrix and on exit the array q contains the left eigenvector matrix QQ. However, if compq = 'V'compq='V' then the transformations are accumulated on the user-supplied matrix Q0Q0 in array q on entry and thus on exit q contains the matrix product QQ0QQ0. A similar convention is used for compz.

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:     job – string (length ≥ 1)
Specifies the operations to be performed on (A,B)(A,B).
job = 'E'job='E'
The matrix pair (A,B)(A,B) on exit might not be in the generalized Schur form.
job = 'S'job='S'
The matrix pair (A,B)(A,B) on exit will be in the generalized Schur form.
Constraint: job = 'E'job='E' or 'S''S'.
2:     compq – string (length ≥ 1)
Specifies the operations to be performed on QQ:
compq = 'N'compq='N'
The array q is unchanged.
compq = 'V'compq='V'
The left transformation QQ is accumulated on the array q.
compq = 'I'compq='I'
The array q is initialized to the identity matrix before the left transformation QQ is accumulated in q.
Constraint: compq = 'N'compq='N', 'V''V' or 'I''I'.
3:     compz – string (length ≥ 1)
Specifies the operations to be performed on ZZ.
compz = 'N'compz='N'
The array z is unchanged.
compz = 'V'compz='V'
The right transformation ZZ is accumulated on the array z.
compz = 'I'compz='I'
The array z is initialized to the identity matrix before the right transformation ZZ is accumulated in z.
Constraint: compz = 'N'compz='N', 'V''V' or 'I''I'.
4:     ilo – int64int32nag_int scalar
5:     ihi – int64int32nag_int scalar
The indices iloilo and ihiihi, respectively which define the upper triangular parts of AA. The submatrices A(1 : ilo1,1 : ilo1)A(1:ilo-1,1:ilo-1) and A(ihi + 1 : n,ihi + 1 : n)A(ihi+1:n,ihi+1:n) are then upper triangular. These parameters are provided by nag_lapack_dggbal (f08wh) if the matrix pair was previously balanced; otherwise, ilo = 1ilo=1 and ihi = nihi=n.
Constraints:
  • if n > 0n>0, 1 ilo ihi n 1 ilo ihi n ;
  • if n = 0n=0, ilo = 1ilo=1 and ihi = 0ihi=0.
6:     a(lda, : :) – double array
The first dimension of the array a must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
The nn by nn upper Hessenberg matrix AA. The elements below the first subdiagonal must be set to zero.
7:     b(ldb, : :) – double array
The first dimension of the array b must be at least max (1,n)max(1,n)
The second dimension of the array must be at least max (1,n)max(1,n)
The nn by nn upper triangular matrix BB. The elements below the diagonal must be zero.
8:     q(ldq, : :) – double array
The first dimension, ldq, of the array q must satisfy
  • if compq = 'V'compq='V' or 'I''I', ldqnldqn;
  • if compq = 'N'compq='N', ldq1ldq1.
The second dimension of the array must be at least max (1,n)max(1,n) if compq = 'V'compq='V' or 'I''I' and at least 11 if compq = 'N'compq='N'
If compq = 'V'compq='V', the matrix Q0Q0. The matrix Q0Q0 is usually the matrix QQ returned by nag_lapack_dgghrd (f08we).
If compq = 'N'compq='N', q is not referenced.
9:     z(ldz, : :) – double array
The first dimension, ldz, of the array z must satisfy
  • if compz = 'V'compz='V' or 'I''I', ldznldzn;
  • if compz = 'N'compz='N', ldz1ldz1.
The second dimension of the array must be at least max (1,n)max(1,n) if compz = 'V'compz='V' or 'I''I' and at least 11 if compz = 'N'compz='N'
If compz = 'V'compz='V', the matrix Z0Z0. The matrix Z0Z0 is usually the matrix ZZ returned by nag_lapack_dgghrd (f08we).
If compz = 'N'compz='N', z is not referenced.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the arrays a, b, q, z and the first dimension of the arrays a, b, q, z. (An error is raised if these dimensions are not equal.)
nn, the order of the matrices AA, BB, QQ and ZZ.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda ldb ldq ldz work lwork

Output Parameters

1:     a(lda, : :) – double array
The first dimension of the array a will be max (1,n)max(1,n)
The second dimension of the array will be max (1,n)max(1,n)
ldamax (1,n)ldamax(1,n).
If job = 'S'job='S', the matrix pair (A,B)(A,B) will be simultaneously reduced to generalized Schur form.
If job = 'E'job='E', the 11 by 11 and 22 by 22 diagonal blocks of the matrix pair (A,B)(A,B) will give generalized eigenvalues but the remaining elements will be irrelevant.
2:     b(ldb, : :) – double array
The first dimension of the array b will be max (1,n)max(1,n)
The second dimension of the array will be max (1,n)max(1,n)
ldbmax (1,n)ldbmax(1,n).
If job = 'S'job='S', the matrix pair (A,B)(A,B) will be simultaneously reduced to generalized Schur form.
If job = 'E'job='E', the 11 by 11 and 22 by 22 diagonal blocks of the matrix pair (A,B)(A,B) will give generalized eigenvalues but the remaining elements will be irrelevant.
3:     alphar(n) – double array
The real parts of αjαj, for j = 1,2,,nj=1,2,,n.
4:     alphai(n) – double array
The imaginary parts of αjαj, for j = 1,2,,nj=1,2,,n.
5:     beta(n) – double array
βjβj, for j = 1,2,,nj=1,2,,n.
6:     q(ldq, : :) – double array
The first dimension, ldq, of the array q will be
  • if compq = 'V'compq='V' or 'I''I', ldqnldqn;
  • if compq = 'N'compq='N', ldq1ldq1.
The second dimension of the array will be max (1,n)max(1,n) if compq = 'V'compq='V' or 'I''I' and at least 11 if compq = 'N'compq='N'
If compq = 'V'compq='V', q contains the matrix product QQ0QQ0.
If compq = 'I'compq='I', q contains the transformation matrix QQ.
7:     z(ldz, : :) – double array
The first dimension, ldz, of the array z will be
  • if compz = 'V'compz='V' or 'I''I', ldznldzn;
  • if compz = 'N'compz='N', ldz1ldz1.
The second dimension of the array will be max (1,n)max(1,n) if compz = 'V'compz='V' or 'I''I' and at least 11 if compz = 'N'compz='N'
If compz = 'V'compz='V', z contains the matrix product ZZ0ZZ0.
If compz = 'I'compz='I', z contains the transformation matrix ZZ.
8:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: job, 2: compq, 3: compz, 4: n, 5: ilo, 6: ihi, 7: a, 8: lda, 9: b, 10: ldb, 11: alphar, 12: alphai, 13: beta, 14: q, 15: ldq, 16: z, 17: ldz, 18: work, 19: lwork, 20: 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.
W INFO > 0INFO>0
If 1infon1infon, the QZQZ iteration did not converge and the matrix pair (A,B)(A,B) is not in the generalized Schur form at exit. However, if info < ninfo<n, then the computed αiαi and βiβi should be correct for i = info + 1,,ni=info+1,,n.
If n + 1info2 × nn+1info2×n, the computation of shifts failed and the matrix pair (A,B)(A,B) is not in the generalized Schur form at exit. However, if info < 2 × ninfo<2×n, then the computed αiαi and βiβi should be correct for i = infon + 1,,ni=info-n+1,,n.
If info > 2 × ninfo>2×n, then an unexpected Library error has occurred. Please contact NAG with details of your program.

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.

Further Comments

nag_lapack_dhgeqz (f08xe) is the fifth step in the solution of the real generalized eigenvalue problem and is called after nag_lapack_dgghrd (f08we).
The complex analogue of this function is nag_lapack_zhgeqz (f08xs).

Example

function nag_lapack_dhgeqz_example
job = 'E';
compq = 'N';
compz = 'N';
ilo = int64(1);
ihi = int64(5);
a = [-2.189810707792021, -0.3180631496384764, 2.054737360337475, 4.737051060297061, -4.624850206812896;
     -0.8394814256667084, -0.04260743300187281, 1.713177967213399, 7.519359344321846, -17.18497520550213;
     0, -0.2846066329550604, -1.010138844149892, -7.592717358895769, 26.44987440544933;
     0, 0, 0.03760479481131811, 1.406985307241882, -3.364334058817744;
     0, 0, 0, 0.3813286811696227, -0.9937277052627631];
b = [-1.424780684877501, -0.3475888720966965, 2.117452772490474, 5.581290451976649, -3.926921758179354;
     0, -0.07815942868997351, 0.1189259258468025, 8.094037761230025, -15.29282773410979;
     0, 0, 1.002063542716526, -10.93557202634477, 26.59706530085059;
     0, 0, 0, 0.5820029710844786, -0.07301489821533858;
     0, 0, 0, 0, 0.5321375124277468];
q = [0];
z = [0];
[aOut, bOut, alphar, alphai, beta, qOut, zOut, info] = ...
    nag_lapack_dhgeqz(job, compq, compz, ilo, ihi, a, b, q, z)
 

aOut =

   -0.4330    0.6639    0.9146   -2.7880   29.4287
         0    2.2720   -0.7786    3.8072   13.4928
         0    0.6959    0.0160    2.1786   -9.1764
         0         0         0    0.7767   -3.6815
         0         0         0         0   -0.1777


bOut =

    0.1777   -0.2721   -1.8961   -5.7730   30.3016
         0    1.9594         0    4.4074   11.8279
         0         0    0.2951    1.4584   -7.7335
         0         0         0    0.7767   -0.2075
         0         0         0         0    0.4330


alphar =

   -0.4330
    0.4809
    0.4427
    0.7767
   -0.1777


alphai =

         0
    0.6299
   -0.5798
         0
         0


beta =

    0.1777
    0.7925
    0.7295
    0.7767
    0.4330


qOut =

     0


zOut =

     0


info =

                    0


function f08xe_example
job = 'E';
compq = 'N';
compz = 'N';
ilo = int64(1);
ihi = int64(5);
a = [-2.189810707792021, -0.3180631496384764, 2.054737360337475, 4.737051060297061, -4.624850206812896;
     -0.8394814256667084, -0.04260743300187281, 1.713177967213399, 7.519359344321846, -17.18497520550213;
     0, -0.2846066329550604, -1.010138844149892, -7.592717358895769, 26.44987440544933;
     0, 0, 0.03760479481131811, 1.406985307241882, -3.364334058817744;
     0, 0, 0, 0.3813286811696227, -0.9937277052627631];
b = [-1.424780684877501, -0.3475888720966965, 2.117452772490474, 5.581290451976649, -3.926921758179354;
     0, -0.07815942868997351, 0.1189259258468025, 8.094037761230025, -15.29282773410979;
     0, 0, 1.002063542716526, -10.93557202634477, 26.59706530085059;
     0, 0, 0, 0.5820029710844786, -0.07301489821533858;
     0, 0, 0, 0, 0.5321375124277468];
q = [0];
z = [0];
[aOut, bOut, alphar, alphai, beta, qOut, zOut, info] = ...
    f08xe(job, compq, compz, ilo, ihi, a, b, q, z)
 

aOut =

   -0.4330    0.6639    0.9146   -2.7880   29.4287
         0    2.2720   -0.7786    3.8072   13.4928
         0    0.6959    0.0160    2.1786   -9.1764
         0         0         0    0.7767   -3.6815
         0         0         0         0   -0.1777


bOut =

    0.1777   -0.2721   -1.8961   -5.7730   30.3016
         0    1.9594         0    4.4074   11.8279
         0         0    0.2951    1.4584   -7.7335
         0         0         0    0.7767   -0.2075
         0         0         0         0    0.4330


alphar =

   -0.4330
    0.4809
    0.4427
    0.7767
   -0.1777


alphai =

         0
    0.6299
   -0.5798
         0
         0


beta =

    0.1777
    0.7925
    0.7295
    0.7767
    0.4330


qOut =

     0


zOut =

     0


info =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013