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