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.

zchksy.f 23 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  1. *> \brief \b ZCHKSY
  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 ZCHKSY( 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. *> ZCHKSY tests ZSYTRF, -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 (NNB)
  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(2,NSMAX))
  139. *> \endverbatim
  140. *>
  141. *> \param[out] RWORK
  142. *> \verbatim
  143. *> RWORK is DOUBLE PRECISION array, dimension (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. *> \ingroup complex16_lin
  166. *
  167. * =====================================================================
  168. SUBROUTINE ZCHKSY( DOTYPE, NN, NVAL, NNB, NBVAL, NNS, NSVAL,
  169. $ THRESH, TSTERR, NMAX, A, AFAC, AINV, B, X,
  170. $ XACT, WORK, RWORK, IWORK, NOUT )
  171. *
  172. * -- LAPACK test routine --
  173. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  174. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  175. *
  176. * .. Scalar Arguments ..
  177. LOGICAL TSTERR
  178. INTEGER NMAX, NN, NNB, NNS, NOUT
  179. DOUBLE PRECISION THRESH
  180. * ..
  181. * .. Array Arguments ..
  182. LOGICAL DOTYPE( * )
  183. INTEGER IWORK( * ), NBVAL( * ), NSVAL( * ), NVAL( * )
  184. DOUBLE PRECISION RWORK( * )
  185. COMPLEX*16 A( * ), AFAC( * ), AINV( * ), B( * ),
  186. $ WORK( * ), X( * ), XACT( * )
  187. * ..
  188. *
  189. * =====================================================================
  190. *
  191. * .. Parameters ..
  192. DOUBLE PRECISION ZERO
  193. PARAMETER ( ZERO = 0.0D+0 )
  194. COMPLEX*16 CZERO
  195. PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ) )
  196. INTEGER NTYPES
  197. PARAMETER ( NTYPES = 11 )
  198. INTEGER NTESTS
  199. PARAMETER ( NTESTS = 9 )
  200. * ..
  201. * .. Local Scalars ..
  202. LOGICAL TRFCON, ZEROT
  203. CHARACTER DIST, TYPE, UPLO, XTYPE
  204. CHARACTER*3 PATH
  205. INTEGER I, I1, I2, IMAT, IN, INB, INFO, IOFF, IRHS,
  206. $ IUPLO, IZERO, J, K, KL, KU, LDA, LWORK, MODE,
  207. $ N, NB, NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
  208. DOUBLE PRECISION ANORM, CNDNUM, RCOND, RCONDC
  209. * ..
  210. * .. Local Arrays ..
  211. CHARACTER UPLOS( 2 )
  212. INTEGER ISEED( 4 ), ISEEDY( 4 )
  213. DOUBLE PRECISION RESULT( NTESTS )
  214. * ..
  215. * .. External Functions ..
  216. DOUBLE PRECISION DGET06, ZLANSY
  217. EXTERNAL DGET06, ZLANSY
  218. * ..
  219. * .. External Subroutines ..
  220. EXTERNAL ALAERH, ALAHD, ALASUM, XLAENV, ZERRSY, ZGET04,
  221. $ ZLACPY, ZLARHS, ZLATB4, ZLATMS, ZLATSY, ZPOT05,
  222. $ ZSYCON, ZSYRFS, ZSYT01, ZSYT02, ZSYT03, ZSYTRF,
  223. $ ZSYTRI2, ZSYTRS, ZSYTRS2
  224. * ..
  225. * .. Intrinsic Functions ..
  226. INTRINSIC MAX, MIN
  227. * ..
  228. * .. Scalars in Common ..
  229. LOGICAL LERR, OK
  230. CHARACTER*32 SRNAMT
  231. INTEGER INFOT, NUNIT
  232. * ..
  233. * .. Common blocks ..
  234. COMMON / INFOC / INFOT, NUNIT, OK, LERR
  235. COMMON / SRNAMC / SRNAMT
  236. * ..
  237. * .. Data statements ..
  238. DATA ISEEDY / 1988, 1989, 1990, 1991 /
  239. DATA UPLOS / 'U', 'L' /
  240. * ..
  241. * .. Executable Statements ..
  242. *
  243. * Initialize constants and the random number seed.
  244. *
  245. PATH( 1: 1 ) = 'Zomplex precision'
  246. PATH( 2: 3 ) = 'SY'
  247. NRUN = 0
  248. NFAIL = 0
  249. NERRS = 0
  250. DO 10 I = 1, 4
  251. ISEED( I ) = ISEEDY( I )
  252. 10 CONTINUE
  253. *
  254. * Test the error exits
  255. *
  256. IF( TSTERR )
  257. $ CALL ZERRSY( PATH, NOUT )
  258. INFOT = 0
  259. *
  260. * Set the minimum block size for which the block routine should
  261. * be used, which will be later returned by ILAENV
  262. *
  263. CALL XLAENV( 2, 2 )
  264. *
  265. * Do for each value of N in NVAL
  266. *
  267. DO 180 IN = 1, NN
  268. N = NVAL( IN )
  269. LDA = MAX( N, 1 )
  270. XTYPE = 'N'
  271. NIMAT = NTYPES
  272. IF( N.LE.0 )
  273. $ NIMAT = 1
  274. *
  275. IZERO = 0
  276. *
  277. * Do for each value of matrix type IMAT
  278. *
  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. * Begin generate test matrix A.
  298. *
  299. IF( IMAT.NE.NTYPES ) THEN
  300. *
  301. * Set up parameters with ZLATB4 for the matrix generator
  302. * based on the type of matrix to be generated.
  303. *
  304. CALL ZLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM,
  305. $ MODE, CNDNUM, DIST )
  306. *
  307. * Generate a matrix with ZLATMS.
  308. *
  309. SRNAMT = 'ZLATMS'
  310. CALL ZLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE,
  311. $ CNDNUM, ANORM, KL, KU, 'N', A, LDA, WORK,
  312. $ INFO )
  313. *
  314. * Check error code from ZLATMS and handle error.
  315. *
  316. IF( INFO.NE.0 ) THEN
  317. CALL ALAERH( PATH, 'ZLATMS', INFO, 0, UPLO, N, N,
  318. $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
  319. *
  320. * Skip all tests for this generated matrix
  321. *
  322. GO TO 160
  323. END IF
  324. *
  325. * For matrix types 3-6, zero one or more rows and
  326. * columns of the matrix to test that INFO is returned
  327. * correctly.
  328. *
  329. IF( ZEROT ) THEN
  330. IF( IMAT.EQ.3 ) THEN
  331. IZERO = 1
  332. ELSE IF( IMAT.EQ.4 ) THEN
  333. IZERO = N
  334. ELSE
  335. IZERO = N / 2 + 1
  336. END IF
  337. *
  338. IF( IMAT.LT.6 ) THEN
  339. *
  340. * Set row and column IZERO to zero.
  341. *
  342. IF( IUPLO.EQ.1 ) THEN
  343. IOFF = ( IZERO-1 )*LDA
  344. DO 20 I = 1, IZERO - 1
  345. A( IOFF+I ) = CZERO
  346. 20 CONTINUE
  347. IOFF = IOFF + IZERO
  348. DO 30 I = IZERO, N
  349. A( IOFF ) = CZERO
  350. IOFF = IOFF + LDA
  351. 30 CONTINUE
  352. ELSE
  353. IOFF = IZERO
  354. DO 40 I = 1, IZERO - 1
  355. A( IOFF ) = CZERO
  356. IOFF = IOFF + LDA
  357. 40 CONTINUE
  358. IOFF = IOFF - IZERO
  359. DO 50 I = IZERO, N
  360. A( IOFF+I ) = CZERO
  361. 50 CONTINUE
  362. END IF
  363. ELSE
  364. IF( IUPLO.EQ.1 ) THEN
  365. *
  366. * Set the first IZERO rows to zero.
  367. *
  368. IOFF = 0
  369. DO 70 J = 1, N
  370. I2 = MIN( J, IZERO )
  371. DO 60 I = 1, I2
  372. A( IOFF+I ) = CZERO
  373. 60 CONTINUE
  374. IOFF = IOFF + LDA
  375. 70 CONTINUE
  376. ELSE
  377. *
  378. * Set the last IZERO rows to zero.
  379. *
  380. IOFF = 0
  381. DO 90 J = 1, N
  382. I1 = MAX( J, IZERO )
  383. DO 80 I = I1, N
  384. A( IOFF+I ) = CZERO
  385. 80 CONTINUE
  386. IOFF = IOFF + LDA
  387. 90 CONTINUE
  388. END IF
  389. END IF
  390. ELSE
  391. IZERO = 0
  392. END IF
  393. *
  394. ELSE
  395. *
  396. * For matrix kind IMAT = 11, generate special block
  397. * diagonal matrix to test alternate code
  398. * for the 2 x 2 blocks.
  399. *
  400. CALL ZLATSY( UPLO, N, A, LDA, ISEED )
  401. *
  402. END IF
  403. *
  404. * End generate test matrix A.
  405. *
  406. *
  407. * Do for each value of NB in NBVAL
  408. *
  409. DO 150 INB = 1, NNB
  410. *
  411. * Set the optimal blocksize, which will be later
  412. * returned by ILAENV.
  413. *
  414. NB = NBVAL( INB )
  415. CALL XLAENV( 1, NB )
  416. *
  417. * Copy the test matrix A into matrix AFAC which
  418. * will be factorized in place. This is needed to
  419. * preserve the test matrix A for subsequent tests.
  420. *
  421. CALL ZLACPY( UPLO, N, N, A, LDA, AFAC, LDA )
  422. *
  423. * Compute the L*D*L**T or U*D*U**T factorization of the
  424. * matrix. IWORK stores details of the interchanges and
  425. * the block structure of D. AINV is a work array for
  426. * block factorization, LWORK is the length of AINV.
  427. *
  428. LWORK = MAX( 2, NB )*LDA
  429. SRNAMT = 'ZSYTRF'
  430. CALL ZSYTRF( UPLO, N, AFAC, LDA, IWORK, AINV, LWORK,
  431. $ INFO )
  432. *
  433. * Adjust the expected value of INFO to account for
  434. * pivoting.
  435. *
  436. K = IZERO
  437. IF( K.GT.0 ) THEN
  438. 100 CONTINUE
  439. IF( IWORK( K ).LT.0 ) THEN
  440. IF( IWORK( K ).NE.-K ) THEN
  441. K = -IWORK( K )
  442. GO TO 100
  443. END IF
  444. ELSE IF( IWORK( K ).NE.K ) THEN
  445. K = IWORK( K )
  446. GO TO 100
  447. END IF
  448. END IF
  449. *
  450. * Check error code from ZSYTRF and handle error.
  451. *
  452. IF( INFO.NE.K )
  453. $ CALL ALAERH( PATH, 'ZSYTRF', INFO, K, UPLO, N, N,
  454. $ -1, -1, NB, IMAT, NFAIL, NERRS, NOUT )
  455. *
  456. * Set the condition estimate flag if the INFO is not 0.
  457. *
  458. IF( INFO.NE.0 ) THEN
  459. TRFCON = .TRUE.
  460. ELSE
  461. TRFCON = .FALSE.
  462. END IF
  463. *
  464. *+ TEST 1
  465. * Reconstruct matrix from factors and compute residual.
  466. *
  467. CALL ZSYT01( UPLO, N, A, LDA, AFAC, LDA, IWORK, AINV,
  468. $ LDA, RWORK, RESULT( 1 ) )
  469. NT = 1
  470. *
  471. *+ TEST 2
  472. * Form the inverse and compute the residual,
  473. * if the factorization was competed without INFO > 0
  474. * (i.e. there is no zero rows and columns).
  475. * Do it only for the first block size.
  476. *
  477. IF( INB.EQ.1 .AND. .NOT.TRFCON ) THEN
  478. CALL ZLACPY( UPLO, N, N, AFAC, LDA, AINV, LDA )
  479. SRNAMT = 'ZSYTRI2'
  480. LWORK = (N+NB+1)*(NB+3)
  481. CALL ZSYTRI2( UPLO, N, AINV, LDA, IWORK, WORK,
  482. $ LWORK, INFO )
  483. *
  484. * Check error code from ZSYTRI2 and handle error.
  485. *
  486. IF( INFO.NE.0 )
  487. $ CALL ALAERH( PATH, 'ZSYTRI2', INFO, 0, UPLO, N,
  488. $ N, -1, -1, -1, IMAT, NFAIL, NERRS,
  489. $ NOUT )
  490. *
  491. * Compute the residual for a symmetric matrix times
  492. * its inverse.
  493. *
  494. CALL ZSYT03( UPLO, N, A, LDA, AINV, LDA, WORK, LDA,
  495. $ RWORK, RCONDC, RESULT( 2 ) )
  496. NT = 2
  497. END IF
  498. *
  499. * Print information about the tests that did not pass
  500. * the threshold.
  501. *
  502. DO 110 K = 1, NT
  503. IF( RESULT( K ).GE.THRESH ) THEN
  504. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  505. $ CALL ALAHD( NOUT, PATH )
  506. WRITE( NOUT, FMT = 9999 )UPLO, N, NB, IMAT, K,
  507. $ RESULT( K )
  508. NFAIL = NFAIL + 1
  509. END IF
  510. 110 CONTINUE
  511. NRUN = NRUN + NT
  512. *
  513. * Skip the other tests if this is not the first block
  514. * size.
  515. *
  516. IF( INB.GT.1 )
  517. $ GO TO 150
  518. *
  519. * Do only the condition estimate if INFO is not 0.
  520. *
  521. IF( TRFCON ) THEN
  522. RCONDC = ZERO
  523. GO TO 140
  524. END IF
  525. *
  526. * Do for each value of NRHS in NSVAL.
  527. *
  528. DO 130 IRHS = 1, NNS
  529. NRHS = NSVAL( IRHS )
  530. *
  531. *+ TEST 3 (Using TRS)
  532. * Solve and compute residual for A * X = B.
  533. *
  534. * Choose a set of NRHS random solution vectors
  535. * stored in XACT and set up the right hand side B
  536. *
  537. SRNAMT = 'ZLARHS'
  538. CALL ZLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
  539. $ NRHS, A, LDA, XACT, LDA, B, LDA,
  540. $ ISEED, INFO )
  541. CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
  542. *
  543. SRNAMT = 'ZSYTRS'
  544. CALL ZSYTRS( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
  545. $ LDA, INFO )
  546. *
  547. * Check error code from ZSYTRS and handle error.
  548. *
  549. IF( INFO.NE.0 )
  550. $ CALL ALAERH( PATH, 'ZSYTRS', INFO, 0, UPLO, N,
  551. $ N, -1, -1, NRHS, IMAT, NFAIL,
  552. $ NERRS, NOUT )
  553. *
  554. CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
  555. *
  556. * Compute the residual for the solution
  557. *
  558. CALL ZSYT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
  559. $ LDA, RWORK, RESULT( 3 ) )
  560. *
  561. *+ TEST 4 (Using TRS2)
  562. * Solve and compute residual for A * X = B.
  563. *
  564. * Choose a set of NRHS random solution vectors
  565. * stored in XACT and set up the right hand side B
  566. *
  567. SRNAMT = 'ZLARHS'
  568. CALL ZLARHS( PATH, XTYPE, UPLO, ' ', N, N, KL, KU,
  569. $ NRHS, A, LDA, XACT, LDA, B, LDA,
  570. $ ISEED, INFO )
  571. CALL ZLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
  572. *
  573. SRNAMT = 'ZSYTRS2'
  574. CALL ZSYTRS2( UPLO, N, NRHS, AFAC, LDA, IWORK, X,
  575. $ LDA, WORK, INFO )
  576. *
  577. * Check error code from ZSYTRS2 and handle error.
  578. *
  579. IF( INFO.NE.0 )
  580. $ CALL ALAERH( PATH, 'ZSYTRS', INFO, 0, UPLO, N,
  581. $ N, -1, -1, NRHS, IMAT, NFAIL,
  582. $ NERRS, NOUT )
  583. *
  584. CALL ZLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
  585. *
  586. * Compute the residual for the solution
  587. *
  588. CALL ZSYT02( UPLO, N, NRHS, A, LDA, X, LDA, WORK,
  589. $ LDA, RWORK, RESULT( 4 ) )
  590. *
  591. *
  592. *+ TEST 5
  593. * Check solution from generated exact solution.
  594. *
  595. CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
  596. $ RESULT( 5 ) )
  597. *
  598. *+ TESTS 6, 7, and 8
  599. * Use iterative refinement to improve the solution.
  600. *
  601. SRNAMT = 'ZSYRFS'
  602. CALL ZSYRFS( UPLO, N, NRHS, A, LDA, AFAC, LDA,
  603. $ IWORK, B, LDA, X, LDA, RWORK,
  604. $ RWORK( NRHS+1 ), WORK,
  605. $ RWORK( 2*NRHS+1 ), INFO )
  606. *
  607. * Check error code from ZSYRFS and handle error.
  608. *
  609. IF( INFO.NE.0 )
  610. $ CALL ALAERH( PATH, 'ZSYRFS', INFO, 0, UPLO, N,
  611. $ N, -1, -1, NRHS, IMAT, NFAIL,
  612. $ NERRS, NOUT )
  613. *
  614. CALL ZGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
  615. $ RESULT( 6 ) )
  616. CALL ZPOT05( UPLO, N, NRHS, A, LDA, B, LDA, X, LDA,
  617. $ XACT, LDA, RWORK, RWORK( NRHS+1 ),
  618. $ RESULT( 7 ) )
  619. *
  620. * Print information about the tests that did not pass
  621. * the threshold.
  622. *
  623. DO 120 K = 3, 8
  624. IF( RESULT( K ).GE.THRESH ) THEN
  625. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  626. $ CALL ALAHD( NOUT, PATH )
  627. WRITE( NOUT, FMT = 9998 )UPLO, N, NRHS,
  628. $ IMAT, K, RESULT( K )
  629. NFAIL = NFAIL + 1
  630. END IF
  631. 120 CONTINUE
  632. NRUN = NRUN + 6
  633. *
  634. * End do for each value of NRHS in NSVAL.
  635. *
  636. 130 CONTINUE
  637. *
  638. *+ TEST 9
  639. * Get an estimate of RCOND = 1/CNDNUM.
  640. *
  641. 140 CONTINUE
  642. ANORM = ZLANSY( '1', UPLO, N, A, LDA, RWORK )
  643. SRNAMT = 'ZSYCON'
  644. CALL ZSYCON( UPLO, N, AFAC, LDA, IWORK, ANORM, RCOND,
  645. $ WORK, INFO )
  646. *
  647. * Check error code from ZSYCON and handle error.
  648. *
  649. IF( INFO.NE.0 )
  650. $ CALL ALAERH( PATH, 'ZSYCON', INFO, 0, UPLO, N, N,
  651. $ -1, -1, -1, IMAT, NFAIL, NERRS, NOUT )
  652. *
  653. * Compute the test ratio to compare values of RCOND
  654. *
  655. RESULT( 9 ) = DGET06( RCOND, RCONDC )
  656. *
  657. * Print information about the tests that did not pass
  658. * the threshold.
  659. *
  660. IF( RESULT( 9 ).GE.THRESH ) THEN
  661. IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
  662. $ CALL ALAHD( NOUT, PATH )
  663. WRITE( NOUT, FMT = 9997 )UPLO, N, IMAT, 9,
  664. $ RESULT( 9 )
  665. NFAIL = NFAIL + 1
  666. END IF
  667. NRUN = NRUN + 1
  668. 150 CONTINUE
  669. 160 CONTINUE
  670. 170 CONTINUE
  671. 180 CONTINUE
  672. *
  673. * Print a summary of the results.
  674. *
  675. CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
  676. *
  677. 9999 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NB =', I4, ', type ',
  678. $ I2, ', test ', I2, ', ratio =', G12.5 )
  679. 9998 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
  680. $ I2, ', test(', I2, ') =', G12.5 )
  681. 9997 FORMAT( ' UPLO = ''', A1, ''', N =', I5, ',', 10X, ' type ', I2,
  682. $ ', test(', I2, ') =', G12.5 )
  683. RETURN
  684. *
  685. * End of ZCHKSY
  686. *
  687. END