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.

dchksy.f 22 kB

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