00001 SUBROUTINE CDRVRFP( NOUT, NN, NVAL, NNS, NSVAL, NNT, NTVAL,
00002 + THRESH, A, ASAV, AFAC, AINV, B,
00003 + BSAV, XACT, X, ARF, ARFINV,
00004 + C_WORK_CLATMS, C_WORK_CPOT02,
00005 + C_WORK_CPOT03, S_WORK_CLATMS, S_WORK_CLANHE,
00006 + S_WORK_CPOT01, S_WORK_CPOT02, S_WORK_CPOT03 )
00007
00008
00009
00010
00011
00012
00013 INTEGER NN, NNS, NNT, NOUT
00014 REAL THRESH
00015
00016
00017 INTEGER NVAL( NN ), NSVAL( NNS ), NTVAL( NNT )
00018 COMPLEX A( * )
00019 COMPLEX AINV( * )
00020 COMPLEX ASAV( * )
00021 COMPLEX B( * )
00022 COMPLEX BSAV( * )
00023 COMPLEX AFAC( * )
00024 COMPLEX ARF( * )
00025 COMPLEX ARFINV( * )
00026 COMPLEX XACT( * )
00027 COMPLEX X( * )
00028 COMPLEX C_WORK_CLATMS( * )
00029 COMPLEX C_WORK_CPOT02( * )
00030 COMPLEX C_WORK_CPOT03( * )
00031 REAL S_WORK_CLATMS( * )
00032 REAL S_WORK_CLANHE( * )
00033 REAL S_WORK_CPOT01( * )
00034 REAL S_WORK_CPOT02( * )
00035 REAL S_WORK_CPOT03( * )
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
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142 REAL ONE, ZERO
00143 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
00144 INTEGER NTESTS
00145 PARAMETER ( NTESTS = 4 )
00146
00147
00148 LOGICAL ZEROT
00149 INTEGER I, INFO, IUPLO, LDA, LDB, IMAT, NERRS, NFAIL,
00150 + NRHS, NRUN, IZERO, IOFF, K, NT, N, IFORM, IIN,
00151 + IIT, IIS
00152 CHARACTER DIST, CTYPE, UPLO, CFORM
00153 INTEGER KL, KU, MODE
00154 REAL ANORM, AINVNM, CNDNUM, RCONDC
00155
00156
00157 CHARACTER UPLOS( 2 ), FORMS( 2 )
00158 INTEGER ISEED( 4 ), ISEEDY( 4 )
00159 REAL RESULT( NTESTS )
00160
00161
00162 REAL CLANHE
00163 EXTERNAL CLANHE
00164
00165
00166 EXTERNAL ALADHD, ALAERH, ALASVM, CGET04, CTFTTR, CLACPY,
00167 + CLAIPD, CLARHS, CLATB4, CLATMS, CPFTRI, CPFTRF,
00168 + CPFTRS, CPOT01, CPOT02, CPOT03, CPOTRI, CPOTRF,
00169 + CTRTTF
00170
00171
00172 CHARACTER*32 SRNAMT
00173
00174
00175 COMMON / SRNAMC / SRNAMT
00176
00177
00178 DATA ISEEDY / 1988, 1989, 1990, 1991 /
00179 DATA UPLOS / 'U', 'L' /
00180 DATA FORMS / 'N', 'C' /
00181
00182
00183
00184
00185
00186 NRUN = 0
00187 NFAIL = 0
00188 NERRS = 0
00189 DO 10 I = 1, 4
00190 ISEED( I ) = ISEEDY( I )
00191 10 CONTINUE
00192
00193 DO 130 IIN = 1, NN
00194
00195 N = NVAL( IIN )
00196 LDA = MAX( N, 1 )
00197 LDB = MAX( N, 1 )
00198
00199 DO 980 IIS = 1, NNS
00200
00201 NRHS = NSVAL( IIS )
00202
00203 DO 120 IIT = 1, NNT
00204
00205 IMAT = NTVAL( IIT )
00206
00207
00208
00209 IF( N.EQ.0 .AND. IIT.GT.1 ) GO TO 120
00210
00211
00212
00213 IF( IMAT.EQ.4 .AND. N.LE.1 ) GO TO 120
00214 IF( IMAT.EQ.5 .AND. N.LE.2 ) GO TO 120
00215
00216
00217
00218 DO 110 IUPLO = 1, 2
00219 UPLO = UPLOS( IUPLO )
00220
00221
00222
00223 DO 100 IFORM = 1, 2
00224 CFORM = FORMS( IFORM )
00225
00226
00227
00228
00229 CALL CLATB4( 'CPO', IMAT, N, N, CTYPE, KL, KU,
00230 + ANORM, MODE, CNDNUM, DIST )
00231
00232 SRNAMT = 'CLATMS'
00233 CALL CLATMS( N, N, DIST, ISEED, CTYPE,
00234 + S_WORK_CLATMS,
00235 + MODE, CNDNUM, ANORM, KL, KU, UPLO, A,
00236 + LDA, C_WORK_CLATMS, INFO )
00237
00238
00239
00240 IF( INFO.NE.0 ) THEN
00241 CALL ALAERH( 'CPF', 'CLATMS', INFO, 0, UPLO, N,
00242 + N, -1, -1, -1, IIT, NFAIL, NERRS,
00243 + NOUT )
00244 GO TO 100
00245 END IF
00246
00247
00248
00249
00250 ZEROT = IMAT.GE.3 .AND. IMAT.LE.5
00251 IF( ZEROT ) THEN
00252 IF( IIT.EQ.3 ) THEN
00253 IZERO = 1
00254 ELSE IF( IIT.EQ.4 ) THEN
00255 IZERO = N
00256 ELSE
00257 IZERO = N / 2 + 1
00258 END IF
00259 IOFF = ( IZERO-1 )*LDA
00260
00261
00262
00263 IF( IUPLO.EQ.1 ) THEN
00264 DO 20 I = 1, IZERO - 1
00265 A( IOFF+I ) = ZERO
00266 20 CONTINUE
00267 IOFF = IOFF + IZERO
00268 DO 30 I = IZERO, N
00269 A( IOFF ) = ZERO
00270 IOFF = IOFF + LDA
00271 30 CONTINUE
00272 ELSE
00273 IOFF = IZERO
00274 DO 40 I = 1, IZERO - 1
00275 A( IOFF ) = ZERO
00276 IOFF = IOFF + LDA
00277 40 CONTINUE
00278 IOFF = IOFF - IZERO
00279 DO 50 I = IZERO, N
00280 A( IOFF+I ) = ZERO
00281 50 CONTINUE
00282 END IF
00283 ELSE
00284 IZERO = 0
00285 END IF
00286
00287
00288
00289 CALL CLAIPD( N, A, LDA+1, 0 )
00290
00291
00292
00293 CALL CLACPY( UPLO, N, N, A, LDA, ASAV, LDA )
00294
00295
00296
00297 IF( ZEROT ) THEN
00298 RCONDC = ZERO
00299 ELSE
00300
00301
00302
00303 ANORM = CLANHE( '1', UPLO, N, A, LDA,
00304 + S_WORK_CLANHE )
00305
00306
00307
00308 CALL CPOTRF( UPLO, N, A, LDA, INFO )
00309
00310
00311
00312 CALL CPOTRI( UPLO, N, A, LDA, INFO )
00313
00314
00315
00316 AINVNM = CLANHE( '1', UPLO, N, A, LDA,
00317 + S_WORK_CLANHE )
00318 RCONDC = ( ONE / ANORM ) / AINVNM
00319
00320
00321
00322 CALL CLACPY( UPLO, N, N, ASAV, LDA, A, LDA )
00323
00324 END IF
00325
00326
00327
00328 SRNAMT = 'CLARHS'
00329 CALL CLARHS( 'CPO', 'N', UPLO, ' ', N, N, KL, KU,
00330 + NRHS, A, LDA, XACT, LDA, B, LDA,
00331 + ISEED, INFO )
00332 CALL CLACPY( 'Full', N, NRHS, B, LDA, BSAV, LDA )
00333
00334
00335
00336
00337 CALL CLACPY( UPLO, N, N, A, LDA, AFAC, LDA )
00338 CALL CLACPY( 'Full', N, NRHS, B, LDB, X, LDB )
00339
00340 SRNAMT = 'CTRTTF'
00341 CALL CTRTTF( CFORM, UPLO, N, AFAC, LDA, ARF, INFO )
00342 SRNAMT = 'CPFTRF'
00343 CALL CPFTRF( CFORM, UPLO, N, ARF, INFO )
00344
00345
00346
00347 IF( INFO.NE.IZERO ) THEN
00348
00349
00350
00351
00352
00353 CALL ALAERH( 'CPF', 'CPFSV ', INFO, IZERO,
00354 + UPLO, N, N, -1, -1, NRHS, IIT,
00355 + NFAIL, NERRS, NOUT )
00356 GO TO 100
00357 END IF
00358
00359
00360
00361 IF( INFO.NE.0 ) THEN
00362 GO TO 100
00363 END IF
00364
00365 SRNAMT = 'CPFTRS'
00366 CALL CPFTRS( CFORM, UPLO, N, NRHS, ARF, X, LDB,
00367 + INFO )
00368
00369 SRNAMT = 'CTFTTR'
00370 CALL CTFTTR( CFORM, UPLO, N, ARF, AFAC, LDA, INFO )
00371
00372
00373
00374
00375 CALL CLACPY( UPLO, N, N, AFAC, LDA, ASAV, LDA )
00376 CALL CPOT01( UPLO, N, A, LDA, AFAC, LDA,
00377 + S_WORK_CPOT01, RESULT( 1 ) )
00378 CALL CLACPY( UPLO, N, N, ASAV, LDA, AFAC, LDA )
00379
00380
00381
00382 IF(MOD(N,2).EQ.0)THEN
00383 CALL CLACPY( 'A', N+1, N/2, ARF, N+1, ARFINV,
00384 + N+1 )
00385 ELSE
00386 CALL CLACPY( 'A', N, (N+1)/2, ARF, N, ARFINV,
00387 + N )
00388 END IF
00389
00390 SRNAMT = 'CPFTRI'
00391 CALL CPFTRI( CFORM, UPLO, N, ARFINV , INFO )
00392
00393 SRNAMT = 'CTFTTR'
00394 CALL CTFTTR( CFORM, UPLO, N, ARFINV, AINV, LDA,
00395 + INFO )
00396
00397
00398
00399 IF( INFO.NE.0 )
00400 + CALL ALAERH( 'CPO', 'CPFTRI', INFO, 0, UPLO, N,
00401 + N, -1, -1, -1, IMAT, NFAIL, NERRS,
00402 + NOUT )
00403
00404 CALL CPOT03( UPLO, N, A, LDA, AINV, LDA,
00405 + C_WORK_CPOT03, LDA, S_WORK_CPOT03,
00406 + RCONDC, RESULT( 2 ) )
00407
00408
00409
00410 CALL CLACPY( 'Full', N, NRHS, B, LDA,
00411 + C_WORK_CPOT02, LDA )
00412 CALL CPOT02( UPLO, N, NRHS, A, LDA, X, LDA,
00413 + C_WORK_CPOT02, LDA, S_WORK_CPOT02,
00414 + RESULT( 3 ) )
00415
00416
00417
00418 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00419 + RESULT( 4 ) )
00420 NT = 4
00421
00422
00423
00424
00425 DO 60 K = 1, NT
00426 IF( RESULT( K ).GE.THRESH ) THEN
00427 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00428 + CALL ALADHD( NOUT, 'CPF' )
00429 WRITE( NOUT, FMT = 9999 )'CPFSV ', UPLO,
00430 + N, IIT, K, RESULT( K )
00431 NFAIL = NFAIL + 1
00432 END IF
00433 60 CONTINUE
00434 NRUN = NRUN + NT
00435 100 CONTINUE
00436 110 CONTINUE
00437 120 CONTINUE
00438 980 CONTINUE
00439 130 CONTINUE
00440
00441
00442
00443 CALL ALASVM( 'CPF', NOUT, NFAIL, NRUN, NERRS )
00444
00445 9999 FORMAT( 1X, A6, ', UPLO=''', A1, ''', N =', I5, ', type ', I1,
00446 + ', test(', I1, ')=', G12.5 )
00447
00448 RETURN
00449
00450
00451
00452 END