66 INTEGER LDA, LDB, LDVL, LDVR
67 parameter( lda = 50, ldb = 50, ldvl = 50, ldvr = 50 )
68 INTEGER LDE, LDF, LDWORK
69 parameter( lde = 50, ldf = 50, ldwork = 50 )
70 DOUBLE PRECISION ZERO, ONE
71 parameter( zero = 0.0d+0, one = 1.0d+0 )
74 INTEGER I, IHI, ILO, INFO, J, KNT, M, N, NINFO
75 DOUBLE PRECISION ANORM, BNORM, EPS, RMAX, VMAX
79 DOUBLE PRECISION A( LDA, LDA ), AF( LDA, LDA ), B( LDB, LDB ),
80 $ BF( LDB, LDB ), E( LDE, LDE ), F( LDF, LDF ),
81 $ LSCALE( LDA ), RSCALE( LDA ), VL( LDVL, LDVL ),
82 $ VLF( LDVL, LDVL ), VR( LDVR, LDVR ),
83 $ VRF( LDVR, LDVR ), WORK( LDWORK, LDWORK )
86 DOUBLE PRECISION DLAMCH, DLANGE
87 EXTERNAL dlamch, dlange
107 eps = dlamch(
'Precision' )
110 READ( nin, fmt = * )n, m
115 READ( nin, fmt = * )( a( i, j ), j = 1, n )
119 READ( nin, fmt = * )( b( i, j ), j = 1, n )
123 READ( nin, fmt = * )( vl( i, j ), j = 1, m )
127 READ( nin, fmt = * )( vr( i, j ), j = 1, m )
132 anorm = dlange(
'M', n, n, a, lda, work )
133 bnorm = dlange(
'M', n, n, b, ldb, work )
135 CALL dlacpy(
'FULL', n, n, a, lda, af, lda )
136 CALL dlacpy(
'FULL', n, n, b, ldb, bf, ldb )
138 CALL dggbal(
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
145 CALL dlacpy(
'FULL', n, m, vl, ldvl, vlf, ldvl )
146 CALL dlacpy(
'FULL', n, m, vr, ldvr, vrf, ldvr )
148 CALL dggbak(
'B',
'L', n, ilo, ihi, lscale, rscale, m, vl, ldvl,
155 CALL dggbak(
'B',
'R', n, ilo, ihi, lscale, rscale, m, vr, ldvr,
167 CALL dgemm(
'N',
'N', n, m, n, one, af, lda, vr, ldvr, zero, work,
169 CALL dgemm(
'T',
'N', m, m, n, one, vl, ldvl, work, ldwork, zero,
172 CALL dgemm(
'N',
'N', n, m, n, one, a, lda, vrf, ldvr, zero, work,
174 CALL dgemm(
'T',
'N', m, m, n, one, vlf, ldvl, work, ldwork, zero,
180 vmax = max( vmax, abs( e( i, j )-f( i, j ) ) )
183 vmax = vmax / ( eps*max( anorm, bnorm ) )
184 IF( vmax.GT.rmax )
THEN
191 CALL dgemm(
'N',
'N', n, m, n, one, bf, ldb, vr, ldvr, zero, work,
193 CALL dgemm(
'T',
'N', m, m, n, one, vl, ldvl, work, ldwork, zero,
196 CALL dgemm(
'N',
'N', n, m, n, one, b, ldb, vrf, ldvr, zero, work,
198 CALL dgemm(
'T',
'N', m, m, n, one, vlf, ldvl, work, ldwork, zero,
204 vmax = max( vmax, abs( e( i, j )-f( i, j ) ) )
207 vmax = vmax / ( eps*max( anorm, bnorm ) )
208 IF( vmax.GT.rmax )
THEN
217 WRITE( nout, fmt = 9999 )
218 9999
FORMAT( 1x,
'.. test output of DGGBAK .. ' )
220 WRITE( nout, fmt = 9998 )rmax
221 9998
FORMAT(
' value of largest test error =', d12.3 )
222 WRITE( nout, fmt = 9997 )lmax( 1 )
223 9997
FORMAT(
' example number where DGGBAL info is not 0 =', i4 )
224 WRITE( nout, fmt = 9996 )lmax( 2 )
225 9996
FORMAT(
' example number where DGGBAK(L) info is not 0 =', i4 )
226 WRITE( nout, fmt = 9995 )lmax( 3 )
227 9995
FORMAT(
' example number where DGGBAK(R) info is not 0 =', i4 )
228 WRITE( nout, fmt = 9994 )lmax( 4 )
229 9994
FORMAT(
' example number having largest error =', i4 )
230 WRITE( nout, fmt = 9993 )ninfo
231 9993
FORMAT(
' number of examples where info is not 0 =', i4 )
232 WRITE( nout, fmt = 9992 )knt
233 9992
FORMAT(
' total number of examples tested =', i4 )
subroutine dchkgk(nin, nout)
DCHKGK
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dggbak(job, side, n, ilo, ihi, lscale, rscale, m, v, ldv, info)
DGGBAK
subroutine dggbal(job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work, info)
DGGBAL
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.