69 INTEGER lda, ldb, ldvl, ldvr
70 parameter( lda = 50, ldb = 50, ldvl = 50, ldvr = 50 )
71 INTEGER lde, ldf, ldwork
72 parameter(
lde = 50, ldf = 50, ldwork = 50 )
73 DOUBLE PRECISION zero, one
74 parameter( zero = 0.0d+0, one = 1.0d+0 )
77 INTEGER i, ihi, ilo, info, j, knt, m, n, ninfo
78 DOUBLE PRECISION anorm, bnorm, eps, rmax, vmax
82 DOUBLE PRECISION a( lda, lda ), af( lda, lda ), b( ldb, ldb ),
83 $ bf( ldb, ldb ), e(
lde,
lde ), f( ldf, ldf ),
84 $ lscale( lda ), rscale( lda ), vl( ldvl, ldvl ),
85 $ vlf( ldvl, ldvl ), vr( ldvr, ldvr ),
86 $ vrf( ldvr, ldvr ), work( ldwork, ldwork )
110 eps =
dlamch(
'Precision' )
113 READ( nin, fmt = * )n, m
118 READ( nin, fmt = * )( a( i, j ), j = 1, n )
122 READ( nin, fmt = * )( b( i, j ), j = 1, n )
126 READ( nin, fmt = * )( vl( i, j ), j = 1, m )
130 READ( nin, fmt = * )( vr( i, j ), j = 1, m )
135 anorm =
dlange(
'M', n, n, a, lda, work )
136 bnorm =
dlange(
'M', n, n, b, ldb, work )
138 CALL
dlacpy(
'FULL', n, n, a, lda, af, lda )
139 CALL
dlacpy(
'FULL', n, n, b, ldb, bf, ldb )
141 CALL
dggbal(
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
148 CALL
dlacpy(
'FULL', n, m, vl, ldvl, vlf, ldvl )
149 CALL
dlacpy(
'FULL', n, m, vr, ldvr, vrf, ldvr )
151 CALL
dggbak(
'B',
'L', n, ilo, ihi, lscale, rscale, m, vl, ldvl,
158 CALL
dggbak(
'B',
'R', n, ilo, ihi, lscale, rscale, m, vr, ldvr,
170 CALL
dgemm(
'N',
'N', n, m, n, one, af, lda, vr, ldvr, zero, work,
172 CALL
dgemm(
'T',
'N', m, m, n, one, vl, ldvl, work, ldwork, zero,
175 CALL
dgemm(
'N',
'N', n, m, n, one, a, lda, vrf, ldvr, zero, work,
177 CALL
dgemm(
'T',
'N', m, m, n, one, vlf, ldvl, work, ldwork, zero,
183 vmax = max( vmax, abs( e( i, j )-f( i, j ) ) )
186 vmax = vmax / ( eps*max( anorm, bnorm ) )
187 IF( vmax.GT.rmax )
THEN
194 CALL
dgemm(
'N',
'N', n, m, n, one, bf, ldb, vr, ldvr, zero, work,
196 CALL
dgemm(
'T',
'N', m, m, n, one, vl, ldvl, work, ldwork, zero,
199 CALL
dgemm(
'N',
'N', n, m, n, one, b, ldb, vrf, ldvr, zero, work,
201 CALL
dgemm(
'T',
'N', m, m, n, one, vlf, ldvl, work, ldwork, zero,
207 vmax = max( vmax, abs( e( i, j )-f( i, j ) ) )
210 vmax = vmax / ( eps*max( anorm, bnorm ) )
211 IF( vmax.GT.rmax )
THEN
220 WRITE( nout, fmt = 9999 )
221 9999 format( 1x,
'.. test output of DGGBAK .. ' )
223 WRITE( nout, fmt = 9998 )rmax
224 9998 format(
' value of largest test error =', d12.3 )
225 WRITE( nout, fmt = 9997 )lmax( 1 )
226 9997 format(
' example number where DGGBAL info is not 0 =', i4 )
227 WRITE( nout, fmt = 9996 )lmax( 2 )
228 9996 format(
' example number where DGGBAK(L) info is not 0 =', i4 )
229 WRITE( nout, fmt = 9995 )lmax( 3 )
230 9995 format(
' example number where DGGBAK(R) info is not 0 =', i4 )
231 WRITE( nout, fmt = 9994 )lmax( 4 )
232 9994 format(
' example number having largest error =', i4 )
233 WRITE( nout, fmt = 9993 )ninfo
234 9993 format(
' number of examples where info is not 0 =', i4 )
235 WRITE( nout, fmt = 9992 )knt
236 9992 format(
' total number of examples tested =', i4 )