00001 SUBROUTINE ZDRVGE( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
00002 $ A, AFAC, ASAV, B, BSAV, X, XACT, S, WORK,
00003 $ RWORK, IWORK, NOUT )
00004
00005
00006
00007
00008
00009
00010 LOGICAL TSTERR
00011 INTEGER NMAX, NN, NOUT, NRHS
00012 DOUBLE PRECISION THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER IWORK( * ), NVAL( * )
00017 DOUBLE PRECISION RWORK( * ), S( * )
00018 COMPLEX*16 A( * ), AFAC( * ), ASAV( * ), B( * ),
00019 $ BSAV( * ), WORK( * ), X( * ), XACT( * )
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
00084
00085
00086 DOUBLE PRECISION ONE, ZERO
00087 PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
00088 INTEGER NTYPES
00089 PARAMETER ( NTYPES = 11 )
00090 INTEGER NTESTS
00091 PARAMETER ( NTESTS = 7 )
00092 INTEGER NTRAN
00093 PARAMETER ( NTRAN = 3 )
00094
00095
00096 LOGICAL EQUIL, NOFACT, PREFAC, TRFCON, ZEROT
00097 CHARACTER DIST, EQUED, FACT, TRANS, TYPE, XTYPE
00098 CHARACTER*3 PATH
00099 INTEGER I, IEQUED, IFACT, IMAT, IN, INFO, IOFF, ITRAN,
00100 $ IZERO, K, K1, KL, KU, LDA, LWORK, MODE, N, NB,
00101 $ NBMIN, NERRS, NFACT, NFAIL, NIMAT, NRUN, NT
00102 DOUBLE PRECISION AINVNM, AMAX, ANORM, ANORMI, ANORMO, CNDNUM,
00103 $ COLCND, RCOND, RCONDC, RCONDI, RCONDO, ROLDC,
00104 $ ROLDI, ROLDO, ROWCND, RPVGRW
00105
00106
00107 CHARACTER EQUEDS( 4 ), FACTS( 3 ), TRANSS( NTRAN )
00108 INTEGER ISEED( 4 ), ISEEDY( 4 )
00109 DOUBLE PRECISION RDUM( 1 ), RESULT( NTESTS )
00110
00111
00112 LOGICAL LSAME
00113 DOUBLE PRECISION DGET06, DLAMCH, ZLANGE, ZLANTR
00114 EXTERNAL LSAME, DGET06, DLAMCH, ZLANGE, ZLANTR
00115
00116
00117 EXTERNAL ALADHD, ALAERH, ALASVM, XLAENV, ZERRVX, ZGEEQU,
00118 $ ZGESV, ZGESVX, ZGET01, ZGET02, ZGET04, ZGET07,
00119 $ ZGETRF, ZGETRI, ZLACPY, ZLAQGE, ZLARHS, ZLASET,
00120 $ ZLATB4, ZLATMS
00121
00122
00123 INTRINSIC ABS, DCMPLX, MAX
00124
00125
00126 LOGICAL LERR, OK
00127 CHARACTER*32 SRNAMT
00128 INTEGER INFOT, NUNIT
00129
00130
00131 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00132 COMMON / SRNAMC / SRNAMT
00133
00134
00135 DATA ISEEDY / 1988, 1989, 1990, 1991 /
00136 DATA TRANSS / 'N', 'T', 'C' /
00137 DATA FACTS / 'F', 'N', 'E' /
00138 DATA EQUEDS / 'N', 'R', 'C', 'B' /
00139
00140
00141
00142
00143
00144 PATH( 1: 1 ) = 'Zomplex precision'
00145 PATH( 2: 3 ) = 'GE'
00146 NRUN = 0
00147 NFAIL = 0
00148 NERRS = 0
00149 DO 10 I = 1, 4
00150 ISEED( I ) = ISEEDY( I )
00151 10 CONTINUE
00152
00153
00154
00155 IF( TSTERR )
00156 $ CALL ZERRVX( PATH, NOUT )
00157 INFOT = 0
00158
00159
00160
00161 NB = 1
00162 NBMIN = 2
00163 CALL XLAENV( 1, NB )
00164 CALL XLAENV( 2, NBMIN )
00165
00166
00167
00168 DO 90 IN = 1, NN
00169 N = NVAL( IN )
00170 LDA = MAX( N, 1 )
00171 XTYPE = 'N'
00172 NIMAT = NTYPES
00173 IF( N.LE.0 )
00174 $ NIMAT = 1
00175
00176 DO 80 IMAT = 1, NIMAT
00177
00178
00179
00180 IF( .NOT.DOTYPE( IMAT ) )
00181 $ GO TO 80
00182
00183
00184
00185 ZEROT = IMAT.GE.5 .AND. IMAT.LE.7
00186 IF( ZEROT .AND. N.LT.IMAT-4 )
00187 $ GO TO 80
00188
00189
00190
00191
00192 CALL ZLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
00193 $ CNDNUM, DIST )
00194 RCONDC = ONE / CNDNUM
00195
00196 SRNAMT = 'ZLATMS'
00197 CALL ZLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE, CNDNUM,
00198 $ ANORM, KL, KU, 'No packing', A, LDA, WORK,
00199 $ INFO )
00200
00201
00202
00203 IF( INFO.NE.0 ) THEN
00204 CALL ALAERH( PATH, 'ZLATMS', INFO, 0, ' ', N, N, -1, -1,
00205 $ -1, IMAT, NFAIL, NERRS, NOUT )
00206 GO TO 80
00207 END IF
00208
00209
00210
00211
00212 IF( ZEROT ) THEN
00213 IF( IMAT.EQ.5 ) THEN
00214 IZERO = 1
00215 ELSE IF( IMAT.EQ.6 ) THEN
00216 IZERO = N
00217 ELSE
00218 IZERO = N / 2 + 1
00219 END IF
00220 IOFF = ( IZERO-1 )*LDA
00221 IF( IMAT.LT.7 ) THEN
00222 DO 20 I = 1, N
00223 A( IOFF+I ) = ZERO
00224 20 CONTINUE
00225 ELSE
00226 CALL ZLASET( 'Full', N, N-IZERO+1, DCMPLX( ZERO ),
00227 $ DCMPLX( ZERO ), A( IOFF+1 ), LDA )
00228 END IF
00229 ELSE
00230 IZERO = 0
00231 END IF
00232
00233
00234
00235 CALL ZLACPY( 'Full', N, N, A, LDA, ASAV, LDA )
00236
00237 DO 70 IEQUED = 1, 4
00238 EQUED = EQUEDS( IEQUED )
00239 IF( IEQUED.EQ.1 ) THEN
00240 NFACT = 3
00241 ELSE
00242 NFACT = 1
00243 END IF
00244
00245 DO 60 IFACT = 1, NFACT
00246 FACT = FACTS( IFACT )
00247 PREFAC = LSAME( FACT, 'F' )
00248 NOFACT = LSAME( FACT, 'N' )
00249 EQUIL = LSAME( FACT, 'E' )
00250
00251 IF( ZEROT ) THEN
00252 IF( PREFAC )
00253 $ GO TO 60
00254 RCONDO = ZERO
00255 RCONDI = ZERO
00256
00257 ELSE IF( .NOT.NOFACT ) THEN
00258
00259
00260
00261
00262
00263
00264 CALL ZLACPY( 'Full', N, N, ASAV, LDA, AFAC, LDA )
00265 IF( EQUIL .OR. IEQUED.GT.1 ) THEN
00266
00267
00268
00269
00270 CALL ZGEEQU( N, N, AFAC, LDA, S, S( N+1 ),
00271 $ ROWCND, COLCND, AMAX, INFO )
00272 IF( INFO.EQ.0 .AND. N.GT.0 ) THEN
00273 IF( LSAME( EQUED, 'R' ) ) THEN
00274 ROWCND = ZERO
00275 COLCND = ONE
00276 ELSE IF( LSAME( EQUED, 'C' ) ) THEN
00277 ROWCND = ONE
00278 COLCND = ZERO
00279 ELSE IF( LSAME( EQUED, 'B' ) ) THEN
00280 ROWCND = ZERO
00281 COLCND = ZERO
00282 END IF
00283
00284
00285
00286 CALL ZLAQGE( N, N, AFAC, LDA, S, S( N+1 ),
00287 $ ROWCND, COLCND, AMAX, EQUED )
00288 END IF
00289 END IF
00290
00291
00292
00293
00294 IF( EQUIL ) THEN
00295 ROLDO = RCONDO
00296 ROLDI = RCONDI
00297 END IF
00298
00299
00300
00301 ANORMO = ZLANGE( '1', N, N, AFAC, LDA, RWORK )
00302 ANORMI = ZLANGE( 'I', N, N, AFAC, LDA, RWORK )
00303
00304
00305
00306 CALL ZGETRF( N, N, AFAC, LDA, IWORK, INFO )
00307
00308
00309
00310 CALL ZLACPY( 'Full', N, N, AFAC, LDA, A, LDA )
00311 LWORK = NMAX*MAX( 3, NRHS )
00312 CALL ZGETRI( N, A, LDA, IWORK, WORK, LWORK, INFO )
00313
00314
00315
00316 AINVNM = ZLANGE( '1', N, N, A, LDA, RWORK )
00317 IF( ANORMO.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
00318 RCONDO = ONE
00319 ELSE
00320 RCONDO = ( ONE / ANORMO ) / AINVNM
00321 END IF
00322
00323
00324
00325 AINVNM = ZLANGE( 'I', N, N, A, LDA, RWORK )
00326 IF( ANORMI.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
00327 RCONDI = ONE
00328 ELSE
00329 RCONDI = ( ONE / ANORMI ) / AINVNM
00330 END IF
00331 END IF
00332
00333 DO 50 ITRAN = 1, NTRAN
00334
00335
00336
00337 TRANS = TRANSS( ITRAN )
00338 IF( ITRAN.EQ.1 ) THEN
00339 RCONDC = RCONDO
00340 ELSE
00341 RCONDC = RCONDI
00342 END IF
00343
00344
00345
00346 CALL ZLACPY( 'Full', N, N, ASAV, LDA, A, LDA )
00347
00348
00349
00350 SRNAMT = 'ZLARHS'
00351 CALL ZLARHS( PATH, XTYPE, 'Full', TRANS, N, N, KL,
00352 $ KU, NRHS, A, LDA, XACT, LDA, B, LDA,
00353 $ ISEED, INFO )
00354 XTYPE = 'C'
00355 CALL ZLACPY( 'Full', N, NRHS, B, LDA, BSAV, LDA )
00356
00357 IF( NOFACT .AND. ITRAN.EQ.1 ) THEN
00358
00359
00360
00361
00362
00363
00364 CALL ZLACPY( 'Full', N, N, A, LDA, AFAC, LDA )
00365 CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00366
00367 SRNAMT = 'ZGESV '
00368 CALL ZGESV( N, NRHS, AFAC, LDA, IWORK, X, LDA,
00369 $ INFO )
00370
00371
00372
00373 IF( INFO.NE.IZERO )
00374 $ CALL ALAERH( PATH, 'ZGESV ', INFO, IZERO,
00375 $ ' ', N, N, -1, -1, NRHS, IMAT,
00376 $ NFAIL, NERRS, NOUT )
00377
00378
00379
00380
00381 CALL ZGET01( N, N, A, LDA, AFAC, LDA, IWORK,
00382 $ RWORK, RESULT( 1 ) )
00383 NT = 1
00384 IF( IZERO.EQ.0 ) THEN
00385
00386
00387
00388 CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK,
00389 $ LDA )
00390 CALL ZGET02( 'No transpose', N, N, NRHS, A,
00391 $ LDA, X, LDA, WORK, LDA, RWORK,
00392 $ RESULT( 2 ) )
00393
00394
00395
00396 CALL ZGET04( N, NRHS, X, LDA, XACT, LDA,
00397 $ RCONDC, RESULT( 3 ) )
00398 NT = 3
00399 END IF
00400
00401
00402
00403
00404 DO 30 K = 1, NT
00405 IF( RESULT( K ).GE.THRESH ) THEN
00406 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00407 $ CALL ALADHD( NOUT, PATH )
00408 WRITE( NOUT, FMT = 9999 )'ZGESV ', N,
00409 $ IMAT, K, RESULT( K )
00410 NFAIL = NFAIL + 1
00411 END IF
00412 30 CONTINUE
00413 NRUN = NRUN + NT
00414 END IF
00415
00416
00417
00418 IF( .NOT.PREFAC )
00419 $ CALL ZLASET( 'Full', N, N, DCMPLX( ZERO ),
00420 $ DCMPLX( ZERO ), AFAC, LDA )
00421 CALL ZLASET( 'Full', N, NRHS, DCMPLX( ZERO ),
00422 $ DCMPLX( ZERO ), X, LDA )
00423 IF( IEQUED.GT.1 .AND. N.GT.0 ) THEN
00424
00425
00426
00427
00428 CALL ZLAQGE( N, N, A, LDA, S, S( N+1 ), ROWCND,
00429 $ COLCND, AMAX, EQUED )
00430 END IF
00431
00432
00433
00434
00435 SRNAMT = 'ZGESVX'
00436 CALL ZGESVX( FACT, TRANS, N, NRHS, A, LDA, AFAC,
00437 $ LDA, IWORK, EQUED, S, S( N+1 ), B,
00438 $ LDA, X, LDA, RCOND, RWORK,
00439 $ RWORK( NRHS+1 ), WORK,
00440 $ RWORK( 2*NRHS+1 ), INFO )
00441
00442
00443
00444 IF( INFO.NE.IZERO )
00445 $ CALL ALAERH( PATH, 'ZGESVX', INFO, IZERO,
00446 $ FACT // TRANS, N, N, -1, -1, NRHS,
00447 $ IMAT, NFAIL, NERRS, NOUT )
00448
00449
00450
00451
00452 IF( INFO.NE.0 ) THEN
00453 RPVGRW = ZLANTR( 'M', 'U', 'N', INFO, INFO,
00454 $ AFAC, LDA, RDUM )
00455 IF( RPVGRW.EQ.ZERO ) THEN
00456 RPVGRW = ONE
00457 ELSE
00458 RPVGRW = ZLANGE( 'M', N, INFO, A, LDA,
00459 $ RDUM ) / RPVGRW
00460 END IF
00461 ELSE
00462 RPVGRW = ZLANTR( 'M', 'U', 'N', N, N, AFAC, LDA,
00463 $ RDUM )
00464 IF( RPVGRW.EQ.ZERO ) THEN
00465 RPVGRW = ONE
00466 ELSE
00467 RPVGRW = ZLANGE( 'M', N, N, A, LDA, RDUM ) /
00468 $ RPVGRW
00469 END IF
00470 END IF
00471 RESULT( 7 ) = ABS( RPVGRW-RWORK( 2*NRHS+1 ) ) /
00472 $ MAX( RWORK( 2*NRHS+1 ), RPVGRW ) /
00473 $ DLAMCH( 'E' )
00474
00475 IF( .NOT.PREFAC ) THEN
00476
00477
00478
00479
00480 CALL ZGET01( N, N, A, LDA, AFAC, LDA, IWORK,
00481 $ RWORK( 2*NRHS+1 ), RESULT( 1 ) )
00482 K1 = 1
00483 ELSE
00484 K1 = 2
00485 END IF
00486
00487 IF( INFO.EQ.0 ) THEN
00488 TRFCON = .FALSE.
00489
00490
00491
00492 CALL ZLACPY( 'Full', N, NRHS, BSAV, LDA, WORK,
00493 $ LDA )
00494 CALL ZGET02( TRANS, N, N, NRHS, ASAV, LDA, X,
00495 $ LDA, WORK, LDA, RWORK( 2*NRHS+1 ),
00496 $ RESULT( 2 ) )
00497
00498
00499
00500 IF( NOFACT .OR. ( PREFAC .AND. LSAME( EQUED,
00501 $ 'N' ) ) ) THEN
00502 CALL ZGET04( N, NRHS, X, LDA, XACT, LDA,
00503 $ RCONDC, RESULT( 3 ) )
00504 ELSE
00505 IF( ITRAN.EQ.1 ) THEN
00506 ROLDC = ROLDO
00507 ELSE
00508 ROLDC = ROLDI
00509 END IF
00510 CALL ZGET04( N, NRHS, X, LDA, XACT, LDA,
00511 $ ROLDC, RESULT( 3 ) )
00512 END IF
00513
00514
00515
00516
00517 CALL ZGET07( TRANS, N, NRHS, ASAV, LDA, B, LDA,
00518 $ X, LDA, XACT, LDA, RWORK, .TRUE.,
00519 $ RWORK( NRHS+1 ), RESULT( 4 ) )
00520 ELSE
00521 TRFCON = .TRUE.
00522 END IF
00523
00524
00525
00526
00527 RESULT( 6 ) = DGET06( RCOND, RCONDC )
00528
00529
00530
00531
00532 IF( .NOT.TRFCON ) THEN
00533 DO 40 K = K1, NTESTS
00534 IF( RESULT( K ).GE.THRESH ) THEN
00535 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00536 $ CALL ALADHD( NOUT, PATH )
00537 IF( PREFAC ) THEN
00538 WRITE( NOUT, FMT = 9997 )'ZGESVX',
00539 $ FACT, TRANS, N, EQUED, IMAT, K,
00540 $ RESULT( K )
00541 ELSE
00542 WRITE( NOUT, FMT = 9998 )'ZGESVX',
00543 $ FACT, TRANS, N, IMAT, K, RESULT( K )
00544 END IF
00545 NFAIL = NFAIL + 1
00546 END IF
00547 40 CONTINUE
00548 NRUN = NRUN + 7 - K1
00549 ELSE
00550 IF( RESULT( 1 ).GE.THRESH .AND. .NOT.PREFAC )
00551 $ THEN
00552 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00553 $ CALL ALADHD( NOUT, PATH )
00554 IF( PREFAC ) THEN
00555 WRITE( NOUT, FMT = 9997 )'ZGESVX', FACT,
00556 $ TRANS, N, EQUED, IMAT, 1, RESULT( 1 )
00557 ELSE
00558 WRITE( NOUT, FMT = 9998 )'ZGESVX', FACT,
00559 $ TRANS, N, IMAT, 1, RESULT( 1 )
00560 END IF
00561 NFAIL = NFAIL + 1
00562 NRUN = NRUN + 1
00563 END IF
00564 IF( RESULT( 6 ).GE.THRESH ) THEN
00565 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00566 $ CALL ALADHD( NOUT, PATH )
00567 IF( PREFAC ) THEN
00568 WRITE( NOUT, FMT = 9997 )'ZGESVX', FACT,
00569 $ TRANS, N, EQUED, IMAT, 6, RESULT( 6 )
00570 ELSE
00571 WRITE( NOUT, FMT = 9998 )'ZGESVX', FACT,
00572 $ TRANS, N, IMAT, 6, RESULT( 6 )
00573 END IF
00574 NFAIL = NFAIL + 1
00575 NRUN = NRUN + 1
00576 END IF
00577 IF( RESULT( 7 ).GE.THRESH ) THEN
00578 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00579 $ CALL ALADHD( NOUT, PATH )
00580 IF( PREFAC ) THEN
00581 WRITE( NOUT, FMT = 9997 )'ZGESVX', FACT,
00582 $ TRANS, N, EQUED, IMAT, 7, RESULT( 7 )
00583 ELSE
00584 WRITE( NOUT, FMT = 9998 )'ZGESVX', FACT,
00585 $ TRANS, N, IMAT, 7, RESULT( 7 )
00586 END IF
00587 NFAIL = NFAIL + 1
00588 NRUN = NRUN + 1
00589 END IF
00590
00591 END IF
00592
00593 50 CONTINUE
00594 60 CONTINUE
00595 70 CONTINUE
00596 80 CONTINUE
00597 90 CONTINUE
00598
00599
00600
00601 CALL ALASVM( PATH, NOUT, NFAIL, NRUN, NERRS )
00602
00603 9999 FORMAT( 1X, A, ', N =', I5, ', type ', I2, ', test(', I2, ') =',
00604 $ G12.5 )
00605 9998 FORMAT( 1X, A, ', FACT=''', A1, ''', TRANS=''', A1, ''', N=', I5,
00606 $ ', type ', I2, ', test(', I1, ')=', G12.5 )
00607 9997 FORMAT( 1X, A, ', FACT=''', A1, ''', TRANS=''', A1, ''', N=', I5,
00608 $ ', EQUED=''', A1, ''', type ', I2, ', test(', I1, ')=',
00609 $ G12.5 )
00610 RETURN
00611
00612
00613
00614 END