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 )
71 parameter( zero = 0.0e+0, one = 1.0e+0 )
74 INTEGER I, IHI, ILO, INFO, J, KNT, M, N, NINFO
75 REAL ANORM, BNORM, EPS, RMAX, VMAX
79 REAL 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 )
87 EXTERNAL slamch, slange
107 eps = slamch(
'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 = slange(
'M', n, n, a, lda, work )
133 bnorm = slange(
'M', n, n, b, ldb, work )
135 CALL slacpy(
'FULL', n, n, a, lda, af, lda )
136 CALL slacpy(
'FULL', n, n, b, ldb, bf, ldb )
138 CALL sggbal(
'B', n, a, lda, b, ldb, ilo, ihi, lscale, rscale,
145 CALL slacpy(
'FULL', n, m, vl, ldvl, vlf, ldvl )
146 CALL slacpy(
'FULL', n, m, vr, ldvr, vrf, ldvr )
148 CALL sggbak(
'B',
'L', n, ilo, ihi, lscale, rscale, m, vl, ldvl,
155 CALL sggbak(
'B',
'R', n, ilo, ihi, lscale, rscale, m, vr, ldvr,
167 CALL sgemm(
'N',
'N', n, m, n, one, af, lda, vr, ldvr, zero, work,
169 CALL sgemm(
'T',
'N', m, m, n, one, vl, ldvl, work, ldwork, zero,
172 CALL sgemm(
'N',
'N', n, m, n, one, a, lda, vrf, ldvr, zero, work,
174 CALL sgemm(
'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 sgemm(
'N',
'N', n, m, n, one, bf, ldb, vr, ldvr, zero, work,
193 CALL sgemm(
'T',
'N', m, m, n, one, vl, ldvl, work, ldwork, zero,
196 CALL sgemm(
'N',
'N', n, m, n, one, b, ldb, vrf, ldvr, zero, work,
198 CALL sgemm(
'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 SGGBAK .. ' )
220 WRITE( nout, fmt = 9998 )rmax
221 9998
FORMAT(
' value of largest test error =', e12.3 )
222 WRITE( nout, fmt = 9997 )lmax( 1 )
223 9997
FORMAT(
' example number where SGGBAL info is not 0 =', i4 )
224 WRITE( nout, fmt = 9996 )lmax( 2 )
225 9996
FORMAT(
' example number where SGGBAK(L) info is not 0 =', i4 )
226 WRITE( nout, fmt = 9995 )lmax( 3 )
227 9995
FORMAT(
' example number where SGGBAK(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 = 9992 )ninfo
231 9992
FORMAT(
' number of examples where info is not 0 =', i4 )
232 WRITE( nout, fmt = 9991 )knt
233 9991
FORMAT(
' total number of examples tested =', i4 )
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sggbak(job, side, n, ilo, ihi, lscale, rscale, m, v, ldv, info)
SGGBAK
subroutine sggbal(job, n, a, lda, b, ldb, ilo, ihi, lscale, rscale, work, info)
SGGBAL
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine schkgk(nin, nout)
SCHKGK