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