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