00001 SUBROUTINE DDRVAB( DOTYPE, NM, MVAL, NNS,
00002 $ NSVAL, THRESH, NMAX, A, AFAC, B,
00003 $ X, WORK, RWORK, SWORK, IWORK, NOUT )
00004 IMPLICIT NONE
00005
00006
00007
00008
00009
00010
00011 INTEGER NM, NMAX, NNS, NOUT
00012 DOUBLE PRECISION THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER MVAL( * ), NSVAL( * ), IWORK( * )
00017 REAL SWORK(*)
00018 DOUBLE PRECISION A( * ), AFAC( * ), B( * ),
00019 $ RWORK( * ), WORK( * ), X( * )
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 DOUBLE PRECISION ONE, ZERO
00084 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00085 INTEGER NTYPES
00086 PARAMETER ( NTYPES = 11 )
00087 INTEGER NTESTS
00088 PARAMETER ( NTESTS = 1 )
00089
00090
00091 LOGICAL ZEROT
00092 CHARACTER DIST, TRANS, TYPE, XTYPE
00093 CHARACTER*3 PATH
00094 INTEGER I, IM, IMAT, INFO, IOFF, IRHS,
00095 $ IZERO, KL, KU, LDA, M, MODE, N,
00096 $ NERRS, NFAIL, NIMAT, NRHS, NRUN
00097 DOUBLE PRECISION ANORM, CNDNUM
00098
00099
00100 INTEGER ISEED( 4 ), ISEEDY( 4 )
00101 DOUBLE PRECISION RESULT( NTESTS )
00102
00103
00104 INTEGER ITER, KASE
00105
00106
00107 EXTERNAL ALAERH, ALAHD, DGET08, DLACPY, DLARHS, DLASET,
00108 $ DLATB4, DLATMS
00109
00110
00111 INTRINSIC DBLE, MAX, MIN, SQRT
00112
00113
00114 LOGICAL LERR, OK
00115 CHARACTER*32 SRNAMT
00116 INTEGER INFOT, NUNIT
00117
00118
00119 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00120 COMMON / SRNAMC / SRNAMT
00121
00122
00123 DATA ISEEDY / 2006, 2007, 2008, 2009 /
00124
00125
00126
00127
00128
00129 KASE = 0
00130 PATH( 1: 1 ) = 'Double precision'
00131 PATH( 2: 3 ) = 'GE'
00132 NRUN = 0
00133 NFAIL = 0
00134 NERRS = 0
00135 DO 10 I = 1, 4
00136 ISEED( I ) = ISEEDY( I )
00137 10 CONTINUE
00138
00139 INFOT = 0
00140
00141
00142
00143 DO 120 IM = 1, NM
00144 M = MVAL( IM )
00145 LDA = MAX( 1, M )
00146
00147 N = M
00148 NIMAT = NTYPES
00149 IF( M.LE.0 .OR. N.LE.0 )
00150 $ NIMAT = 1
00151
00152 DO 100 IMAT = 1, NIMAT
00153
00154
00155
00156 IF( .NOT.DOTYPE( IMAT ) )
00157 $ GO TO 100
00158
00159
00160
00161 ZEROT = IMAT.GE.5 .AND. IMAT.LE.7
00162 IF( ZEROT .AND. N.LT.IMAT-4 )
00163 $ GO TO 100
00164
00165
00166
00167
00168 CALL DLATB4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
00169 $ CNDNUM, DIST )
00170
00171 SRNAMT = 'DLATMS'
00172 CALL DLATMS( M, N, DIST, ISEED, TYPE, RWORK, MODE,
00173 $ CNDNUM, ANORM, KL, KU, 'No packing', A, LDA,
00174 $ WORK, INFO )
00175
00176
00177
00178 IF( INFO.NE.0 ) THEN
00179 CALL ALAERH( PATH, 'DLATMS', INFO, 0, ' ', M, N, -1,
00180 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00181 GO TO 100
00182 END IF
00183
00184
00185
00186
00187 IF( ZEROT ) THEN
00188 IF( IMAT.EQ.5 ) THEN
00189 IZERO = 1
00190 ELSE IF( IMAT.EQ.6 ) THEN
00191 IZERO = MIN( M, N )
00192 ELSE
00193 IZERO = MIN( M, N ) / 2 + 1
00194 END IF
00195 IOFF = ( IZERO-1 )*LDA
00196 IF( IMAT.LT.7 ) THEN
00197 DO 20 I = 1, M
00198 A( IOFF+I ) = ZERO
00199 20 CONTINUE
00200 ELSE
00201 CALL DLASET( 'Full', M, N-IZERO+1, ZERO, ZERO,
00202 $ A( IOFF+1 ), LDA )
00203 END IF
00204 ELSE
00205 IZERO = 0
00206 END IF
00207
00208 DO 60 IRHS = 1, NNS
00209 NRHS = NSVAL( IRHS )
00210 XTYPE = 'N'
00211 TRANS = 'N'
00212
00213 SRNAMT = 'DLARHS'
00214 CALL DLARHS( PATH, XTYPE, ' ', TRANS, N, N, KL,
00215 $ KU, NRHS, A, LDA, X, LDA, B,
00216 $ LDA, ISEED, INFO )
00217
00218 SRNAMT = 'DSGESV'
00219
00220 KASE = KASE + 1
00221
00222 CALL DLACPY( 'Full', M, N, A, LDA, AFAC, LDA )
00223
00224 CALL DSGESV( N, NRHS, A, LDA, IWORK, B, LDA, X, LDA,
00225 $ WORK, SWORK, ITER, INFO)
00226
00227 IF (ITER.LT.0) THEN
00228 CALL DLACPY( 'Full', M, N, AFAC, LDA, A, LDA )
00229 ENDIF
00230
00231
00232
00233
00234 IF( INFO.NE.IZERO ) THEN
00235
00236 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00237 $ CALL ALAHD( NOUT, PATH )
00238 NERRS = NERRS + 1
00239
00240 IF( INFO.NE.IZERO .AND. IZERO.NE.0 ) THEN
00241 WRITE( NOUT, FMT = 9988 )'DSGESV',INFO,
00242 $ IZERO,M,IMAT
00243 ELSE
00244 WRITE( NOUT, FMT = 9975 )'DSGESV',INFO,
00245 $ M, IMAT
00246 END IF
00247 END IF
00248
00249
00250
00251 IF( INFO.NE.0 )
00252 $ GO TO 100
00253
00254
00255
00256 CALL DLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00257
00258 CALL DGET08( TRANS, N, N, NRHS, A, LDA, X, LDA, WORK,
00259 $ LDA, RWORK, RESULT( 1 ) )
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273 IF ((THRESH.LE.0.0E+00)
00274 $ .OR.((ITER.GE.0).AND.(N.GT.0)
00275 $ .AND.(RESULT(1).GE.SQRT(DBLE(N))))
00276 $ .OR.((ITER.LT.0).AND.(RESULT(1).GE.THRESH))) THEN
00277
00278 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 ) THEN
00279 WRITE( NOUT, FMT = 8999 )'DGE'
00280 WRITE( NOUT, FMT = '( '' Matrix types:'' )' )
00281 WRITE( NOUT, FMT = 8979 )
00282 WRITE( NOUT, FMT = '( '' Test ratios:'' )' )
00283 WRITE( NOUT, FMT = 8960 )1
00284 WRITE( NOUT, FMT = '( '' Messages:'' )' )
00285 END IF
00286
00287 WRITE( NOUT, FMT = 9998 )TRANS, N, NRHS,
00288 $ IMAT, 1, RESULT( 1 )
00289 NFAIL = NFAIL + 1
00290 END IF
00291 NRUN = NRUN + 1
00292 60 CONTINUE
00293 100 CONTINUE
00294 120 CONTINUE
00295
00296
00297
00298 IF( NFAIL.GT.0 ) THEN
00299 WRITE( NOUT, FMT = 9996 )'DSGESV', NFAIL, NRUN
00300 ELSE
00301 WRITE( NOUT, FMT = 9995 )'DSGESV', NRUN
00302 END IF
00303 IF( NERRS.GT.0 ) THEN
00304 WRITE( NOUT, FMT = 9994 )NERRS
00305 END IF
00306
00307 9998 FORMAT( ' TRANS=''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
00308 $ I2, ', test(', I2, ') =', G12.5 )
00309 9996 FORMAT( 1X, A6, ': ', I6, ' out of ', I6,
00310 $ ' tests failed to pass the threshold' )
00311 9995 FORMAT( /1X, 'All tests for ', A6,
00312 $ ' routines passed the threshold (', I6, ' tests run)' )
00313 9994 FORMAT( 6X, I6, ' error messages recorded' )
00314
00315
00316
00317 9988 FORMAT( ' *** ', A6, ' returned with INFO =', I5, ' instead of ',
00318 $ I5, / ' ==> M =', I5, ', type ',
00319 $ I2 )
00320
00321
00322
00323 9975 FORMAT( ' *** Error code from ', A6, '=', I5, ' for M=', I5,
00324 $ ', type ', I2 )
00325 8999 FORMAT( / 1X, A3, ': General dense matrices' )
00326 8979 FORMAT( 4X, '1. Diagonal', 24X, '7. Last n/2 columns zero', / 4X,
00327 $ '2. Upper triangular', 16X,
00328 $ '8. Random, CNDNUM = sqrt(0.1/EPS)', / 4X,
00329 $ '3. Lower triangular', 16X, '9. Random, CNDNUM = 0.1/EPS',
00330 $ / 4X, '4. Random, CNDNUM = 2', 13X,
00331 $ '10. Scaled near underflow', / 4X, '5. First column zero',
00332 $ 14X, '11. Scaled near overflow', / 4X,
00333 $ '6. Last column zero' )
00334 8960 FORMAT( 3X, I2, ': norm_1( B - A * X ) / ',
00335 $ '( norm_1(A) * norm_1(X) * EPS * SQRT(N) ) > 1 if ITERREF',
00336 $ / 4x, 'or norm_1( B - A * X ) / ',
00337 $ '( norm_1(A) * norm_1(X) * EPS ) > THRES if DGETRF' )
00338 RETURN
00339
00340
00341
00342 END