00001 SUBROUTINE CCHKPT( DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR,
00002 $ A, D, E, B, X, XACT, WORK, RWORK, NOUT )
00003
00004
00005
00006
00007
00008
00009 LOGICAL TSTERR
00010 INTEGER NN, NNS, NOUT
00011 REAL THRESH
00012
00013
00014 LOGICAL DOTYPE( * )
00015 INTEGER NSVAL( * ), NVAL( * )
00016 REAL D( * ), RWORK( * )
00017 COMPLEX A( * ), B( * ), E( * ), WORK( * ), X( * ),
00018 $ 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 REAL ONE, ZERO
00080 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
00081 INTEGER NTYPES
00082 PARAMETER ( NTYPES = 12 )
00083 INTEGER NTESTS
00084 PARAMETER ( NTESTS = 7 )
00085
00086
00087 LOGICAL ZEROT
00088 CHARACTER DIST, TYPE, UPLO
00089 CHARACTER*3 PATH
00090 INTEGER I, IA, IMAT, IN, INFO, IRHS, IUPLO, IX, IZERO,
00091 $ J, K, KL, KU, LDA, MODE, N, NERRS, NFAIL,
00092 $ NIMAT, NRHS, NRUN
00093 REAL AINVNM, ANORM, COND, DMAX, RCOND, RCONDC
00094
00095
00096 CHARACTER UPLOS( 2 )
00097 INTEGER ISEED( 4 ), ISEEDY( 4 )
00098 REAL RESULT( NTESTS )
00099 COMPLEX Z( 3 )
00100
00101
00102 INTEGER ISAMAX
00103 REAL CLANHT, SCASUM, SGET06
00104 EXTERNAL ISAMAX, CLANHT, SCASUM, SGET06
00105
00106
00107 EXTERNAL ALAERH, ALAHD, ALASUM, CCOPY, CERRGT, CGET04,
00108 $ CLACPY, CLAPTM, CLARNV, CLATB4, CLATMS, CPTCON,
00109 $ CPTRFS, CPTT01, CPTT02, CPTT05, CPTTRF, CPTTRS,
00110 $ CSSCAL, SCOPY, SLARNV, SSCAL
00111
00112
00113 INTRINSIC ABS, MAX, REAL
00114
00115
00116 LOGICAL LERR, OK
00117 CHARACTER*32 SRNAMT
00118 INTEGER INFOT, NUNIT
00119
00120
00121 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00122 COMMON / SRNAMC / SRNAMT
00123
00124
00125 DATA ISEEDY / 0, 0, 0, 1 / , UPLOS / 'U', 'L' /
00126
00127
00128
00129 PATH( 1: 1 ) = 'Complex precision'
00130 PATH( 2: 3 ) = 'PT'
00131 NRUN = 0
00132 NFAIL = 0
00133 NERRS = 0
00134 DO 10 I = 1, 4
00135 ISEED( I ) = ISEEDY( I )
00136 10 CONTINUE
00137
00138
00139
00140 IF( TSTERR )
00141 $ CALL CERRGT( PATH, NOUT )
00142 INFOT = 0
00143
00144 DO 120 IN = 1, NN
00145
00146
00147
00148 N = NVAL( IN )
00149 LDA = MAX( 1, N )
00150 NIMAT = NTYPES
00151 IF( N.LE.0 )
00152 $ NIMAT = 1
00153
00154 DO 110 IMAT = 1, NIMAT
00155
00156
00157
00158 IF( N.GT.0 .AND. .NOT.DOTYPE( IMAT ) )
00159 $ GO TO 110
00160
00161
00162
00163 CALL CLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
00164 $ COND, DIST )
00165
00166 ZEROT = IMAT.GE.8 .AND. IMAT.LE.10
00167 IF( IMAT.LE.6 ) THEN
00168
00169
00170
00171
00172 SRNAMT = 'CLATMS'
00173 CALL CLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE, COND,
00174 $ ANORM, KL, KU, 'B', A, 2, WORK, INFO )
00175
00176
00177
00178 IF( INFO.NE.0 ) THEN
00179 CALL ALAERH( PATH, 'CLATMS', INFO, 0, ' ', N, N, KL,
00180 $ KU, -1, IMAT, NFAIL, NERRS, NOUT )
00181 GO TO 110
00182 END IF
00183 IZERO = 0
00184
00185
00186
00187 IA = 1
00188 DO 20 I = 1, N - 1
00189 D( I ) = REAL( A( IA ) )
00190 E( I ) = A( IA+1 )
00191 IA = IA + 2
00192 20 CONTINUE
00193 IF( N.GT.0 )
00194 $ D( N ) = REAL( A( IA ) )
00195 ELSE
00196
00197
00198
00199
00200 IF( .NOT.ZEROT .OR. .NOT.DOTYPE( 7 ) ) THEN
00201
00202
00203
00204 CALL SLARNV( 2, ISEED, N, D )
00205 CALL CLARNV( 2, ISEED, N-1, E )
00206
00207
00208
00209 IF( N.EQ.1 ) THEN
00210 D( 1 ) = ABS( D( 1 ) )
00211 ELSE
00212 D( 1 ) = ABS( D( 1 ) ) + ABS( E( 1 ) )
00213 D( N ) = ABS( D( N ) ) + ABS( E( N-1 ) )
00214 DO 30 I = 2, N - 1
00215 D( I ) = ABS( D( I ) ) + ABS( E( I ) ) +
00216 $ ABS( E( I-1 ) )
00217 30 CONTINUE
00218 END IF
00219
00220
00221
00222 IX = ISAMAX( N, D, 1 )
00223 DMAX = D( IX )
00224 CALL SSCAL( N, ANORM / DMAX, D, 1 )
00225 CALL CSSCAL( N-1, ANORM / DMAX, E, 1 )
00226
00227 ELSE IF( IZERO.GT.0 ) THEN
00228
00229
00230
00231
00232 IF( IZERO.EQ.1 ) THEN
00233 D( 1 ) = Z( 2 )
00234 IF( N.GT.1 )
00235 $ E( 1 ) = Z( 3 )
00236 ELSE IF( IZERO.EQ.N ) THEN
00237 E( N-1 ) = Z( 1 )
00238 D( N ) = Z( 2 )
00239 ELSE
00240 E( IZERO-1 ) = Z( 1 )
00241 D( IZERO ) = Z( 2 )
00242 E( IZERO ) = Z( 3 )
00243 END IF
00244 END IF
00245
00246
00247
00248
00249 IZERO = 0
00250 IF( IMAT.EQ.8 ) THEN
00251 IZERO = 1
00252 Z( 2 ) = D( 1 )
00253 D( 1 ) = ZERO
00254 IF( N.GT.1 ) THEN
00255 Z( 3 ) = E( 1 )
00256 E( 1 ) = ZERO
00257 END IF
00258 ELSE IF( IMAT.EQ.9 ) THEN
00259 IZERO = N
00260 IF( N.GT.1 ) THEN
00261 Z( 1 ) = E( N-1 )
00262 E( N-1 ) = ZERO
00263 END IF
00264 Z( 2 ) = D( N )
00265 D( N ) = ZERO
00266 ELSE IF( IMAT.EQ.10 ) THEN
00267 IZERO = ( N+1 ) / 2
00268 IF( IZERO.GT.1 ) THEN
00269 Z( 1 ) = E( IZERO-1 )
00270 Z( 3 ) = E( IZERO )
00271 E( IZERO-1 ) = ZERO
00272 E( IZERO ) = ZERO
00273 END IF
00274 Z( 2 ) = D( IZERO )
00275 D( IZERO ) = ZERO
00276 END IF
00277 END IF
00278
00279 CALL SCOPY( N, D, 1, D( N+1 ), 1 )
00280 IF( N.GT.1 )
00281 $ CALL CCOPY( N-1, E, 1, E( N+1 ), 1 )
00282
00283
00284
00285
00286
00287 CALL CPTTRF( N, D( N+1 ), E( N+1 ), INFO )
00288
00289
00290
00291 IF( INFO.NE.IZERO ) THEN
00292 CALL ALAERH( PATH, 'CPTTRF', INFO, IZERO, ' ', N, N, -1,
00293 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00294 GO TO 110
00295 END IF
00296
00297 IF( INFO.GT.0 ) THEN
00298 RCONDC = ZERO
00299 GO TO 100
00300 END IF
00301
00302 CALL CPTT01( N, D, E, D( N+1 ), E( N+1 ), WORK,
00303 $ RESULT( 1 ) )
00304
00305
00306
00307 IF( RESULT( 1 ).GE.THRESH ) THEN
00308 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00309 $ CALL ALAHD( NOUT, PATH )
00310 WRITE( NOUT, FMT = 9999 )N, IMAT, 1, RESULT( 1 )
00311 NFAIL = NFAIL + 1
00312 END IF
00313 NRUN = NRUN + 1
00314
00315
00316
00317
00318
00319 ANORM = CLANHT( '1', N, D, E )
00320
00321
00322
00323
00324 AINVNM = ZERO
00325 DO 50 I = 1, N
00326 DO 40 J = 1, N
00327 X( J ) = ZERO
00328 40 CONTINUE
00329 X( I ) = ONE
00330 CALL CPTTRS( 'Lower', N, 1, D( N+1 ), E( N+1 ), X, LDA,
00331 $ INFO )
00332 AINVNM = MAX( AINVNM, SCASUM( N, X, 1 ) )
00333 50 CONTINUE
00334 RCONDC = ONE / MAX( ONE, ANORM*AINVNM )
00335
00336 DO 90 IRHS = 1, NNS
00337 NRHS = NSVAL( IRHS )
00338
00339
00340
00341 IX = 1
00342 DO 60 J = 1, NRHS
00343 CALL CLARNV( 2, ISEED, N, XACT( IX ) )
00344 IX = IX + LDA
00345 60 CONTINUE
00346
00347 DO 80 IUPLO = 1, 2
00348
00349
00350
00351 UPLO = UPLOS( IUPLO )
00352
00353
00354
00355 CALL CLAPTM( UPLO, N, NRHS, ONE, D, E, XACT, LDA,
00356 $ ZERO, B, LDA )
00357
00358
00359
00360
00361 CALL CLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00362 CALL CPTTRS( UPLO, N, NRHS, D( N+1 ), E( N+1 ), X,
00363 $ LDA, INFO )
00364
00365
00366
00367 IF( INFO.NE.0 )
00368 $ CALL ALAERH( PATH, 'CPTTRS', INFO, 0, UPLO, N, N,
00369 $ -1, -1, NRHS, IMAT, NFAIL, NERRS,
00370 $ NOUT )
00371
00372 CALL CLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00373 CALL CPTT02( UPLO, N, NRHS, D, E, X, LDA, WORK, LDA,
00374 $ RESULT( 2 ) )
00375
00376
00377
00378
00379 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00380 $ RESULT( 3 ) )
00381
00382
00383
00384
00385 SRNAMT = 'CPTRFS'
00386 CALL CPTRFS( UPLO, N, NRHS, D, E, D( N+1 ), E( N+1 ),
00387 $ B, LDA, X, LDA, RWORK, RWORK( NRHS+1 ),
00388 $ WORK, RWORK( 2*NRHS+1 ), INFO )
00389
00390
00391
00392 IF( INFO.NE.0 )
00393 $ CALL ALAERH( PATH, 'CPTRFS', INFO, 0, UPLO, N, N,
00394 $ -1, -1, NRHS, IMAT, NFAIL, NERRS,
00395 $ NOUT )
00396
00397 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00398 $ RESULT( 4 ) )
00399 CALL CPTT05( N, NRHS, D, E, B, LDA, X, LDA, XACT, LDA,
00400 $ RWORK, RWORK( NRHS+1 ), RESULT( 5 ) )
00401
00402
00403
00404
00405 DO 70 K = 2, 6
00406 IF( RESULT( K ).GE.THRESH ) THEN
00407 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00408 $ CALL ALAHD( NOUT, PATH )
00409 WRITE( NOUT, FMT = 9998 )UPLO, N, NRHS, IMAT,
00410 $ K, RESULT( K )
00411 NFAIL = NFAIL + 1
00412 END IF
00413 70 CONTINUE
00414 NRUN = NRUN + 5
00415
00416 80 CONTINUE
00417 90 CONTINUE
00418
00419
00420
00421
00422
00423 100 CONTINUE
00424 SRNAMT = 'CPTCON'
00425 CALL CPTCON( N, D( N+1 ), E( N+1 ), ANORM, RCOND, RWORK,
00426 $ INFO )
00427
00428
00429
00430 IF( INFO.NE.0 )
00431 $ CALL ALAERH( PATH, 'CPTCON', INFO, 0, ' ', N, N, -1, -1,
00432 $ -1, IMAT, NFAIL, NERRS, NOUT )
00433
00434 RESULT( 7 ) = SGET06( RCOND, RCONDC )
00435
00436
00437
00438 IF( RESULT( 7 ).GE.THRESH ) THEN
00439 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00440 $ CALL ALAHD( NOUT, PATH )
00441 WRITE( NOUT, FMT = 9999 )N, IMAT, 7, RESULT( 7 )
00442 NFAIL = NFAIL + 1
00443 END IF
00444 NRUN = NRUN + 1
00445 110 CONTINUE
00446 120 CONTINUE
00447
00448
00449
00450 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00451
00452 9999 FORMAT( ' N =', I5, ', type ', I2, ', test ', I2, ', ratio = ',
00453 $ G12.5 )
00454 9998 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NRHS =', I3,
00455 $ ', type ', I2, ', test ', I2, ', ratio = ', G12.5 )
00456 RETURN
00457
00458
00459
00460 END