00001 SUBROUTINE CCHKPP( DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR,
00002 $ NMAX, A, AFAC, AINV, B, X, XACT, WORK, RWORK,
00003 $ NOUT )
00004
00005
00006
00007
00008
00009
00010 LOGICAL TSTERR
00011 INTEGER NMAX, NN, NNS, NOUT
00012 REAL THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER 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 REAL ZERO
00088 PARAMETER ( ZERO = 0.0E+0 )
00089 INTEGER NTYPES
00090 PARAMETER ( NTYPES = 9 )
00091 INTEGER NTESTS
00092 PARAMETER ( NTESTS = 8 )
00093
00094
00095 LOGICAL ZEROT
00096 CHARACTER DIST, PACKIT, TYPE, UPLO, XTYPE
00097 CHARACTER*3 PATH
00098 INTEGER I, IMAT, IN, INFO, IOFF, IRHS, IUPLO, IZERO, K,
00099 $ KL, KU, LDA, MODE, N, NERRS, NFAIL, NIMAT, NPP,
00100 $ NRHS, NRUN
00101 REAL ANORM, CNDNUM, RCOND, RCONDC
00102
00103
00104 CHARACTER PACKS( 2 ), UPLOS( 2 )
00105 INTEGER ISEED( 4 ), ISEEDY( 4 )
00106 REAL RESULT( NTESTS )
00107
00108
00109 REAL CLANHP, SGET06
00110 EXTERNAL CLANHP, SGET06
00111
00112
00113 EXTERNAL ALAERH, ALAHD, ALASUM, CCOPY, CERRPO, CGET04,
00114 $ CLACPY, CLAIPD, CLARHS, CLATB4, CLATMS, CPPCON,
00115 $ CPPRFS, CPPT01, CPPT02, CPPT03, CPPT05, CPPTRF,
00116 $ CPPTRI, CPPTRS
00117
00118
00119 LOGICAL LERR, OK
00120 CHARACTER*32 SRNAMT
00121 INTEGER INFOT, NUNIT
00122
00123
00124 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00125 COMMON / SRNAMC / SRNAMT
00126
00127
00128 INTRINSIC MAX
00129
00130
00131 DATA ISEEDY / 1988, 1989, 1990, 1991 /
00132 DATA UPLOS / 'U', 'L' / , PACKS / 'C', 'R' /
00133
00134
00135
00136
00137
00138 PATH( 1: 1 ) = 'Complex precision'
00139 PATH( 2: 3 ) = 'PP'
00140 NRUN = 0
00141 NFAIL = 0
00142 NERRS = 0
00143 DO 10 I = 1, 4
00144 ISEED( I ) = ISEEDY( I )
00145 10 CONTINUE
00146
00147
00148
00149 IF( TSTERR )
00150 $ CALL CERRPO( PATH, NOUT )
00151 INFOT = 0
00152
00153
00154
00155 DO 110 IN = 1, NN
00156 N = NVAL( IN )
00157 LDA = MAX( N, 1 )
00158 XTYPE = 'N'
00159 NIMAT = NTYPES
00160 IF( N.LE.0 )
00161 $ NIMAT = 1
00162
00163 DO 100 IMAT = 1, NIMAT
00164
00165
00166
00167 IF( .NOT.DOTYPE( IMAT ) )
00168 $ GO TO 100
00169
00170
00171
00172 ZEROT = IMAT.GE.3 .AND. IMAT.LE.5
00173 IF( ZEROT .AND. N.LT.IMAT-2 )
00174 $ GO TO 100
00175
00176
00177
00178 DO 90 IUPLO = 1, 2
00179 UPLO = UPLOS( IUPLO )
00180 PACKIT = PACKS( IUPLO )
00181
00182
00183
00184
00185 CALL CLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
00186 $ CNDNUM, DIST )
00187
00188 SRNAMT = 'CLATMS'
00189 CALL CLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE,
00190 $ CNDNUM, ANORM, KL, KU, PACKIT, A, LDA, WORK,
00191 $ INFO )
00192
00193
00194
00195 IF( INFO.NE.0 ) THEN
00196 CALL ALAERH( PATH, 'CLATMS', INFO, 0, UPLO, N, N, -1,
00197 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00198 GO TO 90
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
00214
00215 IF( IUPLO.EQ.1 ) THEN
00216 IOFF = ( IZERO-1 )*IZERO / 2
00217 DO 20 I = 1, IZERO - 1
00218 A( IOFF+I ) = ZERO
00219 20 CONTINUE
00220 IOFF = IOFF + IZERO
00221 DO 30 I = IZERO, N
00222 A( IOFF ) = ZERO
00223 IOFF = IOFF + I
00224 30 CONTINUE
00225 ELSE
00226 IOFF = IZERO
00227 DO 40 I = 1, IZERO - 1
00228 A( IOFF ) = ZERO
00229 IOFF = IOFF + N - I
00230 40 CONTINUE
00231 IOFF = IOFF - IZERO
00232 DO 50 I = IZERO, N
00233 A( IOFF+I ) = ZERO
00234 50 CONTINUE
00235 END IF
00236 ELSE
00237 IZERO = 0
00238 END IF
00239
00240
00241
00242 IF( IUPLO.EQ.1 ) THEN
00243 CALL CLAIPD( N, A, 2, 1 )
00244 ELSE
00245 CALL CLAIPD( N, A, N, -1 )
00246 END IF
00247
00248
00249
00250 NPP = N*( N+1 ) / 2
00251 CALL CCOPY( NPP, A, 1, AFAC, 1 )
00252 SRNAMT = 'CPPTRF'
00253 CALL CPPTRF( UPLO, N, AFAC, INFO )
00254
00255
00256
00257 IF( INFO.NE.IZERO ) THEN
00258 CALL ALAERH( PATH, 'CPPTRF', INFO, IZERO, UPLO, N, N,
00259 $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
00260 GO TO 90
00261 END IF
00262
00263
00264
00265 IF( INFO.NE.0 )
00266 $ GO TO 90
00267
00268
00269
00270
00271 CALL CCOPY( NPP, AFAC, 1, AINV, 1 )
00272 CALL CPPT01( UPLO, N, A, AINV, RWORK, RESULT( 1 ) )
00273
00274
00275
00276
00277 CALL CCOPY( NPP, AFAC, 1, AINV, 1 )
00278 SRNAMT = 'CPPTRI'
00279 CALL CPPTRI( UPLO, N, AINV, INFO )
00280
00281
00282
00283 IF( INFO.NE.0 )
00284 $ CALL ALAERH( PATH, 'CPPTRI', INFO, 0, UPLO, N, N, -1,
00285 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00286
00287 CALL CPPT03( UPLO, N, A, AINV, WORK, LDA, RWORK, RCONDC,
00288 $ RESULT( 2 ) )
00289
00290
00291
00292
00293 DO 60 K = 1, 2
00294 IF( RESULT( K ).GE.THRESH ) THEN
00295 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00296 $ CALL ALAHD( NOUT, PATH )
00297 WRITE( NOUT, FMT = 9999 )UPLO, N, IMAT, K,
00298 $ RESULT( K )
00299 NFAIL = NFAIL + 1
00300 END IF
00301 60 CONTINUE
00302 NRUN = NRUN + 2
00303
00304 DO 80 IRHS = 1, NNS
00305 NRHS = NSVAL( IRHS )
00306
00307
00308
00309
00310 SRNAMT = 'CLARHS'
00311 CALL CLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
00312 $ NRHS, A, LDA, XACT, LDA, B, LDA, ISEED,
00313 $ INFO )
00314 CALL CLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00315
00316 SRNAMT = 'CPPTRS'
00317 CALL CPPTRS( UPLO, N, NRHS, AFAC, X, LDA, INFO )
00318
00319
00320
00321 IF( INFO.NE.0 )
00322 $ CALL ALAERH( PATH, 'CPPTRS', INFO, 0, UPLO, N, N,
00323 $ -1, -1, NRHS, IMAT, NFAIL, NERRS,
00324 $ NOUT )
00325
00326 CALL CLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00327 CALL CPPT02( UPLO, N, NRHS, A, X, LDA, WORK, LDA,
00328 $ RWORK, RESULT( 3 ) )
00329
00330
00331
00332
00333 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00334 $ RESULT( 4 ) )
00335
00336
00337
00338
00339 SRNAMT = 'CPPRFS'
00340 CALL CPPRFS( UPLO, N, NRHS, A, AFAC, B, LDA, X, LDA,
00341 $ RWORK, RWORK( NRHS+1 ), WORK,
00342 $ RWORK( 2*NRHS+1 ), INFO )
00343
00344
00345
00346 IF( INFO.NE.0 )
00347 $ CALL ALAERH( PATH, 'CPPRFS', INFO, 0, UPLO, N, N,
00348 $ -1, -1, NRHS, IMAT, NFAIL, NERRS,
00349 $ NOUT )
00350
00351 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00352 $ RESULT( 5 ) )
00353 CALL CPPT05( UPLO, N, NRHS, A, B, LDA, X, LDA, XACT,
00354 $ LDA, RWORK, RWORK( NRHS+1 ),
00355 $ RESULT( 6 ) )
00356
00357
00358
00359
00360 DO 70 K = 3, 7
00361 IF( RESULT( K ).GE.THRESH ) THEN
00362 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00363 $ CALL ALAHD( NOUT, PATH )
00364 WRITE( NOUT, FMT = 9998 )UPLO, N, NRHS, IMAT,
00365 $ K, RESULT( K )
00366 NFAIL = NFAIL + 1
00367 END IF
00368 70 CONTINUE
00369 NRUN = NRUN + 5
00370 80 CONTINUE
00371
00372
00373
00374
00375 ANORM = CLANHP( '1', UPLO, N, A, RWORK )
00376 SRNAMT = 'CPPCON'
00377 CALL CPPCON( UPLO, N, AFAC, ANORM, RCOND, WORK, RWORK,
00378 $ INFO )
00379
00380
00381
00382 IF( INFO.NE.0 )
00383 $ CALL ALAERH( PATH, 'CPPCON', INFO, 0, UPLO, N, N, -1,
00384 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00385
00386 RESULT( 8 ) = SGET06( RCOND, RCONDC )
00387
00388
00389
00390 IF( RESULT( 8 ).GE.THRESH ) THEN
00391 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00392 $ CALL ALAHD( NOUT, PATH )
00393 WRITE( NOUT, FMT = 9999 )UPLO, N, IMAT, 8,
00394 $ RESULT( 8 )
00395 NFAIL = NFAIL + 1
00396 END IF
00397 NRUN = NRUN + 1
00398
00399 90 CONTINUE
00400 100 CONTINUE
00401 110 CONTINUE
00402
00403
00404
00405 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00406
00407 9999 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', type ', I2, ', test ',
00408 $ I2, ', ratio =', G12.5 )
00409 9998 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
00410 $ I2, ', test(', I2, ') =', G12.5 )
00411 RETURN
00412
00413
00414
00415 END