00001 SUBROUTINE DCHKGE( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NNS,
00002 $ NSVAL, THRESH, TSTERR, NMAX, A, AFAC, AINV, B,
00003 $ X, XACT, WORK, RWORK, IWORK, NOUT )
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 LOGICAL TSTERR
00014 INTEGER NM, NMAX, NN, NNB, NNS, NOUT
00015 DOUBLE PRECISION THRESH
00016
00017
00018 LOGICAL DOTYPE( * )
00019 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NSVAL( * ),
00020 $ NVAL( * )
00021 DOUBLE PRECISION A( * ), AFAC( * ), AINV( * ), B( * ),
00022 $ RWORK( * ), WORK( * ), X( * ), XACT( * )
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
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101 DOUBLE PRECISION ONE, ZERO
00102 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00103 INTEGER NTYPES
00104 PARAMETER ( NTYPES = 11 )
00105 INTEGER NTESTS
00106 PARAMETER ( NTESTS = 8 )
00107 INTEGER NTRAN
00108 PARAMETER ( NTRAN = 3 )
00109
00110
00111 LOGICAL TRFCON, ZEROT
00112 CHARACTER DIST, NORM, TRANS, TYPE, XTYPE
00113 CHARACTER*3 PATH
00114 INTEGER I, IM, IMAT, IN, INB, INFO, IOFF, IRHS, ITRAN,
00115 $ IZERO, K, KL, KU, LDA, LWORK, M, MODE, N, NB,
00116 $ NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
00117 DOUBLE PRECISION AINVNM, ANORM, ANORMI, ANORMO, CNDNUM, DUMMY,
00118 $ RCOND, RCONDC, RCONDI, RCONDO
00119
00120
00121 CHARACTER TRANSS( NTRAN )
00122 INTEGER ISEED( 4 ), ISEEDY( 4 )
00123 DOUBLE PRECISION RESULT( NTESTS )
00124
00125
00126 DOUBLE PRECISION DGET06, DLANGE
00127 EXTERNAL DGET06, DLANGE
00128
00129
00130 EXTERNAL ALAERH, ALAHD, ALASUM, DERRGE, DGECON, DGERFS,
00131 $ DGET01, DGET02, DGET03, DGET04, DGET07, DGETRF,
00132 $ DGETRI, DGETRS, DLACPY, DLARHS, DLASET, DLATB4,
00133 $ DLATMS, XLAENV
00134
00135
00136 INTRINSIC MAX, MIN
00137
00138
00139 LOGICAL LERR, OK
00140 CHARACTER*32 SRNAMT
00141 INTEGER INFOT, NUNIT
00142
00143
00144 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00145 COMMON / SRNAMC / SRNAMT
00146
00147
00148 DATA ISEEDY / 1988, 1989, 1990, 1991 / ,
00149 $ TRANSS / 'N', 'T', 'C' /
00150
00151
00152
00153
00154
00155 PATH( 1: 1 ) = 'Double precision'
00156 PATH( 2: 3 ) = 'GE'
00157 NRUN = 0
00158 NFAIL = 0
00159 NERRS = 0
00160 DO 10 I = 1, 4
00161 ISEED( I ) = ISEEDY( I )
00162 10 CONTINUE
00163
00164
00165
00166 CALL XLAENV( 1, 1 )
00167 IF( TSTERR )
00168 $ CALL DERRGE( PATH, NOUT )
00169 INFOT = 0
00170 CALL XLAENV( 2, 2 )
00171
00172
00173
00174 DO 120 IM = 1, NM
00175 M = MVAL( IM )
00176 LDA = MAX( 1, M )
00177
00178
00179
00180 DO 110 IN = 1, NN
00181 N = NVAL( IN )
00182 XTYPE = 'N'
00183 NIMAT = NTYPES
00184 IF( M.LE.0 .OR. N.LE.0 )
00185 $ NIMAT = 1
00186
00187 DO 100 IMAT = 1, NIMAT
00188
00189
00190
00191 IF( .NOT.DOTYPE( IMAT ) )
00192 $ GO TO 100
00193
00194
00195
00196 ZEROT = IMAT.GE.5 .AND. IMAT.LE.7
00197 IF( ZEROT .AND. N.LT.IMAT-4 )
00198 $ GO TO 100
00199
00200
00201
00202
00203 CALL DLATB4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
00204 $ CNDNUM, DIST )
00205
00206 SRNAMT = 'DLATMS'
00207 CALL DLATMS( M, N, DIST, ISEED, TYPE, RWORK, MODE,
00208 $ CNDNUM, ANORM, KL, KU, 'No packing', A, LDA,
00209 $ WORK, INFO )
00210
00211
00212
00213 IF( INFO.NE.0 ) THEN
00214 CALL ALAERH( PATH, 'DLATMS', INFO, 0, ' ', M, N, -1,
00215 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00216 GO TO 100
00217 END IF
00218
00219
00220
00221
00222 IF( ZEROT ) THEN
00223 IF( IMAT.EQ.5 ) THEN
00224 IZERO = 1
00225 ELSE IF( IMAT.EQ.6 ) THEN
00226 IZERO = MIN( M, N )
00227 ELSE
00228 IZERO = MIN( M, N ) / 2 + 1
00229 END IF
00230 IOFF = ( IZERO-1 )*LDA
00231 IF( IMAT.LT.7 ) THEN
00232 DO 20 I = 1, M
00233 A( IOFF+I ) = ZERO
00234 20 CONTINUE
00235 ELSE
00236 CALL DLASET( 'Full', M, N-IZERO+1, ZERO, ZERO,
00237 $ A( IOFF+1 ), LDA )
00238 END IF
00239 ELSE
00240 IZERO = 0
00241 END IF
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251 DO 90 INB = 1, NNB
00252 NB = NBVAL( INB )
00253 CALL XLAENV( 1, NB )
00254
00255
00256
00257 CALL DLACPY( 'Full', M, N, A, LDA, AFAC, LDA )
00258 SRNAMT = 'DGETRF'
00259 CALL DGETRF( M, N, AFAC, LDA, IWORK, INFO )
00260
00261
00262
00263 IF( INFO.NE.IZERO )
00264 $ CALL ALAERH( PATH, 'DGETRF', INFO, IZERO, ' ', M,
00265 $ N, -1, -1, NB, IMAT, NFAIL, NERRS,
00266 $ NOUT )
00267 TRFCON = .FALSE.
00268
00269
00270
00271
00272 CALL DLACPY( 'Full', M, N, AFAC, LDA, AINV, LDA )
00273 CALL DGET01( M, N, A, LDA, AINV, LDA, IWORK, RWORK,
00274 $ RESULT( 1 ) )
00275 NT = 1
00276
00277
00278
00279
00280
00281 IF( M.EQ.N .AND. INFO.EQ.0 ) THEN
00282 CALL DLACPY( 'Full', N, N, AFAC, LDA, AINV, LDA )
00283 SRNAMT = 'DGETRI'
00284 NRHS = NSVAL( 1 )
00285 LWORK = NMAX*MAX( 3, NRHS )
00286 CALL DGETRI( N, AINV, LDA, IWORK, WORK, LWORK,
00287 $ INFO )
00288
00289
00290
00291 IF( INFO.NE.0 )
00292 $ CALL ALAERH( PATH, 'DGETRI', INFO, 0, ' ', N, N,
00293 $ -1, -1, NB, IMAT, NFAIL, NERRS,
00294 $ NOUT )
00295
00296
00297
00298
00299
00300 CALL DGET03( N, A, LDA, AINV, LDA, WORK, LDA,
00301 $ RWORK, RCONDO, RESULT( 2 ) )
00302 ANORMO = DLANGE( 'O', M, N, A, LDA, RWORK )
00303
00304
00305
00306 ANORMI = DLANGE( 'I', M, N, A, LDA, RWORK )
00307 AINVNM = DLANGE( 'I', N, N, AINV, LDA, RWORK )
00308 IF( ANORMI.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
00309 RCONDI = ONE
00310 ELSE
00311 RCONDI = ( ONE / ANORMI ) / AINVNM
00312 END IF
00313 NT = 2
00314 ELSE
00315
00316
00317
00318 TRFCON = .TRUE.
00319 ANORMO = DLANGE( 'O', M, N, A, LDA, RWORK )
00320 ANORMI = DLANGE( 'I', M, N, A, LDA, RWORK )
00321 RCONDO = ZERO
00322 RCONDI = ZERO
00323 END IF
00324
00325
00326
00327
00328 DO 30 K = 1, NT
00329 IF( RESULT( K ).GE.THRESH ) THEN
00330 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00331 $ CALL ALAHD( NOUT, PATH )
00332 WRITE( NOUT, FMT = 9999 )M, N, NB, IMAT, K,
00333 $ RESULT( K )
00334 NFAIL = NFAIL + 1
00335 END IF
00336 30 CONTINUE
00337 NRUN = NRUN + NT
00338
00339
00340
00341
00342
00343 IF( INB.GT.1 .OR. M.NE.N )
00344 $ GO TO 90
00345 IF( TRFCON )
00346 $ GO TO 70
00347
00348 DO 60 IRHS = 1, NNS
00349 NRHS = NSVAL( IRHS )
00350 XTYPE = 'N'
00351
00352 DO 50 ITRAN = 1, NTRAN
00353 TRANS = TRANSS( ITRAN )
00354 IF( ITRAN.EQ.1 ) THEN
00355 RCONDC = RCONDO
00356 ELSE
00357 RCONDC = RCONDI
00358 END IF
00359
00360
00361
00362
00363 SRNAMT = 'DLARHS'
00364 CALL DLARHS( PATH, XTYPE, ' ', TRANS, N, N, KL,
00365 $ KU, NRHS, A, LDA, XACT, LDA, B,
00366 $ LDA, ISEED, INFO )
00367 XTYPE = 'C'
00368
00369 CALL DLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00370 SRNAMT = 'DGETRS'
00371 CALL DGETRS( TRANS, N, NRHS, AFAC, LDA, IWORK,
00372 $ X, LDA, INFO )
00373
00374
00375
00376 IF( INFO.NE.0 )
00377 $ CALL ALAERH( PATH, 'DGETRS', INFO, 0, TRANS,
00378 $ N, N, -1, -1, NRHS, IMAT, NFAIL,
00379 $ NERRS, NOUT )
00380
00381 CALL DLACPY( 'Full', N, NRHS, B, LDA, WORK,
00382 $ LDA )
00383 CALL DGET02( TRANS, N, N, NRHS, A, LDA, X, LDA,
00384 $ WORK, LDA, RWORK, RESULT( 3 ) )
00385
00386
00387
00388
00389 CALL DGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00390 $ RESULT( 4 ) )
00391
00392
00393
00394
00395
00396 SRNAMT = 'DGERFS'
00397 CALL DGERFS( TRANS, N, NRHS, A, LDA, AFAC, LDA,
00398 $ IWORK, B, LDA, X, LDA, RWORK,
00399 $ RWORK( NRHS+1 ), WORK,
00400 $ IWORK( N+1 ), INFO )
00401
00402
00403
00404 IF( INFO.NE.0 )
00405 $ CALL ALAERH( PATH, 'DGERFS', INFO, 0, TRANS,
00406 $ N, N, -1, -1, NRHS, IMAT, NFAIL,
00407 $ NERRS, NOUT )
00408
00409 CALL DGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00410 $ RESULT( 5 ) )
00411 CALL DGET07( TRANS, N, NRHS, A, LDA, B, LDA, X,
00412 $ LDA, XACT, LDA, RWORK, .TRUE.,
00413 $ RWORK( NRHS+1 ), RESULT( 6 ) )
00414
00415
00416
00417
00418 DO 40 K = 3, 7
00419 IF( RESULT( K ).GE.THRESH ) THEN
00420 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00421 $ CALL ALAHD( NOUT, PATH )
00422 WRITE( NOUT, FMT = 9998 )TRANS, N, NRHS,
00423 $ IMAT, K, RESULT( K )
00424 NFAIL = NFAIL + 1
00425 END IF
00426 40 CONTINUE
00427 NRUN = NRUN + 5
00428 50 CONTINUE
00429 60 CONTINUE
00430
00431
00432
00433
00434 70 CONTINUE
00435 DO 80 ITRAN = 1, 2
00436 IF( ITRAN.EQ.1 ) THEN
00437 ANORM = ANORMO
00438 RCONDC = RCONDO
00439 NORM = 'O'
00440 ELSE
00441 ANORM = ANORMI
00442 RCONDC = RCONDI
00443 NORM = 'I'
00444 END IF
00445 SRNAMT = 'DGECON'
00446 CALL DGECON( NORM, N, AFAC, LDA, ANORM, RCOND,
00447 $ WORK, IWORK( N+1 ), INFO )
00448
00449
00450
00451 IF( INFO.NE.0 )
00452 $ CALL ALAERH( PATH, 'DGECON', INFO, 0, NORM, N,
00453 $ N, -1, -1, -1, IMAT, NFAIL, NERRS,
00454 $ NOUT )
00455
00456
00457
00458 DUMMY = RCOND
00459
00460 RESULT( 8 ) = DGET06( RCOND, RCONDC )
00461
00462
00463
00464
00465 IF( RESULT( 8 ).GE.THRESH ) THEN
00466 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00467 $ CALL ALAHD( NOUT, PATH )
00468 WRITE( NOUT, FMT = 9997 )NORM, N, IMAT, 8,
00469 $ RESULT( 8 )
00470 NFAIL = NFAIL + 1
00471 END IF
00472 NRUN = NRUN + 1
00473 80 CONTINUE
00474 90 CONTINUE
00475 100 CONTINUE
00476 110 CONTINUE
00477 120 CONTINUE
00478
00479
00480
00481 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00482
00483 9999 FORMAT( ' M = ', I5, ', N =', I5, ', NB =', I4, ', type ', I2,
00484 $ ', test(', I2, ') =', G12.5 )
00485 9998 FORMAT( ' TRANS=''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
00486 $ I2, ', test(', I2, ') =', G12.5 )
00487 9997 FORMAT( ' NORM =''', A1, ''', N =', I5, ',', 10X, ' type ', I2,
00488 $ ', test(', I2, ') =', G12.5 )
00489 RETURN
00490
00491
00492
00493 END