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