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.

zchkhe.f 22 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670
  1. *> \brief \b ZCHKHE
  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 ZCHKHE( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
  12. * THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X,
  13. * XACT, WORK, RWORK, IWORK, NOUT )
  14. *
  15. * .. Scalar Arguments ..
  16. * LOGICAL TSTERR
  17. * INTEGER NMAX, NN, NNB, NNS, NOUT
  18. * DOUBLE PRECISION THRESH
  19. * ..
  20. * .. Array Arguments ..
  21. * LOGICAL DOTYPE( * )
  22. * INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
  23. * DOUBLE PRECISION RWORK( * )
  24. * COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ),
  25. * $ WORK( * ), X( * ), XACT( * )
  26. * ..
  27. *
  28. *
  29. *> \par Purpose:
  30. * =============
  31. *>
  32. *> \verbatim
  33. *>
  34. *> ZCHKHE tests ZHETRF, -TRI2, -TRS, -TRS2, -RFS, and -CON.
  35. *> \endverbatim
  36. *
  37. * Arguments:
  38. * ==========
  39. *
  40. *> \param[in] DOTYPE
  41. *> \verbatim
  42. *> DOTYPE is LOGICAL array, dimension (NTYPES)
  43. *> The matrix types to be used for testing. Matrices of type j
  44. *> (for 1 <= j <= NTYPES) are used for testing if DOTYPE(j) =
  45. *> .TRUE.; if DOTYPE(j) = .FALSE., then type j is not used.
  46. *> \endverbatim
  47. *>
  48. *> \param[in] NN
  49. *> \verbatim
  50. *> NN is INTEGER
  51. *> The number of values of N contained in the vector NVAL.
  52. *> \endverbatim
  53. *>
  54. *> \param[in] NVAL
  55. *> \verbatim
  56. *> NVAL is INTEGER array, dimension (NN)
  57. *> The values of the matrix dimension N.
  58. *> \endverbatim
  59. *>
  60. *> \param[in] NNB
  61. *> \verbatim
  62. *> NNB is INTEGER
  63. *> The number of values of NB contained in the vector NBVAL.
  64. *> \endverbatim
  65. *>
  66. *> \param[in] NBVAL
  67. *> \verbatim
  68. *> NBVAL is INTEGER array, dimension (NBVAL)
  69. *> The values of the blocksize NB.
  70. *> \endverbatim
  71. *>
  72. *> \param[in] NNS
  73. *> \verbatim
  74. *> NNS is INTEGER
  75. *> The number of values of NRHS contained in the vector NSVAL.
  76. *> \endverbatim
  77. *>
  78. *> \param[in] NSVAL
  79. *> \verbatim
  80. *> NSVAL is INTEGER array, dimension (NNS)
  81. *> The values of the number of right hand sides NRHS.
  82. *> \endverbatim
  83. *>
  84. *> \param[in] THRESH
  85. *> \verbatim
  86. *> THRESH is DOUBLE PRECISION
  87. *> The threshold value for the test ratios. A result is
  88. *> included in the output file if RESULT >= THRESH. To have
  89. *> every test ratio printed, use THRESH = 0.
  90. *> \endverbatim
  91. *>
  92. *> \param[in] TSTERR
  93. *> \verbatim
  94. *> TSTERR is LOGICAL
  95. *> Flag that indicates whether error exits are to be tested.
  96. *> \endverbatim
  97. *>
  98. *> \param[in] NMAX
  99. *> \verbatim
  100. *> NMAX is INTEGER
  101. *> The maximum value permitted for N, used in dimensioning the
  102. *> work arrays.
  103. *> \endverbatim
  104. *>
  105. *> \param[out] A
  106. *> \verbatim
  107. *> A is COMPLEX*16 array, dimension (NMAX*NMAX)
  108. *> \endverbatim
  109. *>
  110. *> \param[out] AFAC
  111. *> \verbatim
  112. *> AFAC is COMPLEX*16 array, dimension (NMAX*NMAX)
  113. *> \endverbatim
  114. *>
  115. *> \param[out] AINV
  116. *> \verbatim
  117. *> AINV is COMPLEX*16 array, dimension (NMAX*NMAX)
  118. *> \endverbatim
  119. *>
  120. *> \param[out] B
  121. *> \verbatim
  122. *> B is COMPLEX*16 array, dimension (NMAX*NSMAX)
  123. *> where NSMAX is the largest entry in NSVAL.
  124. *> \endverbatim
  125. *>
  126. *> \param[out] X
  127. *> \verbatim
  128. *> X is COMPLEX*16 array, dimension (NMAX*NSMAX)
  129. *> \endverbatim
  130. *>
  131. *> \param[out] XACT
  132. *> \verbatim
  133. *> XACT is COMPLEX*16 array, dimension (NMAX*NSMAX)
  134. *> \endverbatim
  135. *>
  136. *> \param[out] WORK
  137. *> \verbatim
  138. *> WORK is COMPLEX*16 array, dimension (NMAX*max(3,NSMAX))
  139. *> \endverbatim
  140. *>
  141. *> \param[out] RWORK
  142. *> \verbatim
  143. *> RWORK is DOUBLE PRECISION array, dimension (max(NMAX,2*NSMAX))
  144. *> \endverbatim
  145. *>
  146. *> \param[out] IWORK
  147. *> \verbatim
  148. *> IWORK is INTEGER array, dimension (NMAX)
  149. *> \endverbatim
  150. *>
  151. *> \param[in] NOUT
  152. *> \verbatim
  153. *> NOUT is INTEGER
  154. *> The unit number for output.
  155. *> \endverbatim
  156. *
  157. * Authors:
  158. * ========
  159. *
  160. *> \author Univ. of Tennessee
  161. *> \author Univ. of California Berkeley
  162. *> \author Univ. of Colorado Denver
  163. *> \author NAG Ltd.
  164. *
  165. *> \date November 2013
  166. *
  167. *> \ingroup complex16_lin
  168. *
  169. * =====================================================================
  170. SUBROUTINE ZCHKHE( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
  171. $ THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X,
  172. $ XACT, WORK, RWORK, IWORK, NOUT )
  173. *
  174. * -- LAPACK test routine (version 3.5.0) --
  175. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  176. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  177. * November 2013
  178. *
  179. * .. Scalar Arguments ..
  180. LOGICAL TSTERR
  181. INTEGER NMAX, NN, NNB, NNS, NOUT
  182. DOUBLE PRECISION THRESH
  183. * ..
  184. * .. Array Arguments ..
  185. LOGICAL DOTYPE( * )
  186. INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
  187. DOUBLE PRECISION RWORK( * )
  188. COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ),
  189. $ WORK( * ), X( * ), XACT( * )
  190. * ..
  191. *
  192. * =====================================================================
  193. *
  194. * .. Parameters ..
  195. DOUBLE PRECISION ZERO
  196. PARAMETER ( ZERO = 0.0D+0 )
  197. COMPLEX*16 CZERO
  198. PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ) )
  199. INTEGER NTYPES
  200. PARAMETER ( NTYPES = 10 )
  201. INTEGER NTESTS
  202. PARAMETER ( NTESTS = 9 )
  203. * ..
  204. * .. Local Scalars ..
  205. LOGICAL TRFCON, ZEROT
  206. CHARACTER DIST, TYPE, UPLO, XTYPE
  207. CHARACTER*3 PATH
  208. INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
  209. $ IUPLO, IZERO, J, K, KL, KU, LDA, LWORK, MODE,
  210. $ N, NB, NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
  211. DOUBLE PRECISION ANORM, CNDNUM, RCOND, RCONDC
  212. * ..
  213. * .. Local Arrays ..
  214. CHARACTER UPLOS( 2 )
  215. INTEGER ISEED( 4 ), ISEEDY( 4 )
  216. DOUBLE PRECISION RESULT( NTESTS )
  217. * ..
  218. * .. External Functions ..
  219. DOUBLE PRECISION DGET06, ZLANHE
  220. EXTERNAL DGET06, ZLANHE
  221. * ..
  222. * .. External Subroutines ..
  223. EXTERNAL ALAERH, ALAHD, ALASUM, XLAENV, ZERRHE, ZGET04,
  224. $ ZHECON, ZHERFS, ZHET01, ZHETRF, ZHETRI2,
  225. $ ZHETRS, ZLACPY, ZLAIPD, ZLARHS, ZLATB4, ZLATMS,
  226. $ ZPOT02, ZPOT03, ZPOT05
  227. * ..
  228. * .. Intrinsic Functions ..
  229. INTRINSIC MAX, MIN
  230. * ..
  231. * .. Scalars in Common ..
  232. LOGICAL LERR, OK
  233. CHARACTER*32 SRNAMT
  234. INTEGER INFOT, NUNIT
  235. * ..
  236. * .. Common blocks ..
  237. COMMON / INFOC / INFOT, NUNIT, OK, LERR
  238. COMMON / SRNAMC / SRNAMT
  239. * ..
  240. * .. Data statements ..
  241. DATA ISEEDY / 1988, 1989, 1990, 1991 /
  242. DATA UPLOS / 'U', 'L' /
  243. * ..
  244. * .. Executable Statements ..
  245. *
  246. * Initialize constants and the random number seed.
  247. *
  248. PATH( 1: 1 ) = 'Zomplex precision'
  249. PATH( 2: 3 ) = 'HE'
  250. NRUN = 0
  251. NFAIL = 0
  252. NERRS = 0
  253. DO 10 I = 1, 4
  254. ISEED( I ) = ISEEDY( I )
  255. 10 CONTINUE
  256. *
  257. * Test the error exits
  258. *
  259. IF( TSTERR )
  260. $ CALL ZERRHE( PATH, NOUT )
  261. INFOT = 0
  262. *
  263. * Set the minimum block size for which the block routine should
  264. * be used, which will be later returned by ILAENV
  265. *
  266. CALL XLAENV( 2, 2 )
  267. *
  268. * Do for each value of N in NVAL
  269. *
  270. DO 180 IN = 1, NN
  271. N = NVAL( IN )
  272. LDA = MAX( N, 1 )
  273. XTYPE = 'N'
  274. NIMAT = NTYPES
  275. IF( N.LE.0 )
  276. $ NIMAT = 1
  277. *
  278. IZERO = 0
  279. DO 170 IMAT = 1, NIMAT
  280. *
  281. * Do the tests only if DOTYPE( IMAT ) is true.
  282. *
  283. IF( .NOT.DOTYPE( IMAT ) )
  284. $ GO TO 170
  285. *
  286. * Skip types 3, 4, 5, or 6 if the matrix size is too small.
  287. *
  288. ZEROT = IMAT.GE.3 .AND. IMAT.LE.6
  289. IF( ZEROT .AND. N.LT.IMAT-2 )
  290. $ GO TO 170
  291. *
  292. * Do first for UPLO = 'U', then for UPLO = 'L'
  293. *
  294. DO 160 IUPLO = 1, 2
  295. UPLO = UPLOS( IUPLO )
  296. *
  297. * Set up parameters with ZLATB4 for the matrix generator
  298. * based on the type of matrix to be generated.
  299. *
  300. CALL ZLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
  301. $ CNDNUM, DIST )
  302. *
  303. * Generate a matrix with ZLATMS.
  304. *
  305. SRNAMT = 'ZLATMS'
  306. CALL ZLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE,
  307. $ CNDNUM, ANORM, KL, KU, UPLO, A, LDA, WORK,
  308. $ INFO )
  309. *
  310. * Check error code from ZLATMS and handle error.
  311. *
  312. IF( INFO.NE.0 ) THEN
  313. CALL ALAERH( PATH, 'ZLATMS', INFO, 0, UPLO, N, N, -1,
  314. $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
  315. *
  316. * Skip all tests for this generated matrix
  317. *
  318. GO TO 160
  319. END IF
  320. *
  321. * For types 3-6, zero one or more rows and columns of
  322. * the matrix to test that INFO is returned correctly.
  323. *
  324. IF( ZEROT ) THEN
  325. IF( IMAT.EQ.3 ) THEN
  326. IZERO = 1
  327. ELSE IF( IMAT.EQ.4 ) THEN
  328. IZERO = N
  329. ELSE
  330. IZERO = N / 2 + 1
  331. END IF
  332. *
  333. IF( IMAT.LT.6 ) THEN
  334. *
  335. * Set row and column IZERO to zero.
  336. *
  337. IF( IUPLO.EQ.1 ) THEN
  338. IOFF = ( IZERO-1 )*LDA
  339. DO 20 I = 1, IZERO - 1
  340. A( IOFF+I ) = CZERO
  341. 20 CONTINUE
  342. IOFF = IOFF + IZERO
  343. DO 30 I = IZERO, N
  344. A( IOFF ) = CZERO
  345. IOFF = IOFF + LDA
  346. 30 CONTINUE
  347. ELSE
  348. IOFF = IZERO
  349. DO 40 I = 1, IZERO - 1
  350. A( IOFF ) = CZERO
  351. IOFF = IOFF + LDA
  352. 40 CONTINUE
  353. IOFF = IOFF - IZERO
  354. DO 50 I = IZERO, N
  355. A( IOFF+I ) = CZERO
  356. 50 CONTINUE
  357. END IF
  358. ELSE
  359. IF( IUPLO.EQ.1 ) THEN
  360. *
  361. * Set the first IZERO rows and columns to zero.
  362. *
  363. IOFF = 0
  364. DO 70 J = 1, N
  365. I2 = MIN( J, IZERO )
  366. DO 60 I = 1, I2
  367. A( IOFF+I ) = CZERO
  368. 60 CONTINUE
  369. IOFF = IOFF + LDA
  370. 70 CONTINUE
  371. ELSE
  372. *
  373. * Set the last IZERO rows and columns to zero.
  374. *
  375. IOFF = 0
  376. DO 90 J = 1, N
  377. I1 = MAX( J, IZERO )
  378. DO 80 I = I1, N
  379. A( IOFF+I ) = CZERO
  380. 80 CONTINUE
  381. IOFF = IOFF + LDA
  382. 90 CONTINUE
  383. END IF
  384. END IF
  385. ELSE
  386. IZERO = 0
  387. END IF
  388. *
  389. * End generate test matrix A.
  390. *
  391. *
  392. * Set the imaginary part of the diagonals.
  393. *
  394. CALL ZLAIPD( N, A, LDA+1, 0 )
  395. *
  396. * Do for each value of NB in NBVAL
  397. *
  398. DO 150 INB = 1, NNB
  399. *
  400. * Set the optimal blocksize, which will be later
  401. * returned by ILAENV.
  402. *
  403. NB = NBVAL( INB )
  404. CALL XLAENV( 1, NB )
  405. *
  406. * Copy the test matrix A into matrix AFAC which
  407. * will be factorized in place. This is needed to
  408. * preserve the test matrix A for subsequent tests.
  409. *
  410. CALL ZLACPY( UPLO, N, N, A, LDA, AFAC, LDA )
  411. *
  412. * Compute the L*D*L**T or U*D*U**T factorization of the
  413. * matrix. IWORK stores details of the interchanges and
  414. * the block structure of D. AINV is a work array for
  415. * block factorization, LWORK is the length of AINV.
  416. *
  417. LWORK = MAX( 2, NB )*LDA
  418. SRNAMT = 'ZHETRF'
  419. CALL ZHETRF( UPLO, N, AFAC, LDA, IWORK, AINV, LWORK,
  420. $ INFO )
  421. *
  422. * Adjust the expected value of INFO to account for
  423. * pivoting.
  424. *
  425. K = IZERO
  426. IF( K.GT.0 ) THEN
  427. 100 CONTINUE
  428. IF( IWORK( K ).LT.0 ) THEN
  429. IF( IWORK( K ).NE.-K ) THEN
  430. K = -IWORK( K )
  431. GO TO 100
  432. END IF
  433. ELSE IF( IWORK( K ).NE.K ) THEN
  434. K = IWORK( K )
  435. GO TO 100
  436. END IF
  437. END IF
  438. *
  439. * Check error code from ZHETRF and handle error.
  440. *
  441. IF( INFO.NE.K )
  442. $ CALL ALAERH( PATH, 'ZHETRF', INFO, K, UPLO, N, N,
  443. $ -1, -1, NB, IMAT, NFAIL, NERRS, NOUT )
  444. *
  445. * Set the condition estimate flag if the INFO is not 0.
  446. *
  447. IF( INFO.NE.0 ) THEN
  448. TRFCON = .TRUE.
  449. ELSE
  450. TRFCON = .FALSE.
  451. END IF
  452. *
  453. *+ TEST 1
  454. * Reconstruct matrix from factors and compute residual.
  455. *
  456. CALL ZHET01( UPLO, N, A, LDA, AFAC, LDA, IWORK, AINV,
  457. $ LDA, RWORK, RESULT( 1 ) )
  458. NT = 1
  459. *
  460. *+ TEST 2
  461. * Form the inverse and compute the residual.
  462. *
  463. IF( INB.EQ.1 .AND. .NOT.TRFCON ) THEN
  464. CALL ZLACPY( UPLO, N, N, AFAC, LDA, AINV, LDA )
  465. SRNAMT = 'ZHETRI2'
  466. LWORK = (N+NB+1)*(NB+3)
  467. CALL ZHETRI2( UPLO, N, AINV, LDA, IWORK, WORK,
  468. $ LWORK, INFO )
  469. *
  470. * Check error code from ZHETRI and handle error.
  471. *
  472. IF( INFO.NE.0 )
  473. $ CALL ALAERH( PATH, 'ZHETRI', INFO, -1, UPLO, N,
  474. $ N, -1, -1, -1, IMAT, NFAIL, NERRS,
  475. $ NOUT )
  476. *
  477. * Compute the residual for a symmetric matrix times
  478. * its inverse.
  479. *
  480. CALL ZPOT03( UPLO, N, A, LDA, AINV, LDA, WORK, LDA,
  481. $ RWORK, RCONDC, RESULT( 2 ) )
  482. NT = 2
  483. END IF
  484. *
  485. * Print information about the tests that did not pass
  486. * the threshold.
  487. *
  488. DO 110 K = 1, NT
  489. IF( RESULT( K ).GE.THRESH ) THEN
  490. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  491. $ CALL ALAHD( NOUT, PATH )
  492. WRITE( NOUT, FMT = 9999 )UPLO, N, NB, IMAT, K,
  493. $ RESULT( K )
  494. NFAIL = NFAIL + 1
  495. END IF
  496. 110 CONTINUE
  497. NRUN = NRUN + NT
  498. *
  499. * Skip the other tests if this is not the first block
  500. * size.
  501. *
  502. IF( INB.GT.1 )
  503. $ GO TO 150
  504. *
  505. * Do only the condition estimate if INFO is not 0.
  506. *
  507. IF( TRFCON ) THEN
  508. RCONDC = ZERO
  509. GO TO 140
  510. END IF
  511. *
  512. * Do for each value of NRHS in NSVAL.
  513. *
  514. DO 130 IRHS = 1, NNS
  515. NRHS = NSVAL( IRHS )
  516. *
  517. *+ TEST 3 (Using TRS)
  518. * Solve and compute residual for A * X = B.
  519. *
  520. * Choose a set of NRHS random solution vectors
  521. * stored in XACT and set up the right hand side B
  522. *
  523. SRNAMT = 'ZLARHS'
  524. CALL ZLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
  525. $ NRHS, A, LDA, XACT, LDA, B, LDA,
  526. $ ISEED, INFO )
  527. CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
  528. *
  529. SRNAMT = 'ZHETRS'
  530. CALL ZHETRS( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
  531. $ LDA, INFO )
  532. *
  533. * Check error code from ZHETRS and handle error.
  534. *
  535. IF( INFO.NE.0 )
  536. $ CALL ALAERH( PATH, 'ZHETRS', INFO, 0, UPLO, N,
  537. $ N, -1, -1, NRHS, IMAT, NFAIL,
  538. $ NERRS, NOUT )
  539. *
  540. CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
  541. *
  542. * Compute the residual for the solution
  543. *
  544. CALL ZPOT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
  545. $ LDA, RWORK, RESULT( 3 ) )
  546. *
  547. *+ TEST 4 (Using TRS2)
  548. * Solve and compute residual for A * X = B.
  549. *
  550. * Choose a set of NRHS random solution vectors
  551. * stored in XACT and set up the right hand side B
  552. *
  553. SRNAMT = 'ZLARHS'
  554. CALL ZLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
  555. $ NRHS, A, LDA, XACT, LDA, B, LDA,
  556. $ ISEED, INFO )
  557. CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
  558. *
  559. SRNAMT = 'ZHETRS2'
  560. CALL ZHETRS2( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
  561. $ LDA, WORK, INFO )
  562. *
  563. * Check error code from ZHETRS2 and handle error.
  564. *
  565. IF( INFO.NE.0 )
  566. $ CALL ALAERH( PATH, 'ZHETRS2', INFO, 0, UPLO, N,
  567. $ N, -1, -1, NRHS, IMAT, NFAIL,
  568. $ NERRS, NOUT )
  569. *
  570. CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
  571. *
  572. * Compute the residual for the solution
  573. *
  574. CALL ZPOT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
  575. $ LDA, RWORK, RESULT( 4 ) )
  576. *
  577. *+ TEST 5
  578. * Check solution from generated exact solution.
  579. *
  580. CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
  581. $ RESULT( 5 ) )
  582. *
  583. *+ TESTS 6, 7, and 8
  584. * Use iterative refinement to improve the solution.
  585. *
  586. SRNAMT = 'ZHERFS'
  587. CALL ZHERFS( UPLO, N, NRHS, A, LDA, AFAC, LDA,
  588. $ IWORK, B, LDA, X, LDA, RWORK,
  589. $ RWORK( NRHS+1 ), WORK,
  590. $ RWORK( 2*NRHS+1 ), INFO )
  591. *
  592. * Check error code from ZHERFS.
  593. *
  594. IF( INFO.NE.0 )
  595. $ CALL ALAERH( PATH, 'ZHERFS', INFO, 0, UPLO, N,
  596. $ N, -1, -1, NRHS, IMAT, NFAIL,
  597. $ NERRS, NOUT )
  598. *
  599. CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
  600. $ RESULT( 6 ) )
  601. CALL ZPOT05( UPLO, N, NRHS, A, LDA, B, LDA, X, LDA,
  602. $ XACT, LDA, RWORK, RWORK( NRHS+1 ),
  603. $ RESULT( 7 ) )
  604. *
  605. * Print information about the tests that did not pass
  606. * the threshold.
  607. *
  608. DO 120 K = 3, 8
  609. IF( RESULT( K ).GE.THRESH ) THEN
  610. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  611. $ CALL ALAHD( NOUT, PATH )
  612. WRITE( NOUT, FMT = 9998 )UPLO, N, NRHS,
  613. $ IMAT, K, RESULT( K )
  614. NFAIL = NFAIL + 1
  615. END IF
  616. 120 CONTINUE
  617. NRUN = NRUN + 6
  618. *
  619. * End do for each value of NRHS in NSVAL.
  620. *
  621. 130 CONTINUE
  622. *
  623. *+ TEST 9
  624. * Get an estimate of RCOND = 1/CNDNUM.
  625. *
  626. 140 CONTINUE
  627. ANORM = ZLANHE( '1', UPLO, N, A, LDA, RWORK )
  628. SRNAMT = 'ZHECON'
  629. CALL ZHECON( UPLO, N, AFAC, LDA, IWORK, ANORM, RCOND,
  630. $ WORK, INFO )
  631. *
  632. * Check error code from ZHECON and handle error.
  633. *
  634. IF( INFO.NE.0 )
  635. $ CALL ALAERH( PATH, 'ZHECON', INFO, 0, UPLO, N, N,
  636. $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
  637. *
  638. RESULT( 9 ) = DGET06( RCOND, RCONDC )
  639. *
  640. * Print information about the tests that did not pass
  641. * the threshold.
  642. *
  643. IF( RESULT( 9 ).GE.THRESH ) THEN
  644. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  645. $ CALL ALAHD( NOUT, PATH )
  646. WRITE( NOUT, FMT = 9997 )UPLO, N, IMAT, 9,
  647. $ RESULT( 9 )
  648. NFAIL = NFAIL + 1
  649. END IF
  650. NRUN = NRUN + 1
  651. 150 CONTINUE
  652. 160 CONTINUE
  653. 170 CONTINUE
  654. 180 CONTINUE
  655. *
  656. * Print a summary of the results.
  657. *
  658. CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
  659. *
  660. 9999 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NB =', I4, ', type ',
  661. $ I2, ', test ', I2, ', ratio =', G12.5 )
  662. 9998 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
  663. $ I2, ', test(', I2, ') =', G12.5 )
  664. 9997 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ',', 10X, ' type ', I2,
  665. $ ', test(', I2, ') =', G12.5 )
  666. RETURN
  667. *
  668. * End of ZCHKHE
  669. *
  670. END