00001 SUBROUTINE CCHKSY( 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 REAL THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
00017 REAL RWORK( * )
00018 COMPLEX A( * ), AFAC( * ), AINV( * ), B( * ),
00019 $ 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
00087
00088
00089
00090
00091
00092 REAL ZERO
00093 PARAMETER ( ZERO = 0.0E+0 )
00094 INTEGER NTYPES
00095 PARAMETER ( NTYPES = 11 )
00096 INTEGER NTESTS
00097 PARAMETER ( NTESTS = 9 )
00098
00099
00100 LOGICAL TRFCON, ZEROT
00101 CHARACTER DIST, TYPE, UPLO, XTYPE
00102 CHARACTER*3 PATH
00103 INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
00104 $ IUPLO, IZERO, J, K, KL, KU, LDA, LWORK, MODE,
00105 $ N, NB, NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
00106 REAL ANORM, CNDNUM, RCOND, RCONDC
00107
00108
00109 CHARACTER UPLOS( 2 )
00110 INTEGER ISEED( 4 ), ISEEDY( 4 )
00111 REAL RESULT( NTESTS )
00112
00113
00114 REAL CLANSY, SGET06
00115 EXTERNAL CLANSY, SGET06
00116
00117
00118 EXTERNAL ALAERH, ALAHD, ALASUM, CERRSY, CGET04, CLACPY,
00119 $ CLARHS, CLATB4, CLATMS, CLATSY, CPOT05, CSYCON,
00120 $ CSYRFS, CSYT01, CSYT02, CSYT03, CSYTRF,
00121 $ CSYTRI2, CSYTRS, 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 ) = 'Complex 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 CERRSY( PATH, NOUT )
00156 INFOT = 0
00157
00158
00159
00160 DO 180 IN = 1, NN
00161 N = NVAL( IN )
00162 LDA = MAX( N, 1 )
00163 XTYPE = 'N'
00164 NIMAT = NTYPES
00165 IF( N.LE.0 )
00166 $ NIMAT = 1
00167
00168 IZERO = 0
00169 DO 170 IMAT = 1, NIMAT
00170
00171
00172
00173 IF( .NOT.DOTYPE( IMAT ) )
00174 $ GO TO 170
00175
00176
00177
00178 ZEROT = IMAT.GE.3 .AND. IMAT.LE.6
00179 IF( ZEROT .AND. N.LT.IMAT-2 )
00180 $ GO TO 170
00181
00182
00183
00184 DO 160 IUPLO = 1, 2
00185 UPLO = UPLOS( IUPLO )
00186
00187 IF( IMAT.NE.NTYPES ) THEN
00188
00189
00190
00191
00192 CALL CLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM,
00193 $ MODE, CNDNUM, DIST )
00194
00195 SRNAMT = 'CLATMS'
00196 CALL CLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE,
00197 $ CNDNUM, ANORM, KL, KU, 'N', A, LDA, WORK,
00198 $ INFO )
00199
00200
00201
00202 IF( INFO.NE.0 ) THEN
00203 CALL ALAERH( PATH, 'CLATMS', INFO, 0, UPLO, N, N,
00204 $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
00205 GO TO 160
00206 END IF
00207
00208
00209
00210
00211 IF( ZEROT ) THEN
00212 IF( IMAT.EQ.3 ) THEN
00213 IZERO = 1
00214 ELSE IF( IMAT.EQ.4 ) THEN
00215 IZERO = N
00216 ELSE
00217 IZERO = N / 2 + 1
00218 END IF
00219
00220 IF( IMAT.LT.6 ) THEN
00221
00222
00223
00224 IF( IUPLO.EQ.1 ) THEN
00225 IOFF = ( IZERO-1 )*LDA
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 IF( IUPLO.EQ.1 ) THEN
00247
00248
00249
00250 IOFF = 0
00251 DO 70 J = 1, N
00252 I2 = MIN( J, IZERO )
00253 DO 60 I = 1, I2
00254 A( IOFF+I ) = ZERO
00255 60 CONTINUE
00256 IOFF = IOFF + LDA
00257 70 CONTINUE
00258 ELSE
00259
00260
00261
00262 IOFF = 0
00263 DO 90 J = 1, N
00264 I1 = MAX( J, IZERO )
00265 DO 80 I = I1, N
00266 A( IOFF+I ) = ZERO
00267 80 CONTINUE
00268 IOFF = IOFF + LDA
00269 90 CONTINUE
00270 END IF
00271 END IF
00272 ELSE
00273 IZERO = 0
00274 END IF
00275 ELSE
00276
00277
00278
00279
00280 CALL CLATSY( UPLO, N, A, LDA, ISEED )
00281 END IF
00282
00283
00284
00285 DO 150 INB = 1, NNB
00286 NB = NBVAL( INB )
00287 CALL XLAENV( 1, NB )
00288
00289
00290
00291
00292 CALL CLACPY( UPLO, N, N, A, LDA, AFAC, LDA )
00293 LWORK = MAX( 2, NB )*LDA
00294 SRNAMT = 'CSYTRF'
00295 CALL CSYTRF( UPLO, N, AFAC, LDA, IWORK, AINV, LWORK,
00296 $ INFO )
00297
00298
00299
00300
00301 K = IZERO
00302 IF( K.GT.0 ) THEN
00303 100 CONTINUE
00304 IF( IWORK( K ).LT.0 ) THEN
00305 IF( IWORK( K ).NE.-K ) THEN
00306 K = -IWORK( K )
00307 GO TO 100
00308 END IF
00309 ELSE IF( IWORK( K ).NE.K ) THEN
00310 K = IWORK( K )
00311 GO TO 100
00312 END IF
00313 END IF
00314
00315
00316
00317 IF( INFO.NE.K )
00318 $ CALL ALAERH( PATH, 'CSYTRF', INFO, K, UPLO, N, N,
00319 $ -1, -1, NB, IMAT, NFAIL, NERRS, NOUT )
00320 IF( INFO.NE.0 ) THEN
00321 TRFCON = .TRUE.
00322 ELSE
00323 TRFCON = .FALSE.
00324 END IF
00325
00326
00327
00328
00329 CALL CSYT01( UPLO, N, A, LDA, AFAC, LDA, IWORK, AINV,
00330 $ LDA, RWORK, RESULT( 1 ) )
00331 NT = 1
00332
00333
00334
00335
00336 IF( INB.EQ.1 .AND. .NOT.TRFCON ) THEN
00337 CALL CLACPY( UPLO, N, N, AFAC, LDA, AINV, LDA )
00338 SRNAMT = 'CSYTRI2'
00339 LWORK = (N+NB+1)*(NB+3)
00340 CALL CSYTRI2( UPLO, N, AINV, LDA, IWORK, WORK,
00341 $ LWORK, INFO )
00342
00343
00344
00345 IF( INFO.NE.0 )
00346 $ CALL ALAERH( PATH, 'CSYTRI', INFO, 0, UPLO, N,
00347 $ N, -1, -1, -1, IMAT, NFAIL, NERRS,
00348 $ NOUT )
00349
00350 CALL CSYT03( UPLO, N, A, LDA, AINV, LDA, WORK, LDA,
00351 $ RWORK, RCONDC, RESULT( 2 ) )
00352 NT = 2
00353 END IF
00354
00355
00356
00357
00358 DO 110 K = 1, NT
00359 IF( RESULT( K ).GE.THRESH ) THEN
00360 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00361 $ CALL ALAHD( NOUT, PATH )
00362 WRITE( NOUT, FMT = 9999 )UPLO, N, NB, IMAT, K,
00363 $ RESULT( K )
00364 NFAIL = NFAIL + 1
00365 END IF
00366 110 CONTINUE
00367 NRUN = NRUN + NT
00368
00369
00370
00371
00372 IF( INB.GT.1 )
00373 $ GO TO 150
00374
00375
00376
00377 IF( TRFCON ) THEN
00378 RCONDC = ZERO
00379 GO TO 140
00380 END IF
00381
00382 DO 130 IRHS = 1, NNS
00383 NRHS = NSVAL( IRHS )
00384
00385
00386
00387
00388 SRNAMT = 'CLARHS'
00389 CALL CLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
00390 $ NRHS, A, LDA, XACT, LDA, B, LDA,
00391 $ ISEED, INFO )
00392 CALL CLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00393
00394 SRNAMT = 'CSYTRS'
00395 CALL CSYTRS( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
00396 $ LDA, INFO )
00397
00398
00399
00400 IF( INFO.NE.0 )
00401 $ CALL ALAERH( PATH, 'CSYTRS', INFO, 0, UPLO, N,
00402 $ N, -1, -1, NRHS, IMAT, NFAIL,
00403 $ NERRS, NOUT )
00404
00405 CALL CLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00406 CALL CSYT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
00407 $ LDA, RWORK, RESULT( 3 ) )
00408
00409
00410
00411
00412 SRNAMT = 'CLARHS'
00413 CALL CLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
00414 $ NRHS, A, LDA, XACT, LDA, B, LDA,
00415 $ ISEED, INFO )
00416 CALL CLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00417
00418 SRNAMT = 'CSYTRS2'
00419 CALL CSYTRS2( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
00420 $ LDA, WORK, INFO )
00421
00422
00423
00424 IF( INFO.NE.0 )
00425 $ CALL ALAERH( PATH, 'CSYTRS2', INFO, 0, UPLO, N,
00426 $ N, -1, -1, NRHS, IMAT, NFAIL,
00427 $ NERRS, NOUT )
00428
00429 CALL CLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00430 CALL CSYT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
00431 $ LDA, RWORK, RESULT( 4 ) )
00432
00433
00434
00435
00436 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00437 $ RESULT( 5 ) )
00438
00439
00440
00441
00442 SRNAMT = 'CSYRFS'
00443 CALL CSYRFS( UPLO, N, NRHS, A, LDA, AFAC, LDA,
00444 $ IWORK, B, LDA, X, LDA, RWORK,
00445 $ RWORK( NRHS+1 ), WORK,
00446 $ RWORK( 2*NRHS+1 ), INFO )
00447
00448
00449
00450 IF( INFO.NE.0 )
00451 $ CALL ALAERH( PATH, 'CSYRFS', INFO, 0, UPLO, N,
00452 $ N, -1, -1, NRHS, IMAT, NFAIL,
00453 $ NERRS, NOUT )
00454
00455 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00456 $ RESULT( 6 ) )
00457 CALL CPOT05( UPLO, N, NRHS, A, LDA, B, LDA, X, LDA,
00458 $ XACT, LDA, RWORK, RWORK( NRHS+1 ),
00459 $ RESULT( 7 ) )
00460
00461
00462
00463
00464 DO 120 K = 3, 8
00465 IF( RESULT( K ).GE.THRESH ) THEN
00466 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00467 $ CALL ALAHD( NOUT, PATH )
00468 WRITE( NOUT, FMT = 9998 )UPLO, N, NRHS,
00469 $ IMAT, K, RESULT( K )
00470 NFAIL = NFAIL + 1
00471 END IF
00472 120 CONTINUE
00473 NRUN = NRUN + 5
00474 130 CONTINUE
00475
00476
00477
00478
00479 140 CONTINUE
00480 ANORM = CLANSY( '1', UPLO, N, A, LDA, RWORK )
00481 SRNAMT = 'CSYCON'
00482 CALL CSYCON( UPLO, N, AFAC, LDA, IWORK, ANORM, RCOND,
00483 $ WORK, INFO )
00484
00485
00486
00487 IF( INFO.NE.0 )
00488 $ CALL ALAERH( PATH, 'CSYCON', INFO, 0, UPLO, N, N,
00489 $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
00490
00491 RESULT( 9 ) = SGET06( RCOND, RCONDC )
00492
00493
00494
00495
00496 IF( RESULT( 9 ).GE.THRESH ) THEN
00497 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00498 $ CALL ALAHD( NOUT, PATH )
00499 WRITE( NOUT, FMT = 9997 )UPLO, N, IMAT, 9,
00500 $ RESULT( 9 )
00501 NFAIL = NFAIL + 1
00502 END IF
00503 NRUN = NRUN + 1
00504 150 CONTINUE
00505 160 CONTINUE
00506 170 CONTINUE
00507 180 CONTINUE
00508
00509
00510
00511 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00512
00513 9999 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NB =', I4, ', type ',
00514 $ I2, ', test ', I2, ', ratio =', G12.5 )
00515 9998 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
00516 $ I2, ', test(', I2, ') =', G12.5 )
00517 9997 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ',', 10X, ' type ', I2,
00518 $ ', test(', I2, ') =', G12.5 )
00519 RETURN
00520
00521
00522
00523 END