66 INTEGER LDA, LDB, LDVL, LDVR
67 parameter( lda = 50, ldb = 50, ldvl = 50, ldvr = 50 )
68 INTEGER LDE, LDF, LDWORK, LRWORK
69 parameter( lde = 50, ldf = 50, ldwork = 50,
72 parameter( zero = 0.0d+0 )
73 COMPLEX*16 CZERO, CONE
74 parameter( czero = ( 0.0d+0, 0.0d+0 ),
75 $ cone = ( 1.0d+0, 0.0d+0 ) )
78 INTEGER I, IHI, ILO, INFO, J, KNT, M, N, NINFO
79 DOUBLE PRECISION ANORM, BNORM, EPS, RMAX, VMAX
84 DOUBLE PRECISION LSCALE( LDA ), RSCALE( LDA ), RWORK( LRWORK )
85 COMPLEX*16 A( LDA, LDA ), AF( LDA, LDA ), B( LDB, LDB ),
86 $ BF( LDB, LDB ), E( LDE, LDE ), F( LDF, LDF ),
87 $ VL( LDVL, LDVL ), VLF( LDVL, LDVL ),
88 $ VR( LDVR, LDVR ), VRF( LDVR, LDVR ),
89 $ WORK( LDWORK, LDWORK )
92 DOUBLE PRECISION DLAMCH, ZLANGE
93 EXTERNAL dlamch, zlange
99 INTRINSIC abs, dble, dimag, max
102 DOUBLE PRECISION CABS1
105 cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( cdum ) )
117 eps = dlamch(
'Precision' )
120 READ( nin, fmt = * )n, m
125 READ( nin, fmt = * )( a( i, j ), j = 1, n )
129 READ( nin, fmt = * )( b( i, j ), j = 1, n )
133 READ( nin, fmt = * )( vl( i, j ), j = 1, m )
137 READ( nin, fmt = * )( vr( i, j ), j = 1, m )
142 anorm = zlange(
'M', n, n, a, lda, rwork )
143 bnorm = zlange(
'M', n, n, b, ldb, rwork )
145 CALL zlacpy(
'FULL', n, n, a, lda, af, lda )
146 CALL zlacpy(
'FULL', n, n, b, ldb, bf, ldb )
148 CALL zggbal(
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
155 CALL zlacpy(
'FULL', n, m, vl, ldvl, vlf, ldvl )
156 CALL zlacpy(
'FULL', n, m, vr, ldvr, vrf, ldvr )
158 CALL zggbak(
'B',
'L', n, ilo, ihi, lscale, rscale, m, vl, ldvl,
165 CALL zggbak(
'B',
'R', n, ilo, ihi, lscale, rscale, m, vr, ldvr,
177 CALL zgemm(
'N',
'N', n, m, n, cone, af, lda, vr, ldvr, czero,
179 CALL zgemm(
'C',
'N', m, m, n, cone, vl, ldvl, work, ldwork,
182 CALL zgemm(
'N',
'N', n, m, n, cone, a, lda, vrf, ldvr, czero,
184 CALL zgemm(
'C',
'N', m, m, n, cone, vlf, ldvl, work, ldwork,
190 vmax = max( vmax, cabs1( e( i, j )-f( i, j ) ) )
193 vmax = vmax / ( eps*max( anorm, bnorm ) )
194 IF( vmax.GT.rmax )
THEN
201 CALL zgemm(
'N',
'N', n, m, n, cone, bf, ldb, vr, ldvr, czero,
203 CALL zgemm(
'C',
'N', m, m, n, cone, vl, ldvl, work, ldwork,
206 CALL zgemm(
'n',
'n', n, m, n, cone, b, ldb, vrf, ldvr, czero,
208 CALL zgemm(
'C',
'N', m, m, n, cone, vlf, ldvl, work, ldwork,
214 vmax = max( vmax, cabs1( e( i, j )-f( i, j ) ) )
217 vmax = vmax / ( eps*max( anorm, bnorm ) )
218 IF( vmax.GT.rmax )
THEN
227 WRITE( nout, fmt = 9999 )
228 9999
FORMAT( 1x,
'.. test output of ZGGBAK .. ' )
230 WRITE( nout, fmt = 9998 )rmax
231 9998
FORMAT(
' value of largest test error =', d12.3 )
232 WRITE( nout, fmt = 9997 )lmax( 1 )
233 9997
FORMAT(
' example number where ZGGBAL info is not 0 =', i4 )
234 WRITE( nout, fmt = 9996 )lmax( 2 )
235 9996
FORMAT(
' example number where ZGGBAK(L) info is not 0 =', i4 )
236 WRITE( nout, fmt = 9995 )lmax( 3 )
237 9995
FORMAT(
' example number where ZGGBAK(R) info is not 0 =', i4 )
238 WRITE( nout, fmt = 9994 )lmax( 4 )
239 9994
FORMAT(
' example number having largest error =', i4 )
240 WRITE( nout, fmt = 9992 )ninfo
241 9992
FORMAT(
' number of examples where info is not 0 =', i4 )
242 WRITE( nout, fmt = 9991 )knt
243 9991
FORMAT(
' total number of examples tested =', i4 )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zggbak(job, side, n, ilo, ihi, lscale, rscale, m, v, ldv, info)
ZGGBAK
subroutine zggbal(job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work, info)
ZGGBAL
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zchkgk(nin, nout)
ZCHKGK