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