You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

zdrvrfp.f 20 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. *> \brief \b ZDRVRFP
  2. *
  3. * =========== DOCUMENTATION ===========
  4. *
  5. * Online html documentation available at
  6. * http://www.netlib.org/lapack/explore-html/
  7. *
  8. * Definition:
  9. * ===========
  10. *
  11. * SUBROUTINE ZDRVRFP( NOUT, NN, NVAL, NNS, NSVAL, NNT, NTVAL,
  12. * + THRESH, A, ASAV, AFAC, AINV, B,
  13. * + BSAV, XACT, X, ARF, ARFINV,
  14. * + Z_WORK_ZLATMS, Z_WORK_ZPOT02,
  15. * + Z_WORK_ZPOT03, D_WORK_ZLATMS, D_WORK_ZLANHE,
  16. * + D_WORK_ZPOT01, D_WORK_ZPOT02, D_WORK_ZPOT03 )
  17. *
  18. * .. Scalar Arguments ..
  19. * INTEGER NN, NNS, NNT, NOUT
  20. * DOUBLE PRECISION THRESH
  21. * ..
  22. * .. Array Arguments ..
  23. * INTEGER NVAL( NN ), NSVAL( NNS ), NTVAL( NNT )
  24. * COMPLEX*16 A( * )
  25. * COMPLEX*16 AINV( * )
  26. * COMPLEX*16 ASAV( * )
  27. * COMPLEX*16 B( * )
  28. * COMPLEX*16 BSAV( * )
  29. * COMPLEX*16 AFAC( * )
  30. * COMPLEX*16 ARF( * )
  31. * COMPLEX*16 ARFINV( * )
  32. * COMPLEX*16 XACT( * )
  33. * COMPLEX*16 X( * )
  34. * COMPLEX*16 Z_WORK_ZLATMS( * )
  35. * COMPLEX*16 Z_WORK_ZPOT02( * )
  36. * COMPLEX*16 Z_WORK_ZPOT03( * )
  37. * DOUBLE PRECISION D_WORK_ZLATMS( * )
  38. * DOUBLE PRECISION D_WORK_ZLANHE( * )
  39. * DOUBLE PRECISION D_WORK_ZPOT01( * )
  40. * DOUBLE PRECISION D_WORK_ZPOT02( * )
  41. * DOUBLE PRECISION D_WORK_ZPOT03( * )
  42. * ..
  43. *
  44. *
  45. *> \par Purpose:
  46. * =============
  47. *>
  48. *> \verbatim
  49. *>
  50. *> ZDRVRFP tests the LAPACK RFP routines:
  51. *> ZPFTRF, ZPFTRS, and ZPFTRI.
  52. *>
  53. *> This testing routine follow the same tests as ZDRVPO (test for the full
  54. *> format Symmetric Positive Definite solver).
  55. *>
  56. *> The tests are performed in Full Format, conversion back and forth from
  57. *> full format to RFP format are performed using the routines ZTRTTF and
  58. *> ZTFTTR.
  59. *>
  60. *> First, a specific matrix A of size N is created. There is nine types of
  61. *> different matrixes possible.
  62. *> 1. Diagonal 6. Random, CNDNUM = sqrt(0.1/EPS)
  63. *> 2. Random, CNDNUM = 2 7. Random, CNDNUM = 0.1/EPS
  64. *> *3. First row and column zero 8. Scaled near underflow
  65. *> *4. Last row and column zero 9. Scaled near overflow
  66. *> *5. Middle row and column zero
  67. *> (* - tests error exits from ZPFTRF, no test ratios are computed)
  68. *> A solution XACT of size N-by-NRHS is created and the associated right
  69. *> hand side B as well. Then ZPFTRF is called to compute L (or U), the
  70. *> Cholesky factor of A. Then L (or U) is used to solve the linear system
  71. *> of equations AX = B. This gives X. Then L (or U) is used to compute the
  72. *> inverse of A, AINV. The following four tests are then performed:
  73. *> (1) norm( L*L' - A ) / ( N * norm(A) * EPS ) or
  74. *> norm( U'*U - A ) / ( N * norm(A) * EPS ),
  75. *> (2) norm(B - A*X) / ( norm(A) * norm(X) * EPS ),
  76. *> (3) norm( I - A*AINV ) / ( N * norm(A) * norm(AINV) * EPS ),
  77. *> (4) ( norm(X-XACT) * RCOND ) / ( norm(XACT) * EPS ),
  78. *> where EPS is the machine precision, RCOND the condition number of A, and
  79. *> norm( . ) the 1-norm for (1,2,3) and the inf-norm for (4).
  80. *> Errors occur when INFO parameter is not as expected. Failures occur when
  81. *> a test ratios is greater than THRES.
  82. *> \endverbatim
  83. *
  84. * Arguments:
  85. * ==========
  86. *
  87. *> \param[in] NOUT
  88. *> \verbatim
  89. *> NOUT is INTEGER
  90. *> The unit number for output.
  91. *> \endverbatim
  92. *>
  93. *> \param[in] NN
  94. *> \verbatim
  95. *> NN is INTEGER
  96. *> The number of values of N contained in the vector NVAL.
  97. *> \endverbatim
  98. *>
  99. *> \param[in] NVAL
  100. *> \verbatim
  101. *> NVAL is INTEGER array, dimension (NN)
  102. *> The values of the matrix dimension N.
  103. *> \endverbatim
  104. *>
  105. *> \param[in] NNS
  106. *> \verbatim
  107. *> NNS is INTEGER
  108. *> The number of values of NRHS contained in the vector NSVAL.
  109. *> \endverbatim
  110. *>
  111. *> \param[in] NSVAL
  112. *> \verbatim
  113. *> NSVAL is INTEGER array, dimension (NNS)
  114. *> The values of the number of right-hand sides NRHS.
  115. *> \endverbatim
  116. *>
  117. *> \param[in] NNT
  118. *> \verbatim
  119. *> NNT is INTEGER
  120. *> The number of values of MATRIX TYPE contained in the vector NTVAL.
  121. *> \endverbatim
  122. *>
  123. *> \param[in] NTVAL
  124. *> \verbatim
  125. *> NTVAL is INTEGER array, dimension (NNT)
  126. *> The values of matrix type (between 0 and 9 for PO/PP/PF matrices).
  127. *> \endverbatim
  128. *>
  129. *> \param[in] THRESH
  130. *> \verbatim
  131. *> THRESH is DOUBLE PRECISION
  132. *> The threshold value for the test ratios. A result is
  133. *> included in the output file if RESULT >= THRESH. To have
  134. *> every test ratio printed, use THRESH = 0.
  135. *> \endverbatim
  136. *>
  137. *> \param[out] A
  138. *> \verbatim
  139. *> A is COMPLEX*16 array, dimension (NMAX*NMAX)
  140. *> \endverbatim
  141. *>
  142. *> \param[out] ASAV
  143. *> \verbatim
  144. *> ASAV is COMPLEX*16 array, dimension (NMAX*NMAX)
  145. *> \endverbatim
  146. *>
  147. *> \param[out] AFAC
  148. *> \verbatim
  149. *> AFAC is COMPLEX*16 array, dimension (NMAX*NMAX)
  150. *> \endverbatim
  151. *>
  152. *> \param[out] AINV
  153. *> \verbatim
  154. *> AINV is COMPLEX*16 array, dimension (NMAX*NMAX)
  155. *> \endverbatim
  156. *>
  157. *> \param[out] B
  158. *> \verbatim
  159. *> B is COMPLEX*16 array, dimension (NMAX*MAXRHS)
  160. *> \endverbatim
  161. *>
  162. *> \param[out] BSAV
  163. *> \verbatim
  164. *> BSAV is COMPLEX*16 array, dimension (NMAX*MAXRHS)
  165. *> \endverbatim
  166. *>
  167. *> \param[out] XACT
  168. *> \verbatim
  169. *> XACT is COMPLEX*16 array, dimension (NMAX*MAXRHS)
  170. *> \endverbatim
  171. *>
  172. *> \param[out] X
  173. *> \verbatim
  174. *> X is COMPLEX*16 array, dimension (NMAX*MAXRHS)
  175. *> \endverbatim
  176. *>
  177. *> \param[out] ARF
  178. *> \verbatim
  179. *> ARF is COMPLEX*16 array, dimension ((NMAX*(NMAX+1))/2)
  180. *> \endverbatim
  181. *>
  182. *> \param[out] ARFINV
  183. *> \verbatim
  184. *> ARFINV is COMPLEX*16 array, dimension ((NMAX*(NMAX+1))/2)
  185. *> \endverbatim
  186. *>
  187. *> \param[out] Z_WORK_ZLATMS
  188. *> \verbatim
  189. *> Z_WORK_ZLATMS is COMPLEX*16 array, dimension ( 3*NMAX )
  190. *> \endverbatim
  191. *>
  192. *> \param[out] Z_WORK_ZPOT02
  193. *> \verbatim
  194. *> Z_WORK_ZPOT02 is COMPLEX*16 array, dimension ( NMAX*MAXRHS )
  195. *> \endverbatim
  196. *>
  197. *> \param[out] Z_WORK_ZPOT03
  198. *> \verbatim
  199. *> Z_WORK_ZPOT03 is COMPLEX*16 array, dimension ( NMAX*NMAX )
  200. *> \endverbatim
  201. *>
  202. *> \param[out] D_WORK_ZLATMS
  203. *> \verbatim
  204. *> D_WORK_ZLATMS is DOUBLE PRECISION array, dimension ( NMAX )
  205. *> \endverbatim
  206. *>
  207. *> \param[out] D_WORK_ZLANHE
  208. *> \verbatim
  209. *> D_WORK_ZLANHE is DOUBLE PRECISION array, dimension ( NMAX )
  210. *> \endverbatim
  211. *>
  212. *> \param[out] D_WORK_ZPOT01
  213. *> \verbatim
  214. *> D_WORK_ZPOT01 is DOUBLE PRECISION array, dimension ( NMAX )
  215. *> \endverbatim
  216. *>
  217. *> \param[out] D_WORK_ZPOT02
  218. *> \verbatim
  219. *> D_WORK_ZPOT02 is DOUBLE PRECISION array, dimension ( NMAX )
  220. *> \endverbatim
  221. *>
  222. *> \param[out] D_WORK_ZPOT03
  223. *> \verbatim
  224. *> D_WORK_ZPOT03 is DOUBLE PRECISION array, dimension ( NMAX )
  225. *> \endverbatim
  226. *
  227. * Authors:
  228. * ========
  229. *
  230. *> \author Univ. of Tennessee
  231. *> \author Univ. of California Berkeley
  232. *> \author Univ. of Colorado Denver
  233. *> \author NAG Ltd.
  234. *
  235. *> \date December 2016
  236. *
  237. *> \ingroup complex16_lin
  238. *
  239. * =====================================================================
  240. SUBROUTINE ZDRVRFP( NOUT, NN, NVAL, NNS, NSVAL, NNT, NTVAL,
  241. + THRESH, A, ASAV, AFAC, AINV, B,
  242. + BSAV, XACT, X, ARF, ARFINV,
  243. + Z_WORK_ZLATMS, Z_WORK_ZPOT02,
  244. + Z_WORK_ZPOT03, D_WORK_ZLATMS, D_WORK_ZLANHE,
  245. + D_WORK_ZPOT01, D_WORK_ZPOT02, D_WORK_ZPOT03 )
  246. *
  247. * -- LAPACK test routine (version 3.7.0) --
  248. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  249. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  250. * December 2016
  251. *
  252. * .. Scalar Arguments ..
  253. INTEGER NN, NNS, NNT, NOUT
  254. DOUBLE PRECISION THRESH
  255. * ..
  256. * .. Array Arguments ..
  257. INTEGER NVAL( NN ), NSVAL( NNS ), NTVAL( NNT )
  258. COMPLEX*16 A( * )
  259. COMPLEX*16 AINV( * )
  260. COMPLEX*16 ASAV( * )
  261. COMPLEX*16 B( * )
  262. COMPLEX*16 BSAV( * )
  263. COMPLEX*16 AFAC( * )
  264. COMPLEX*16 ARF( * )
  265. COMPLEX*16 ARFINV( * )
  266. COMPLEX*16 XACT( * )
  267. COMPLEX*16 X( * )
  268. COMPLEX*16 Z_WORK_ZLATMS( * )
  269. COMPLEX*16 Z_WORK_ZPOT02( * )
  270. COMPLEX*16 Z_WORK_ZPOT03( * )
  271. DOUBLE PRECISION D_WORK_ZLATMS( * )
  272. DOUBLE PRECISION D_WORK_ZLANHE( * )
  273. DOUBLE PRECISION D_WORK_ZPOT01( * )
  274. DOUBLE PRECISION D_WORK_ZPOT02( * )
  275. DOUBLE PRECISION D_WORK_ZPOT03( * )
  276. * ..
  277. *
  278. * =====================================================================
  279. *
  280. * .. Parameters ..
  281. DOUBLE PRECISION ONE, ZERO
  282. PARAMETER ( ONE = 1.0D+0, ZERO = 0.0D+0 )
  283. INTEGER NTESTS
  284. PARAMETER ( NTESTS = 4 )
  285. * ..
  286. * .. Local Scalars ..
  287. LOGICAL ZEROT
  288. INTEGER I, INFO, IUPLO, LDA, LDB, IMAT, NERRS, NFAIL,
  289. + NRHS, NRUN, IZERO, IOFF, K, NT, N, IFORM, IIN,
  290. + IIT, IIS
  291. CHARACTER DIST, CTYPE, UPLO, CFORM
  292. INTEGER KL, KU, MODE
  293. DOUBLE PRECISION ANORM, AINVNM, CNDNUM, RCONDC
  294. * ..
  295. * .. Local Arrays ..
  296. CHARACTER UPLOS( 2 ), FORMS( 2 )
  297. INTEGER ISEED( 4 ), ISEEDY( 4 )
  298. DOUBLE PRECISION RESULT( NTESTS )
  299. * ..
  300. * .. External Functions ..
  301. DOUBLE PRECISION ZLANHE
  302. EXTERNAL ZLANHE
  303. * ..
  304. * .. External Subroutines ..
  305. EXTERNAL ALADHD, ALAERH, ALASVM, ZGET04, ZTFTTR, ZLACPY,
  306. + ZLAIPD, ZLARHS, ZLATB4, ZLATMS, ZPFTRI, ZPFTRF,
  307. + ZPFTRS, ZPOT01, ZPOT02, ZPOT03, ZPOTRI, ZPOTRF,
  308. + ZTRTTF
  309. * ..
  310. * .. Scalars in Common ..
  311. CHARACTER*32 SRNAMT
  312. * ..
  313. * .. Common blocks ..
  314. COMMON / SRNAMC / SRNAMT
  315. * ..
  316. * .. Data statements ..
  317. DATA ISEEDY / 1988, 1989, 1990, 1991 /
  318. DATA UPLOS / 'U', 'L' /
  319. DATA FORMS / 'N', 'C' /
  320. * ..
  321. * .. Executable Statements ..
  322. *
  323. * Initialize constants and the random number seed.
  324. *
  325. NRUN = 0
  326. NFAIL = 0
  327. NERRS = 0
  328. DO 10 I = 1, 4
  329. ISEED( I ) = ISEEDY( I )
  330. 10 CONTINUE
  331. *
  332. DO 130 IIN = 1, NN
  333. *
  334. N = NVAL( IIN )
  335. LDA = MAX( N, 1 )
  336. LDB = MAX( N, 1 )
  337. *
  338. DO 980 IIS = 1, NNS
  339. *
  340. NRHS = NSVAL( IIS )
  341. *
  342. DO 120 IIT = 1, NNT
  343. *
  344. IMAT = NTVAL( IIT )
  345. *
  346. * If N.EQ.0, only consider the first type
  347. *
  348. IF( N.EQ.0 .AND. IIT.GE.1 ) GO TO 120
  349. *
  350. * Skip types 3, 4, or 5 if the matrix size is too small.
  351. *
  352. IF( IMAT.EQ.4 .AND. N.LE.1 ) GO TO 120
  353. IF( IMAT.EQ.5 .AND. N.LE.2 ) GO TO 120
  354. *
  355. * Do first for UPLO = 'U', then for UPLO = 'L'
  356. *
  357. DO 110 IUPLO = 1, 2
  358. UPLO = UPLOS( IUPLO )
  359. *
  360. * Do first for CFORM = 'N', then for CFORM = 'C'
  361. *
  362. DO 100 IFORM = 1, 2
  363. CFORM = FORMS( IFORM )
  364. *
  365. * Set up parameters with ZLATB4 and generate a test
  366. * matrix with ZLATMS.
  367. *
  368. CALL ZLATB4( 'ZPO', IMAT, N, N, CTYPE, KL, KU,
  369. + ANORM, MODE, CNDNUM, DIST )
  370. *
  371. SRNAMT = 'ZLATMS'
  372. CALL ZLATMS( N, N, DIST, ISEED, CTYPE,
  373. + D_WORK_ZLATMS,
  374. + MODE, CNDNUM, ANORM, KL, KU, UPLO, A,
  375. + LDA, Z_WORK_ZLATMS, INFO )
  376. *
  377. * Check error code from ZLATMS.
  378. *
  379. IF( INFO.NE.0 ) THEN
  380. CALL ALAERH( 'ZPF', 'ZLATMS', INFO, 0, UPLO, N,
  381. + N, -1, -1, -1, IIT, NFAIL, NERRS,
  382. + NOUT )
  383. GO TO 100
  384. END IF
  385. *
  386. * For types 3-5, zero one row and column of the matrix to
  387. * test that INFO is returned correctly.
  388. *
  389. ZEROT = IMAT.GE.3 .AND. IMAT.LE.5
  390. IF( ZEROT ) THEN
  391. IF( IIT.EQ.3 ) THEN
  392. IZERO = 1
  393. ELSE IF( IIT.EQ.4 ) THEN
  394. IZERO = N
  395. ELSE
  396. IZERO = N / 2 + 1
  397. END IF
  398. IOFF = ( IZERO-1 )*LDA
  399. *
  400. * Set row and column IZERO of A to 0.
  401. *
  402. IF( IUPLO.EQ.1 ) THEN
  403. DO 20 I = 1, IZERO - 1
  404. A( IOFF+I ) = ZERO
  405. 20 CONTINUE
  406. IOFF = IOFF + IZERO
  407. DO 30 I = IZERO, N
  408. A( IOFF ) = ZERO
  409. IOFF = IOFF + LDA
  410. 30 CONTINUE
  411. ELSE
  412. IOFF = IZERO
  413. DO 40 I = 1, IZERO - 1
  414. A( IOFF ) = ZERO
  415. IOFF = IOFF + LDA
  416. 40 CONTINUE
  417. IOFF = IOFF - IZERO
  418. DO 50 I = IZERO, N
  419. A( IOFF+I ) = ZERO
  420. 50 CONTINUE
  421. END IF
  422. ELSE
  423. IZERO = 0
  424. END IF
  425. *
  426. * Set the imaginary part of the diagonals.
  427. *
  428. CALL ZLAIPD( N, A, LDA+1, 0 )
  429. *
  430. * Save a copy of the matrix A in ASAV.
  431. *
  432. CALL ZLACPY( UPLO, N, N, A, LDA, ASAV, LDA )
  433. *
  434. * Compute the condition number of A (RCONDC).
  435. *
  436. IF( ZEROT ) THEN
  437. RCONDC = ZERO
  438. ELSE
  439. *
  440. * Compute the 1-norm of A.
  441. *
  442. ANORM = ZLANHE( '1', UPLO, N, A, LDA,
  443. + D_WORK_ZLANHE )
  444. *
  445. * Factor the matrix A.
  446. *
  447. CALL ZPOTRF( UPLO, N, A, LDA, INFO )
  448. *
  449. * Form the inverse of A.
  450. *
  451. CALL ZPOTRI( UPLO, N, A, LDA, INFO )
  452. IF ( N .NE. 0 ) THEN
  453. *
  454. * Compute the 1-norm condition number of A.
  455. *
  456. AINVNM = ZLANHE( '1', UPLO, N, A, LDA,
  457. + D_WORK_ZLANHE )
  458. RCONDC = ( ONE / ANORM ) / AINVNM
  459. *
  460. * Restore the matrix A.
  461. *
  462. CALL ZLACPY( UPLO, N, N, ASAV, LDA, A, LDA )
  463. END IF
  464. *
  465. END IF
  466. *
  467. * Form an exact solution and set the right hand side.
  468. *
  469. SRNAMT = 'ZLARHS'
  470. CALL ZLARHS( 'ZPO', 'N', UPLO, ' ', N, N, KL, KU,
  471. + NRHS, A, LDA, XACT, LDA, B, LDA,
  472. + ISEED, INFO )
  473. CALL ZLACPY( 'Full', N, NRHS, B, LDA, BSAV, LDA )
  474. *
  475. * Compute the L*L' or U'*U factorization of the
  476. * matrix and solve the system.
  477. *
  478. CALL ZLACPY( UPLO, N, N, A, LDA, AFAC, LDA )
  479. CALL ZLACPY( 'Full', N, NRHS, B, LDB, X, LDB )
  480. *
  481. SRNAMT = 'ZTRTTF'
  482. CALL ZTRTTF( CFORM, UPLO, N, AFAC, LDA, ARF, INFO )
  483. SRNAMT = 'ZPFTRF'
  484. CALL ZPFTRF( CFORM, UPLO, N, ARF, INFO )
  485. *
  486. * Check error code from ZPFTRF.
  487. *
  488. IF( INFO.NE.IZERO ) THEN
  489. *
  490. * LANGOU: there is a small hick here: IZERO should
  491. * always be INFO however if INFO is ZERO, ALAERH does not
  492. * complain.
  493. *
  494. CALL ALAERH( 'ZPF', 'ZPFSV ', INFO, IZERO,
  495. + UPLO, N, N, -1, -1, NRHS, IIT,
  496. + NFAIL, NERRS, NOUT )
  497. GO TO 100
  498. END IF
  499. *
  500. * Skip the tests if INFO is not 0.
  501. *
  502. IF( INFO.NE.0 ) THEN
  503. GO TO 100
  504. END IF
  505. *
  506. SRNAMT = 'ZPFTRS'
  507. CALL ZPFTRS( CFORM, UPLO, N, NRHS, ARF, X, LDB,
  508. + INFO )
  509. *
  510. SRNAMT = 'ZTFTTR'
  511. CALL ZTFTTR( CFORM, UPLO, N, ARF, AFAC, LDA, INFO )
  512. *
  513. * Reconstruct matrix from factors and compute
  514. * residual.
  515. *
  516. CALL ZLACPY( UPLO, N, N, AFAC, LDA, ASAV, LDA )
  517. CALL ZPOT01( UPLO, N, A, LDA, AFAC, LDA,
  518. + D_WORK_ZPOT01, RESULT( 1 ) )
  519. CALL ZLACPY( UPLO, N, N, ASAV, LDA, AFAC, LDA )
  520. *
  521. * Form the inverse and compute the residual.
  522. *
  523. IF(MOD(N,2).EQ.0)THEN
  524. CALL ZLACPY( 'A', N+1, N/2, ARF, N+1, ARFINV,
  525. + N+1 )
  526. ELSE
  527. CALL ZLACPY( 'A', N, (N+1)/2, ARF, N, ARFINV,
  528. + N )
  529. END IF
  530. *
  531. SRNAMT = 'ZPFTRI'
  532. CALL ZPFTRI( CFORM, UPLO, N, ARFINV , INFO )
  533. *
  534. SRNAMT = 'ZTFTTR'
  535. CALL ZTFTTR( CFORM, UPLO, N, ARFINV, AINV, LDA,
  536. + INFO )
  537. *
  538. * Check error code from ZPFTRI.
  539. *
  540. IF( INFO.NE.0 )
  541. + CALL ALAERH( 'ZPO', 'ZPFTRI', INFO, 0, UPLO, N,
  542. + N, -1, -1, -1, IMAT, NFAIL, NERRS,
  543. + NOUT )
  544. *
  545. CALL ZPOT03( UPLO, N, A, LDA, AINV, LDA,
  546. + Z_WORK_ZPOT03, LDA, D_WORK_ZPOT03,
  547. + RCONDC, RESULT( 2 ) )
  548. *
  549. * Compute residual of the computed solution.
  550. *
  551. CALL ZLACPY( 'Full', N, NRHS, B, LDA,
  552. + Z_WORK_ZPOT02, LDA )
  553. CALL ZPOT02( UPLO, N, NRHS, A, LDA, X, LDA,
  554. + Z_WORK_ZPOT02, LDA, D_WORK_ZPOT02,
  555. + RESULT( 3 ) )
  556. *
  557. * Check solution from generated exact solution.
  558. *
  559. CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
  560. + RESULT( 4 ) )
  561. NT = 4
  562. *
  563. * Print information about the tests that did not
  564. * pass the threshold.
  565. *
  566. DO 60 K = 1, NT
  567. IF( RESULT( K ).GE.THRESH ) THEN
  568. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  569. + CALL ALADHD( NOUT, 'ZPF' )
  570. WRITE( NOUT, FMT = 9999 )'ZPFSV ', UPLO,
  571. + N, IIT, K, RESULT( K )
  572. NFAIL = NFAIL + 1
  573. END IF
  574. 60 CONTINUE
  575. NRUN = NRUN + NT
  576. 100 CONTINUE
  577. 110 CONTINUE
  578. 120 CONTINUE
  579. 980 CONTINUE
  580. 130 CONTINUE
  581. *
  582. * Print a summary of the results.
  583. *
  584. CALL ALASVM( 'ZPF', NOUT, NFAIL, NRUN, NERRS )
  585. *
  586. 9999 FORMAT( 1X, A6, ', UPLO=''', A1, ''', N =', I5, ', type ', I1,
  587. + ', test(', I1, ')=', G12.5 )
  588. *
  589. RETURN
  590. *
  591. * End of ZDRVRFP
  592. *
  593. END