00001 SUBROUTINE CDRVPP( DOTYPE, NN, NVAL, NRHS, THRESH, TSTERR, NMAX,
00002 $ A, AFAC, ASAV, B, BSAV, X, XACT, S, WORK,
00003 $ RWORK, NOUT )
00004
00005
00006
00007
00008
00009
00010 LOGICAL TSTERR
00011 INTEGER NMAX, NN, NOUT, NRHS
00012 REAL THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER NVAL( * )
00017 REAL RWORK( * ), S( * )
00018 COMPLEX A( * ), AFAC( * ), ASAV( * ), B( * ),
00019 $ BSAV( * ), 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 REAL ONE, ZERO
00085 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
00086 INTEGER NTYPES
00087 PARAMETER ( NTYPES = 9 )
00088 INTEGER NTESTS
00089 PARAMETER ( NTESTS = 6 )
00090
00091
00092 LOGICAL EQUIL, NOFACT, PREFAC, ZEROT
00093 CHARACTER DIST, EQUED, FACT, PACKIT, TYPE, UPLO, XTYPE
00094 CHARACTER*3 PATH
00095 INTEGER I, IEQUED, IFACT, IMAT, IN, INFO, IOFF, IUPLO,
00096 $ IZERO, K, K1, KL, KU, LDA, MODE, N, NERRS,
00097 $ NFACT, NFAIL, NIMAT, NPP, NRUN, NT
00098 REAL AINVNM, AMAX, ANORM, CNDNUM, RCOND, RCONDC,
00099 $ ROLDC, SCOND
00100
00101
00102 CHARACTER EQUEDS( 2 ), FACTS( 3 ), PACKS( 2 ), UPLOS( 2 )
00103 INTEGER ISEED( 4 ), ISEEDY( 4 )
00104 REAL RESULT( NTESTS )
00105
00106
00107 LOGICAL LSAME
00108 REAL CLANHP, SGET06
00109 EXTERNAL LSAME, CLANHP, SGET06
00110
00111
00112 EXTERNAL ALADHD, ALAERH, ALASVM, CCOPY, CERRVX, CGET04,
00113 $ CLACPY, CLAIPD, CLAQHP, CLARHS, CLASET, CLATB4,
00114 $ CLATMS, CPPEQU, CPPSV, CPPSVX, CPPT01, CPPT02,
00115 $ CPPT05, CPPTRF, CPPTRI
00116
00117
00118 LOGICAL LERR, OK
00119 CHARACTER*32 SRNAMT
00120 INTEGER INFOT, NUNIT
00121
00122
00123 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00124 COMMON / SRNAMC / SRNAMT
00125
00126
00127 INTRINSIC CMPLX, MAX
00128
00129
00130 DATA ISEEDY / 1988, 1989, 1990, 1991 /
00131 DATA UPLOS / 'U', 'L' / , FACTS / 'F', 'N', 'E' / ,
00132 $ PACKS / 'C', 'R' / , EQUEDS / 'N', 'Y' /
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 CERRVX( PATH, NOUT )
00151 INFOT = 0
00152
00153
00154
00155 DO 140 IN = 1, NN
00156 N = NVAL( IN )
00157 LDA = MAX( N, 1 )
00158 NPP = N*( N+1 ) / 2
00159 XTYPE = 'N'
00160 NIMAT = NTYPES
00161 IF( N.LE.0 )
00162 $ NIMAT = 1
00163
00164 DO 130 IMAT = 1, NIMAT
00165
00166
00167
00168 IF( .NOT.DOTYPE( IMAT ) )
00169 $ GO TO 130
00170
00171
00172
00173 ZEROT = IMAT.GE.3 .AND. IMAT.LE.5
00174 IF( ZEROT .AND. N.LT.IMAT-2 )
00175 $ GO TO 130
00176
00177
00178
00179 DO 120 IUPLO = 1, 2
00180 UPLO = UPLOS( IUPLO )
00181 PACKIT = PACKS( IUPLO )
00182
00183
00184
00185
00186 CALL CLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
00187 $ CNDNUM, DIST )
00188 RCONDC = ONE / CNDNUM
00189
00190 SRNAMT = 'CLATMS'
00191 CALL CLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE,
00192 $ CNDNUM, ANORM, KL, KU, PACKIT, A, LDA, WORK,
00193 $ INFO )
00194
00195
00196
00197 IF( INFO.NE.0 ) THEN
00198 CALL ALAERH( PATH, 'CLATMS', INFO, 0, UPLO, N, N, -1,
00199 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00200 GO TO 120
00201 END IF
00202
00203
00204
00205
00206 IF( ZEROT ) THEN
00207 IF( IMAT.EQ.3 ) THEN
00208 IZERO = 1
00209 ELSE IF( IMAT.EQ.4 ) THEN
00210 IZERO = N
00211 ELSE
00212 IZERO = N / 2 + 1
00213 END IF
00214
00215
00216
00217 IF( IUPLO.EQ.1 ) THEN
00218 IOFF = ( IZERO-1 )*IZERO / 2
00219 DO 20 I = 1, IZERO - 1
00220 A( IOFF+I ) = ZERO
00221 20 CONTINUE
00222 IOFF = IOFF + IZERO
00223 DO 30 I = IZERO, N
00224 A( IOFF ) = ZERO
00225 IOFF = IOFF + I
00226 30 CONTINUE
00227 ELSE
00228 IOFF = IZERO
00229 DO 40 I = 1, IZERO - 1
00230 A( IOFF ) = ZERO
00231 IOFF = IOFF + N - I
00232 40 CONTINUE
00233 IOFF = IOFF - IZERO
00234 DO 50 I = IZERO, N
00235 A( IOFF+I ) = ZERO
00236 50 CONTINUE
00237 END IF
00238 ELSE
00239 IZERO = 0
00240 END IF
00241
00242
00243
00244 IF( IUPLO.EQ.1 ) THEN
00245 CALL CLAIPD( N, A, 2, 1 )
00246 ELSE
00247 CALL CLAIPD( N, A, N, -1 )
00248 END IF
00249
00250
00251
00252 CALL CCOPY( NPP, A, 1, ASAV, 1 )
00253
00254 DO 110 IEQUED = 1, 2
00255 EQUED = EQUEDS( IEQUED )
00256 IF( IEQUED.EQ.1 ) THEN
00257 NFACT = 3
00258 ELSE
00259 NFACT = 1
00260 END IF
00261
00262 DO 100 IFACT = 1, NFACT
00263 FACT = FACTS( IFACT )
00264 PREFAC = LSAME( FACT, 'F' )
00265 NOFACT = LSAME( FACT, 'N' )
00266 EQUIL = LSAME( FACT, 'E' )
00267
00268 IF( ZEROT ) THEN
00269 IF( PREFAC )
00270 $ GO TO 100
00271 RCONDC = ZERO
00272
00273 ELSE IF( .NOT.LSAME( FACT, 'N' ) ) THEN
00274
00275
00276
00277
00278
00279
00280 CALL CCOPY( NPP, ASAV, 1, AFAC, 1 )
00281 IF( EQUIL .OR. IEQUED.GT.1 ) THEN
00282
00283
00284
00285
00286 CALL CPPEQU( UPLO, N, AFAC, S, SCOND, AMAX,
00287 $ INFO )
00288 IF( INFO.EQ.0 .AND. N.GT.0 ) THEN
00289 IF( IEQUED.GT.1 )
00290 $ SCOND = ZERO
00291
00292
00293
00294 CALL CLAQHP( UPLO, N, AFAC, S, SCOND,
00295 $ AMAX, EQUED )
00296 END IF
00297 END IF
00298
00299
00300
00301
00302 IF( EQUIL )
00303 $ ROLDC = RCONDC
00304
00305
00306
00307 ANORM = CLANHP( '1', UPLO, N, AFAC, RWORK )
00308
00309
00310
00311 CALL CPPTRF( UPLO, N, AFAC, INFO )
00312
00313
00314
00315 CALL CCOPY( NPP, AFAC, 1, A, 1 )
00316 CALL CPPTRI( UPLO, N, A, INFO )
00317
00318
00319
00320 AINVNM = CLANHP( '1', UPLO, N, A, RWORK )
00321 IF( ANORM.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
00322 RCONDC = ONE
00323 ELSE
00324 RCONDC = ( ONE / ANORM ) / AINVNM
00325 END IF
00326 END IF
00327
00328
00329
00330 CALL CCOPY( NPP, ASAV, 1, A, 1 )
00331
00332
00333
00334 SRNAMT = 'CLARHS'
00335 CALL CLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
00336 $ NRHS, A, LDA, XACT, LDA, B, LDA,
00337 $ ISEED, INFO )
00338 XTYPE = 'C'
00339 CALL CLACPY( 'Full', N, NRHS, B, LDA, BSAV, LDA )
00340
00341 IF( NOFACT ) THEN
00342
00343
00344
00345
00346
00347
00348 CALL CCOPY( NPP, A, 1, AFAC, 1 )
00349 CALL CLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00350
00351 SRNAMT = 'CPPSV '
00352 CALL CPPSV( UPLO, N, NRHS, AFAC, X, LDA, INFO )
00353
00354
00355
00356 IF( INFO.NE.IZERO ) THEN
00357 CALL ALAERH( PATH, 'CPPSV ', INFO, IZERO,
00358 $ UPLO, N, N, -1, -1, NRHS, IMAT,
00359 $ NFAIL, NERRS, NOUT )
00360 GO TO 70
00361 ELSE IF( INFO.NE.0 ) THEN
00362 GO TO 70
00363 END IF
00364
00365
00366
00367
00368 CALL CPPT01( UPLO, N, A, AFAC, RWORK,
00369 $ RESULT( 1 ) )
00370
00371
00372
00373 CALL CLACPY( 'Full', N, NRHS, B, LDA, WORK,
00374 $ LDA )
00375 CALL CPPT02( UPLO, N, NRHS, A, X, LDA, WORK,
00376 $ LDA, RWORK, RESULT( 2 ) )
00377
00378
00379
00380 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00381 $ RESULT( 3 ) )
00382 NT = 3
00383
00384
00385
00386
00387 DO 60 K = 1, NT
00388 IF( RESULT( K ).GE.THRESH ) THEN
00389 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00390 $ CALL ALADHD( NOUT, PATH )
00391 WRITE( NOUT, FMT = 9999 )'CPPSV ', UPLO,
00392 $ N, IMAT, K, RESULT( K )
00393 NFAIL = NFAIL + 1
00394 END IF
00395 60 CONTINUE
00396 NRUN = NRUN + NT
00397 70 CONTINUE
00398 END IF
00399
00400
00401
00402 IF( .NOT.PREFAC .AND. NPP.GT.0 )
00403 $ CALL CLASET( 'Full', NPP, 1, CMPLX( ZERO ),
00404 $ CMPLX( ZERO ), AFAC, NPP )
00405 CALL CLASET( 'Full', N, NRHS, CMPLX( ZERO ),
00406 $ CMPLX( ZERO ), X, LDA )
00407 IF( IEQUED.GT.1 .AND. N.GT.0 ) THEN
00408
00409
00410
00411
00412 CALL CLAQHP( UPLO, N, A, S, SCOND, AMAX, EQUED )
00413 END IF
00414
00415
00416
00417
00418 SRNAMT = 'CPPSVX'
00419 CALL CPPSVX( FACT, UPLO, N, NRHS, A, AFAC, EQUED,
00420 $ S, B, LDA, X, LDA, RCOND, RWORK,
00421 $ RWORK( NRHS+1 ), WORK,
00422 $ RWORK( 2*NRHS+1 ), INFO )
00423
00424
00425
00426 IF( INFO.NE.IZERO ) THEN
00427 CALL ALAERH( PATH, 'CPPSVX', INFO, IZERO,
00428 $ FACT // UPLO, N, N, -1, -1, NRHS,
00429 $ IMAT, NFAIL, NERRS, NOUT )
00430 GO TO 90
00431 END IF
00432
00433 IF( INFO.EQ.0 ) THEN
00434 IF( .NOT.PREFAC ) THEN
00435
00436
00437
00438
00439 CALL CPPT01( UPLO, N, A, AFAC,
00440 $ RWORK( 2*NRHS+1 ), RESULT( 1 ) )
00441 K1 = 1
00442 ELSE
00443 K1 = 2
00444 END IF
00445
00446
00447
00448 CALL CLACPY( 'Full', N, NRHS, BSAV, LDA, WORK,
00449 $ LDA )
00450 CALL CPPT02( UPLO, N, NRHS, ASAV, X, LDA, WORK,
00451 $ LDA, RWORK( 2*NRHS+1 ),
00452 $ RESULT( 2 ) )
00453
00454
00455
00456 IF( NOFACT .OR. ( PREFAC .AND. LSAME( EQUED,
00457 $ 'N' ) ) ) THEN
00458 CALL CGET04( N, NRHS, X, LDA, XACT, LDA,
00459 $ RCONDC, RESULT( 3 ) )
00460 ELSE
00461 CALL CGET04( N, NRHS, X, LDA, XACT, LDA,
00462 $ ROLDC, RESULT( 3 ) )
00463 END IF
00464
00465
00466
00467
00468 CALL CPPT05( UPLO, N, NRHS, ASAV, B, LDA, X,
00469 $ LDA, XACT, LDA, RWORK,
00470 $ RWORK( NRHS+1 ), RESULT( 4 ) )
00471 ELSE
00472 K1 = 6
00473 END IF
00474
00475
00476
00477
00478 RESULT( 6 ) = SGET06( RCOND, RCONDC )
00479
00480
00481
00482
00483 DO 80 K = K1, 6
00484 IF( RESULT( K ).GE.THRESH ) THEN
00485 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00486 $ CALL ALADHD( NOUT, PATH )
00487 IF( PREFAC ) THEN
00488 WRITE( NOUT, FMT = 9997 )'CPPSVX', FACT,
00489 $ UPLO, N, EQUED, IMAT, K, RESULT( K )
00490 ELSE
00491 WRITE( NOUT, FMT = 9998 )'CPPSVX', FACT,
00492 $ UPLO, N, IMAT, K, RESULT( K )
00493 END IF
00494 NFAIL = NFAIL + 1
00495 END IF
00496 80 CONTINUE
00497 NRUN = NRUN + 7 - K1
00498 90 CONTINUE
00499 100 CONTINUE
00500 110 CONTINUE
00501 120 CONTINUE
00502 130 CONTINUE
00503 140 CONTINUE
00504
00505
00506
00507 CALL ALASVM( PATH, NOUT, NFAIL, NRUN, NERRS )
00508
00509 9999 FORMAT( 1X, A, ', UPLO=''', A1, ''', N =', I5, ', type ', I1,
00510 $ ', test(', I1, ')=', G12.5 )
00511 9998 FORMAT( 1X, A, ', FACT=''', A1, ''', UPLO=''', A1, ''', N=', I5,
00512 $ ', type ', I1, ', test(', I1, ')=', G12.5 )
00513 9997 FORMAT( 1X, A, ', FACT=''', A1, ''', UPLO=''', A1, ''', N=', I5,
00514 $ ', EQUED=''', A1, ''', type ', I1, ', test(', I1, ')=',
00515 $ G12.5 )
00516 RETURN
00517
00518
00519
00520 END