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