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