Purpose
To compute the eigenvalues of a real N-by-N skew-Hamiltonian/
Hamiltonian pencil aS - bH with
( A D ) ( C V )
S = ( ) and H = ( ). (1)
( E A' ) ( W -C' )
Optionally, if JOB = 'T', decompositions of S and H will be
computed via orthogonal transformations Q1 and Q2 as follows:
( Aout Dout )
Q1' S J Q1 J' = ( ),
( 0 Aout' )
( Bout Fout )
J' Q2' J S Q2 = ( ) =: T, (2)
( 0 Bout' )
( C1out Vout ) ( 0 I )
Q1' H Q2 = ( ), where J = ( )
( 0 C2out' ) ( -I 0 )
and Aout, Bout, C1out are upper triangular, C2out is upper quasi-
triangular and Dout and Fout are skew-symmetric. The notation M'
denotes the transpose of the matrix M.
Optionally, if COMPQ1 = 'I', the orthogonal transformation matrix
Q1 will be computed.
Optionally, if COMPQ2 = 'I', the orthogonal transformation matrix
Q2 will be computed.
Specification
SUBROUTINE MB04BD( JOB, COMPQ1, COMPQ2, N, A, LDA, DE, LDDE, C1,
$ LDC1, VW, LDVW, Q1, LDQ1, Q2, LDQ2, B, LDB, F,
$ LDF, C2, LDC2, ALPHAR, ALPHAI, BETA, IWORK,
$ LIWORK, DWORK, LDWORK, INFO )
C .. Scalar Arguments ..
CHARACTER COMPQ1, COMPQ2, JOB
INTEGER INFO, LDA, LDB, LDC1, LDC2, LDDE, LDF, LDQ1,
$ LDQ2, LDVW, LDWORK, LIWORK, N
C .. Array Arguments ..
INTEGER IWORK( * )
DOUBLE PRECISION A( LDA, * ), ALPHAI( * ), ALPHAR( * ),
$ B( LDB, * ), BETA( * ), C1( LDC1, * ),
$ C2( LDC2, * ), DE( LDDE, * ), DWORK( * ),
$ F( LDF, * ), Q1( LDQ1, * ), Q2( LDQ2, * ),
$ VW( LDVW, * )
Arguments
Mode Parameters
JOB CHARACTER*1
Specifies the computation to be performed, as follows:
= 'E': compute the eigenvalues only; S and H will not
necessarily be transformed as in (2).
= 'T': put S and H into the forms in (2) and return the
eigenvalues in ALPHAR, ALPHAI and BETA.
COMPQ1 CHARACTER*1
Specifies whether to compute the orthogonal transformation
matrix Q1, as follows:
= 'N': Q1 is not computed;
= 'I': the array Q1 is initialized internally to the unit
matrix, and the orthogonal matrix Q1 is returned;
= 'U': the array Q1 contains an orthogonal matrix Q on
entry, and the product Q*Q1 is returned, where Q1
is the product of the orthogonal transformations
that are applied to the pencil aS - bH to reduce
S and H to the forms in (2), for COMPQ1 = 'I'.
COMPQ2 CHARACTER*1
Specifies whether to compute the orthogonal transformation
matrix Q2, as follows:
= 'N': Q2 is not computed;
= 'I': on exit, the array Q2 contains the orthogonal
matrix Q2;
= 'U': on exit, the array Q2 contains the matrix product
J*Q*J'*Q2, where Q2 is the product of the
orthogonal transformations that are applied to
the pencil aS - bH to reduce S and H to the forms
in (2), for COMPQ2 = 'I'.
Setting COMPQ2 <> 'N' assumes COMPQ2 = COMPQ1.
Input/Output Parameters
N (input) INTEGER
The order of the pencil aS - bH. N has to be even.
A (input/output) DOUBLE PRECISION array, dimension
(LDA, N/2)
On entry, the leading N/2-by-N/2 part of this array must
contain the matrix A.
On exit, if JOB = 'T', the leading N/2-by-N/2 part of this
array contains the matrix Aout; otherwise, it contains the
upper triangular matrix A obtained just before the
application of the periodic QZ algorithm.
LDA INTEGER
The leading dimension of the array A. LDA >= MAX(1, N/2).
DE (input/output) DOUBLE PRECISION array, dimension
(LDDE, N/2+1)
On entry, the leading N/2-by-N/2 strictly lower triangular
part of this array must contain the strictly lower
triangular part of the skew-symmetric matrix E, and the
N/2-by-N/2 strictly upper triangular part of the submatrix
in the columns 2 to N/2+1 of this array must contain the
strictly upper triangular part of the skew-symmetric
matrix D.
The entries on the diagonal and the first superdiagonal of
this array need not be set, but are assumed to be zero.
On exit, if JOB = 'T', the leading N/2-by-N/2 strictly
upper triangular part of the submatrix in the columns
2 to N/2+1 of this array contains the strictly upper
triangular part of the skew-symmetric matrix Dout.
If JOB = 'E', the leading N/2-by-N/2 strictly upper
triangular part of the submatrix in the columns 2 to N/2+1
of this array contains the strictly upper triangular part
of the skew-symmetric matrix D just before the application
of the periodic QZ algorithm. The remaining entries are
meaningless.
LDDE INTEGER
The leading dimension of the array DE.
LDDE >= MAX(1, N/2).
C1 (input/output) DOUBLE PRECISION array, dimension
(LDC1, N/2)
On entry, the leading N/2-by-N/2 part of this array must
contain the matrix C1 = C.
On exit, if JOB = 'T', the leading N/2-by-N/2 part of this
array contains the matrix C1out; otherwise, it contains the
upper triangular matrix C1 obtained just before the
application of the periodic QZ algorithm.
LDC1 INTEGER
The leading dimension of the array C1.
LDC1 >= MAX(1, N/2).
VW (input/output) DOUBLE PRECISION array, dimension
(LDVW, N/2+1)
On entry, the leading N/2-by-N/2 lower triangular part of
this array must contain the lower triangular part of the
symmetric matrix W, and the N/2-by-N/2 upper triangular
part of the submatrix in the columns 2 to N/2+1 of this
array must contain the upper triangular part of the
symmetric matrix V.
On exit, if JOB = 'T', the N/2-by-N/2 part in the columns
2 to N/2+1 of this array contains the matrix Vout.
If JOB = 'E', the N/2-by-N/2 part in the columns 2 to
N/2+1 of this array contains the matrix V just before the
application of the periodic QZ algorithm.
LDVW INTEGER
The leading dimension of the array VW.
LDVW >= MAX(1, N/2).
Q1 (input/output) DOUBLE PRECISION array, dimension (LDQ1, N)
On entry, if COMPQ1 = 'U', then the leading N-by-N part of
this array must contain a given matrix Q, and on exit,
the leading N-by-N part of this array contains the product
of the input matrix Q and the transformation matrix Q1
used to transform the matrices S and H.
On exit, if COMPQ1 = 'I', then the leading N-by-N part of
this array contains the orthogonal transformation matrix
Q1.
If COMPQ1 = 'N', this array is not referenced.
LDQ1 INTEGER
The leading dimension of the array Q1.
LDQ1 >= 1, if COMPQ1 = 'N';
LDQ1 >= MAX(1, N), if COMPQ1 = 'I' or COMPQ1 = 'U'.
Q2 (output) DOUBLE PRECISION array, dimension (LDQ2, N)
On exit, if COMPQ2 = 'U', then the leading N-by-N part of
this array contains the product of the matrix J*Q*J' and
the transformation matrix Q2 used to transform the
matrices S and H.
On exit, if COMPQ2 = 'I', then the leading N-by-N part of
this array contains the orthogonal transformation matrix
Q2.
If COMPQ2 = 'N', this array is not referenced.
LDQ2 INTEGER
The leading dimension of the array Q2.
LDQ2 >= 1, if COMPQ2 = 'N';
LDQ2 >= MAX(1, N), if COMPQ2 = 'I' or COMPQ2 = 'U'.
B (output) DOUBLE PRECISION array, dimension (LDB, N/2)
On exit, if JOB = 'T', the leading N/2-by-N/2 part of this
array contains the matrix Bout; otherwise, it contains the
upper triangular matrix B obtained just before the
application of the periodic QZ algorithm.
LDB INTEGER
The leading dimension of the array B. LDB >= MAX(1, N/2).
F (output) DOUBLE PRECISION array, dimension (LDF, N/2)
On exit, if JOB = 'T', the leading N/2-by-N/2 strictly
upper triangular part of this array contains the strictly
upper triangular part of the skew-symmetric matrix Fout.
If JOB = 'E', the leading N/2-by-N/2 strictly upper
triangular part of this array contains the strictly upper
triangular part of the skew-symmetric matrix F just before
the application of the periodic QZ algorithm.
The entries on the leading N/2-by-N/2 lower triangular
part of this array are not referenced.
LDF INTEGER
The leading dimension of the array F. LDF >= MAX(1, N/2).
C2 (output) DOUBLE PRECISION array, dimension (LDC2, N/2)
On exit, if JOB = 'T', the leading N/2-by-N/2 part of this
array contains the matrix C2out; otherwise, it contains
the upper Hessenberg matrix C2 obtained just before the
application of the periodic QZ algorithm.
LDC2 INTEGER
The leading dimension of the array C2.
LDC2 >= MAX(1, N/2).
ALPHAR (output) DOUBLE PRECISION array, dimension (N/2)
The real parts of each scalar alpha defining an eigenvalue
of the pencil aS - bH.
ALPHAI (output) DOUBLE PRECISION array, dimension (N/2)
The imaginary parts of each scalar alpha defining an
eigenvalue of the pencil aS - bH.
If ALPHAI(j) is zero, then the j-th eigenvalue is real.
BETA (output) DOUBLE PRECISION array, dimension (N/2)
The scalars beta that define the eigenvalues of the pencil
aS - bH.
Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and
beta = BETA(j) represent the j-th eigenvalue of the pencil
aS - bH, in the form lambda = alpha/beta. Since lambda may
overflow, the ratios should not, in general, be computed.
Due to the skew-Hamiltonian/Hamiltonian structure of the
pencil, for every eigenvalue lambda, -lambda is also an
eigenvalue, and thus it has only to be saved once in
ALPHAR, ALPHAI and BETA.
Specifically, only eigenvalues with imaginary parts
greater than or equal to zero are stored; their conjugate
eigenvalues are not stored. If imaginary parts are zero
(i.e., for real eigenvalues), only positive eigenvalues
are stored.
Workspace
IWORK INTEGER array, dimension (LIWORK)
LIWORK INTEGER
The dimension of the array IWORK.
LIWORK >= N/2+12.
DWORK DOUBLE PRECISION array, dimension (LDWORK)
On exit, if INFO = 0, DWORK(1) returns the optimal LDWORK.
On exit, if INFO = -27, DWORK(1) returns the minimum
value of LDWORK.
LDWORK INTEGER
The dimension of the array DWORK.
If JOB = 'E' and COMPQ1 = 'N' and COMPQ2 = 'N',
LDWORK >= N**2 + MAX(N,32);
if JOB = 'T' or COMPQ1 <> 'N' or COMPQ2 <> 'N',
LDWORK >= 2*N**2 + MAX(N,32).
For good performance LDWORK should generally be larger.
Error Indicator
INFO INTEGER
= 0: succesful exit;
< 0: if INFO = -i, the i-th argument had an illegal value;
= 1: problem during computation of the eigenvalues;
= 2: periodic QZ algorithm did not converge in the SLICOT
Library subroutine MB03BD.
Method
The algorithm uses Givens rotations and Householder reflections to annihilate elements in S, T, and H such that A, B, and C1 are upper triangular and C2 is upper Hessenberg. Finally, the periodic QZ algorithm is applied to transform C2 to upper quasi-triangular form while A, B, and C1 stay in upper triangular form. See also page 27 in [1] for more details.References
[1] Benner, P., Byers, R., Losse, P., Mehrmann, V. and Xu, H.
Numerical Solution of Real Skew-Hamiltonian/Hamiltonian
Eigenproblems.
Tech. Rep., Technical University Chemnitz, Germany,
Nov. 2007.
Numerical Aspects
3 The algorithm is numerically backward stable and needs O(N ) real floating point operations.Further Comments
NoneExample
Program Text
* MB04BD EXAMPLE PROGRAM TEXT
* Copyright (c) 2002-2010 NICONET e.V.
*
* .. Parameters ..
INTEGER NIN, NOUT
PARAMETER ( NIN = 5, NOUT = 6 )
INTEGER NMAX
PARAMETER ( NMAX = 50 )
INTEGER LDA, LDB, LDC1, LDC2, LDDE, LDF, LDQ1, LDQ2,
$ LDVW, LDWORK, LIWORK
PARAMETER ( LDA = NMAX/2, LDB = NMAX/2, LDC1 = NMAX/2,
$ LDC2 = NMAX/2, LDDE = NMAX/2, LDF = NMAX/2,
$ LDQ1 = NMAX, LDQ2 = NMAX, LDVW = NMAX/2,
$ LDWORK = 2*NMAX*NMAX + MAX( NMAX, 32 ),
$ LIWORK = NMAX/2 + 12 )
*
* .. Local Scalars ..
CHARACTER COMPQ1, COMPQ2, JOB
INTEGER I, INFO, J, M, N
*
* .. Local Arrays ..
INTEGER IWORK( LIWORK )
DOUBLE PRECISION A( LDA, NMAX/2 ), ALPHAI( NMAX/2 ),
$ ALPHAR( NMAX/2 ), B( LDB, NMAX/2 ),
$ BETA( NMAX/2 ), C1( LDC1, NMAX/2 ),
$ C2( LDC2, NMAX/2 ), DE( LDDE, NMAX/2+1 ),
$ DWORK( LDWORK ), F( LDF, NMAX/2 ),
$ Q1( LDQ1, NMAX ), Q2( LDQ2, NMAX ),
$ VW( LDVW, NMAX/2+1 )
*
* .. External Functions ..
LOGICAL LSAME
EXTERNAL LSAME
*
* .. External Subroutines ..
EXTERNAL MB04BD
*
* .. Intrinsic Functions ..
INTRINSIC MAX
*
* .. Executable Statements ..
*
WRITE( NOUT, FMT = 99999 )
* Skip the heading in the data file and read in the data.
READ( NIN, FMT = * )
READ( NIN, FMT = * ) JOB, COMPQ1, COMPQ2, N
IF( N.LT.0 .OR. N.GT.NMAX ) THEN
WRITE( NOUT, FMT = 99998 ) N
ELSE
M = N/2
READ( NIN, FMT = * ) ( ( A( I, J ), J = 1, M ), I = 1, M )
READ( NIN, FMT = * ) ( ( DE( I, J ), J = 1, M+1 ), I = 1, M )
READ( NIN, FMT = * ) ( ( C1( I, J ), J = 1, M ), I = 1, M )
READ( NIN, FMT = * ) ( ( VW( I, J ), J = 1, M+1 ), I = 1, M )
* Compute the eigenvalues of a real skew-Hamiltonian/Hamiltonian
* pencil.
CALL MB04BD( JOB, COMPQ1, COMPQ2, N, A, LDA, DE, LDDE, C1,
$ LDC1, VW, LDVW, Q1, LDQ1, Q2, LDQ2, B, LDB, F,
$ LDF, C2, LDC2, ALPHAR, ALPHAI, BETA, IWORK,
$ LIWORK, DWORK, LDWORK, INFO )
*
IF( INFO.NE.0 ) THEN
WRITE( NOUT, FMT = 99997 ) INFO
ELSE
WRITE( NOUT, FMT = 99996 )
DO 10 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( A( I, J ), J = 1, M )
10 CONTINUE
WRITE( NOUT, FMT = 99994 )
DO 20 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( DE( I, J ), J = 2, M+1 )
20 CONTINUE
WRITE( NOUT, FMT = 99993 )
DO 30 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( B( I, J ), J = 1, M )
30 CONTINUE
WRITE( NOUT, FMT = 99992 )
DO 40 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( F( I, J ), J = 1, M )
40 CONTINUE
WRITE( NOUT, FMT = 99991 )
DO 50 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( C1( I, J ), J = 1, M )
50 CONTINUE
WRITE( NOUT, FMT = 99990 )
DO 60 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( C2( I, J ), J = 1, M )
60 CONTINUE
WRITE( NOUT, FMT = 99989 )
DO 70 I = 1, M
WRITE( NOUT, FMT = 99995 ) ( VW( I, J ), J = 2, M+1 )
70 CONTINUE
WRITE( NOUT, FMT = 99988 )
WRITE( NOUT, FMT = 99995 ) ( ALPHAR( I ), I = 1, M )
WRITE( NOUT, FMT = 99987 )
WRITE( NOUT, FMT = 99995 ) ( ALPHAI( I ), I = 1, M )
WRITE( NOUT, FMT = 99986 )
WRITE( NOUT, FMT = 99995 ) ( BETA( I ), I = 1, M )
WRITE( NOUT, FMT = 99985 )
IF( .NOT.LSAME( COMPQ1, 'N' ) ) THEN
DO 80 I = 1, N
WRITE( NOUT, FMT = 99995 ) ( Q1( I, J ), J = 1, N )
80 CONTINUE
END IF
IF( .NOT.LSAME( COMPQ2, 'N' ) ) THEN
WRITE( NOUT, FMT = 99984 )
DO 90 I = 1, N
WRITE( NOUT, FMT = 99995 ) ( Q2( I, J ), J = 1, N )
90 CONTINUE
END IF
END IF
END IF
STOP
*
99999 FORMAT( 'MB04BD EXAMPLE PROGRAM RESULTS', 1X )
99998 FORMAT( 'N is out of range.', /, 'N = ', I5 )
99997 FORMAT( 'INFO on exit from MB04BD = ', I2 )
99996 FORMAT( 'The matrix A on exit is ' )
99995 FORMAT( 50( 1X, F8.4 ) )
99994 FORMAT( 'The matrix D on exit is ' )
99993 FORMAT( 'The matrix B on exit is ' )
99992 FORMAT( 'The matrix F on exit is ' )
99991 FORMAT( 'The matrix C1 on exit is ' )
99990 FORMAT( 'The matrix C2 on exit is ' )
99989 FORMAT( 'The matrix V on exit is ' )
99988 FORMAT( 'The vector ALPHAR is ' )
99987 FORMAT( 'The vector ALPHAI is ' )
99986 FORMAT( 'The vector BETA is ' )
99985 FORMAT( 'The matrix Q1 is ' )
99984 FORMAT( 'The matrix Q2 is ' )
END
Program Data
MB04BD EXAMPLE PROGRAM DATA T I I 8 3.1472 1.3236 4.5751 4.5717 4.0579 -4.0246 4.6489 -0.1462 -3.7301 -2.2150 -3.4239 3.0028 4.1338 0.4688 4.7059 -3.5811 0.0000 0.0000 -1.5510 -4.5974 -2.5127 3.5071 0.0000 0.0000 1.5961 2.4490 -3.1428 2.5648 0.0000 0.0000 -0.0596 3.0340 2.4892 -1.1604 0.0000 0.0000 0.6882 -3.3782 -3.3435 1.8921 -0.3061 2.9428 1.0198 2.4815 -4.8810 -1.8878 -2.3703 -0.4946 -1.6288 0.2853 1.5408 -4.1618 -2.4013 -2.7102 0.3834 -3.9335 3.1730 -3.1815 -2.3620 4.9613 4.6190 3.6869 3.6929 0.7970 0.4986 -4.9537 -4.1556 3.5303 1.2206 -1.4905 0.1325 -1.0022Program Results
MB04BD EXAMPLE PROGRAM RESULTS The matrix A on exit is -4.7460 4.1855 3.2696 -0.2244 0.0000 6.4157 2.8287 1.4553 0.0000 0.0000 7.4626 1.5726 0.0000 0.0000 0.0000 8.8702 The matrix D on exit is 0.0000 -1.3137 -6.3615 -0.8940 0.0000 0.0000 1.0704 -0.0659 4.4324 0.0000 0.0000 -0.6922 0.5254 1.6653 0.0000 0.0000 The matrix B on exit is -6.4937 -2.1982 -1.3881 1.3477 0.0000 4.6929 0.6650 -4.1191 0.0000 0.0000 9.1725 3.4721 0.0000 0.0000 0.0000 7.2106 The matrix F on exit is 0.0000 -1.1367 2.2966 -1.0744 0.0000 0.0000 3.7875 0.9427 0.0000 0.0000 0.0000 -4.7136 0.0000 0.0000 0.0000 0.0000 The matrix C1 on exit is 6.9525 -4.9881 2.3661 4.2188 0.0000 8.5009 0.7182 5.5533 0.0000 0.0000 -4.6650 -2.8177 0.0000 0.0000 0.0000 1.5124 The matrix C2 on exit is -5.4562 -2.1348 4.9694 -2.2744 2.5550 -7.9616 1.1516 3.4912 0.0000 0.0000 4.8504 0.5046 0.0000 0.0000 0.0000 4.4394 The matrix V on exit is 0.9136 4.1106 -0.0079 3.5789 -1.1553 -1.4785 -1.5155 -0.8018 -2.2167 4.8029 1.3645 2.5202 -1.0994 -0.6144 0.3970 2.0730 The vector ALPHAR is 0.8314 -1.1758 0.8131 0.0000 The vector ALPHAI is 0.4372 0.6183 0.0000 0.9164 The vector BETA is 0.7071 1.0000 1.4142 2.8284 The matrix Q1 is -0.0098 0.1978 0.2402 0.5274 0.1105 -0.0149 -0.1028 0.7759 -0.6398 0.2356 0.2765 -0.1301 -0.5351 -0.3078 0.2435 0.0373 0.1766 -0.4781 0.2657 -0.5415 0.0968 -0.4663 -0.0983 0.3741 0.3207 -0.1980 0.1141 0.0240 -0.1712 0.2630 0.8513 0.1451 -0.6551 -0.2956 -0.0288 -0.1169 0.5593 0.3381 0.1753 0.1055 -0.0246 -0.2759 0.2470 -0.1408 -0.4837 0.6567 -0.4042 0.1172 -0.0772 -0.0121 -0.8394 -0.1852 -0.2673 0.0046 0.0159 0.4282 0.1442 0.6884 0.1257 -0.5860 0.2110 0.2699 0.0363 0.1657 The matrix Q2 is -0.2891 0.3096 0.6312 0.6498 0.0000 0.0000 0.0000 0.0000 0.1887 0.1936 -0.3857 0.3664 0.5660 0.1238 -0.2080 -0.5148 -0.2492 -0.2877 -0.0874 0.1110 -0.1081 -0.2999 0.6800 -0.5207 -0.7430 -0.0646 -0.4689 0.1556 -0.2401 0.0181 -0.3724 0.0562 -0.0999 -0.2026 -0.0355 0.0866 0.5587 -0.6625 -0.0114 0.4349 -0.4357 0.1209 0.0489 -0.2990 0.5094 0.5191 0.3837 0.1661 -0.2429 0.4131 0.2549 -0.5525 0.0749 -0.3829 -0.2690 -0.4190 0.0889 0.7439 -0.3960 0.0697 -0.1821 -0.1988 0.3687 0.2616
Click here to get a compressed (gzip) tar file containing the source code of the routine, the example program, data, documentation, and related files.
Return to index