00001 SUBROUTINE ZCHKHE( 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 RWORK( * )
00018 COMPLEX*16 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 DOUBLE PRECISION ZERO
00093 PARAMETER ( ZERO = 0.0D+0 )
00094 INTEGER NTYPES
00095 PARAMETER ( NTYPES = 10 )
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 DOUBLE PRECISION ANORM, CNDNUM, RCOND, RCONDC
00107
00108
00109 CHARACTER UPLOS( 2 )
00110 INTEGER ISEED( 4 ), ISEEDY( 4 )
00111 DOUBLE PRECISION RESULT( NTESTS )
00112
00113
00114 DOUBLE PRECISION DGET06, ZLANHE
00115 EXTERNAL DGET06, ZLANHE
00116
00117
00118 EXTERNAL ALAERH, ALAHD, ALASUM, XLAENV, ZERRHE, ZGET04,
00119 $ ZHECON, ZHERFS, ZHET01, ZHETRF, ZHETRI, ZHETRS,
00120 $ ZLACPY, ZLAIPD, ZLARHS, ZLATB4, ZLATMS, ZPOT02,
00121 $ ZPOT03, ZPOT05
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 ) = 'Zomplex precision'
00144 PATH( 2: 3 ) = 'HE'
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 ZERRHE( 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
00188
00189
00190 CALL ZLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
00191 $ CNDNUM, DIST )
00192
00193 SRNAMT = 'ZLATMS'
00194 CALL ZLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE,
00195 $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
00196 $ INFO )
00197
00198
00199
00200 IF( INFO.NE.0 ) THEN
00201 CALL ALAERH( PATH, 'ZLATMS', INFO, 0, UPLO, N, N, -1,
00202 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00203 GO TO 160
00204 END IF
00205
00206
00207
00208
00209 IF( ZEROT ) THEN
00210 IF( IMAT.EQ.3 ) THEN
00211 IZERO = 1
00212 ELSE IF( IMAT.EQ.4 ) THEN
00213 IZERO = N
00214 ELSE
00215 IZERO = N / 2 + 1
00216 END IF
00217
00218 IF( IMAT.LT.6 ) THEN
00219
00220
00221
00222 IF( IUPLO.EQ.1 ) THEN
00223 IOFF = ( IZERO-1 )*LDA
00224 DO 20 I = 1, IZERO - 1
00225 A( IOFF+I ) = ZERO
00226 20 CONTINUE
00227 IOFF = IOFF + IZERO
00228 DO 30 I = IZERO, N
00229 A( IOFF ) = ZERO
00230 IOFF = IOFF + LDA
00231 30 CONTINUE
00232 ELSE
00233 IOFF = IZERO
00234 DO 40 I = 1, IZERO - 1
00235 A( IOFF ) = ZERO
00236 IOFF = IOFF + LDA
00237 40 CONTINUE
00238 IOFF = IOFF - IZERO
00239 DO 50 I = IZERO, N
00240 A( IOFF+I ) = ZERO
00241 50 CONTINUE
00242 END IF
00243 ELSE
00244 IOFF = 0
00245 IF( IUPLO.EQ.1 ) THEN
00246
00247
00248
00249 DO 70 J = 1, N
00250 I2 = MIN( J, IZERO )
00251 DO 60 I = 1, I2
00252 A( IOFF+I ) = ZERO
00253 60 CONTINUE
00254 IOFF = IOFF + LDA
00255 70 CONTINUE
00256 ELSE
00257
00258
00259
00260 DO 90 J = 1, N
00261 I1 = MAX( J, IZERO )
00262 DO 80 I = I1, N
00263 A( IOFF+I ) = ZERO
00264 80 CONTINUE
00265 IOFF = IOFF + LDA
00266 90 CONTINUE
00267 END IF
00268 END IF
00269 ELSE
00270 IZERO = 0
00271 END IF
00272
00273
00274
00275 CALL ZLAIPD( N, A, LDA+1, 0 )
00276
00277
00278
00279 DO 150 INB = 1, NNB
00280 NB = NBVAL( INB )
00281 CALL XLAENV( 1, NB )
00282
00283
00284
00285
00286 CALL ZLACPY( UPLO, N, N, A, LDA, AFAC, LDA )
00287 LWORK = MAX( 2, NB )*LDA
00288 SRNAMT = 'ZHETRF'
00289 CALL ZHETRF( UPLO, N, AFAC, LDA, IWORK, AINV, LWORK,
00290 $ INFO )
00291
00292
00293
00294
00295 K = IZERO
00296 IF( K.GT.0 ) THEN
00297 100 CONTINUE
00298 IF( IWORK( K ).LT.0 ) THEN
00299 IF( IWORK( K ).NE.-K ) THEN
00300 K = -IWORK( K )
00301 GO TO 100
00302 END IF
00303 ELSE IF( IWORK( K ).NE.K ) THEN
00304 K = IWORK( K )
00305 GO TO 100
00306 END IF
00307 END IF
00308
00309
00310
00311 IF( INFO.NE.K )
00312 $ CALL ALAERH( PATH, 'ZHETRF', INFO, K, UPLO, N, N,
00313 $ -1, -1, NB, IMAT, NFAIL, NERRS, NOUT )
00314 IF( INFO.NE.0 ) THEN
00315 TRFCON = .TRUE.
00316 ELSE
00317 TRFCON = .FALSE.
00318 END IF
00319
00320
00321
00322
00323 CALL ZHET01( UPLO, N, A, LDA, AFAC, LDA, IWORK, AINV,
00324 $ LDA, RWORK, RESULT( 1 ) )
00325 NT = 1
00326
00327
00328
00329
00330 IF( INB.EQ.1 .AND. .NOT.TRFCON ) THEN
00331 CALL ZLACPY( UPLO, N, N, AFAC, LDA, AINV, LDA )
00332 SRNAMT = 'ZHETRI'
00333 CALL ZHETRI( UPLO, N, AINV, LDA, IWORK, WORK,
00334 $ INFO )
00335
00336
00337
00338 IF( INFO.NE.0 )
00339 $ CALL ALAERH( PATH, 'ZHETRI', INFO, -1, UPLO, N,
00340 $ N, -1, -1, -1, IMAT, NFAIL, NERRS,
00341 $ NOUT )
00342
00343 CALL ZPOT03( UPLO, N, A, LDA, AINV, LDA, WORK, LDA,
00344 $ RWORK, RCONDC, RESULT( 2 ) )
00345 NT = 2
00346 END IF
00347
00348
00349
00350
00351 DO 110 K = 1, NT
00352 IF( RESULT( K ).GE.THRESH ) THEN
00353 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00354 $ CALL ALAHD( NOUT, PATH )
00355 WRITE( NOUT, FMT = 9999 )UPLO, N, NB, IMAT, K,
00356 $ RESULT( K )
00357 NFAIL = NFAIL + 1
00358 END IF
00359 110 CONTINUE
00360 NRUN = NRUN + NT
00361
00362
00363
00364
00365 IF( INB.GT.1 )
00366 $ GO TO 150
00367
00368
00369
00370 IF( TRFCON ) THEN
00371 RCONDC = ZERO
00372 GO TO 140
00373 END IF
00374
00375 DO 130 IRHS = 1, NNS
00376 NRHS = NSVAL( IRHS )
00377
00378
00379
00380
00381 SRNAMT = 'ZLARHS'
00382 CALL ZLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
00383 $ NRHS, A, LDA, XACT, LDA, B, LDA,
00384 $ ISEED, INFO )
00385 CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00386
00387 SRNAMT = 'ZHETRS'
00388 CALL ZHETRS( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
00389 $ LDA, INFO )
00390
00391
00392
00393 IF( INFO.NE.0 )
00394 $ CALL ALAERH( PATH, 'ZHETRS', INFO, 0, UPLO, N,
00395 $ N, -1, -1, NRHS, IMAT, NFAIL,
00396 $ NERRS, NOUT )
00397
00398 CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00399 CALL ZPOT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
00400 $ LDA, RWORK, RESULT( 3 ) )
00401
00402
00403
00404
00405 SRNAMT = 'ZLARHS'
00406 CALL ZLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
00407 $ NRHS, A, LDA, XACT, LDA, B, LDA,
00408 $ ISEED, INFO )
00409 CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00410
00411 SRNAMT = 'ZHETRS2'
00412 CALL ZHETRS2( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
00413 $ LDA, WORK, INFO )
00414
00415
00416
00417 IF( INFO.NE.0 )
00418 $ CALL ALAERH( PATH, 'ZHETRS2', INFO, 0, UPLO, N,
00419 $ N, -1, -1, NRHS, IMAT, NFAIL,
00420 $ NERRS, NOUT )
00421
00422 CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00423 CALL ZPOT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
00424 $ LDA, RWORK, RESULT( 4 ) )
00425
00426
00427
00428
00429 CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00430 $ RESULT( 5 ) )
00431
00432
00433
00434
00435 SRNAMT = 'ZHERFS'
00436 CALL ZHERFS( UPLO, N, NRHS, A, LDA, AFAC, LDA,
00437 $ IWORK, B, LDA, X, LDA, RWORK,
00438 $ RWORK( NRHS+1 ), WORK,
00439 $ RWORK( 2*NRHS+1 ), INFO )
00440
00441
00442
00443 IF( INFO.NE.0 )
00444 $ CALL ALAERH( PATH, 'ZHERFS', INFO, 0, UPLO, N,
00445 $ N, -1, -1, NRHS, IMAT, NFAIL,
00446 $ NERRS, NOUT )
00447
00448 CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00449 $ RESULT( 6 ) )
00450 CALL ZPOT05( UPLO, N, NRHS, A, LDA, B, LDA, X, LDA,
00451 $ XACT, LDA, RWORK, RWORK( NRHS+1 ),
00452 $ RESULT( 7 ) )
00453
00454
00455
00456
00457 DO 120 K = 3, 8
00458 IF( RESULT( K ).GE.THRESH ) THEN
00459 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00460 $ CALL ALAHD( NOUT, PATH )
00461 WRITE( NOUT, FMT = 9998 )UPLO, N, NRHS,
00462 $ IMAT, K, RESULT( K )
00463 NFAIL = NFAIL + 1
00464 END IF
00465 120 CONTINUE
00466 NRUN = NRUN + 5
00467 130 CONTINUE
00468
00469
00470
00471
00472 140 CONTINUE
00473 ANORM = ZLANHE( '1', UPLO, N, A, LDA, RWORK )
00474 SRNAMT = 'ZHECON'
00475 CALL ZHECON( UPLO, N, AFAC, LDA, IWORK, ANORM, RCOND,
00476 $ WORK, INFO )
00477
00478
00479
00480 IF( INFO.NE.0 )
00481 $ CALL ALAERH( PATH, 'ZHECON', INFO, 0, UPLO, N, N,
00482 $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
00483
00484 RESULT( 9 ) = DGET06( RCOND, RCONDC )
00485
00486
00487
00488
00489 IF( RESULT( 9 ).GE.THRESH ) THEN
00490 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00491 $ CALL ALAHD( NOUT, PATH )
00492 WRITE( NOUT, FMT = 9997 )UPLO, N, IMAT, 9,
00493 $ RESULT( 9 )
00494 NFAIL = NFAIL + 1
00495 END IF
00496 NRUN = NRUN + 1
00497 150 CONTINUE
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