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