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