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.

zchkec.f 6.3 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. *> \brief \b ZCHKEC
  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 ZCHKEC( THRESH, TSTERR, NIN, NOUT )
  12. *
  13. * .. Scalar Arguments ..
  14. * LOGICAL TSTERR
  15. * INTEGER NIN, NOUT
  16. * DOUBLE PRECISION THRESH
  17. * ..
  18. *
  19. *
  20. *> \par Purpose:
  21. * =============
  22. *>
  23. *> \verbatim
  24. *>
  25. *> ZCHKEC tests eigen- condition estimation routines
  26. *> ZTRSYL, CTREXC, CTRSNA, CTRSEN
  27. *>
  28. *> In all cases, the routine runs through a fixed set of numerical
  29. *> examples, subjects them to various tests, and compares the test
  30. *> results to a threshold THRESH. In addition, ZTRSNA and CTRSEN are
  31. *> tested by reading in precomputed examples from a file (on input unit
  32. *> NIN). Output is written to output unit NOUT.
  33. *> \endverbatim
  34. *
  35. * Arguments:
  36. * ==========
  37. *
  38. *> \param[in] THRESH
  39. *> \verbatim
  40. *> THRESH is DOUBLE PRECISION
  41. *> Threshold for residual tests. A computed test ratio passes
  42. *> the threshold if it is less than THRESH.
  43. *> \endverbatim
  44. *>
  45. *> \param[in] TSTERR
  46. *> \verbatim
  47. *> TSTERR is LOGICAL
  48. *> Flag that indicates whether error exits are to be tested.
  49. *> \endverbatim
  50. *>
  51. *> \param[in] NIN
  52. *> \verbatim
  53. *> NIN is INTEGER
  54. *> The logical unit number for input.
  55. *> \endverbatim
  56. *>
  57. *> \param[in] NOUT
  58. *> \verbatim
  59. *> NOUT is INTEGER
  60. *> The logical unit number for output.
  61. *> \endverbatim
  62. *
  63. * Authors:
  64. * ========
  65. *
  66. *> \author Univ. of Tennessee
  67. *> \author Univ. of California Berkeley
  68. *> \author Univ. of Colorado Denver
  69. *> \author NAG Ltd.
  70. *
  71. *> \ingroup complex16_eig
  72. *
  73. * =====================================================================
  74. SUBROUTINE ZCHKEC( THRESH, TSTERR, NIN, NOUT )
  75. *
  76. * -- LAPACK test routine --
  77. * -- LAPACK is a software package provided by Univ. of Tennessee, --
  78. * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
  79. *
  80. * .. Scalar Arguments ..
  81. LOGICAL TSTERR
  82. INTEGER NIN, NOUT
  83. DOUBLE PRECISION THRESH
  84. * ..
  85. *
  86. * =====================================================================
  87. *
  88. * .. Local Scalars ..
  89. LOGICAL OK
  90. CHARACTER*3 PATH
  91. INTEGER KTREXC, KTRSEN, KTRSNA, KTRSYL, KTRSYL3,
  92. $ LTREXC, LTRSYL, NTESTS, NTREXC, NTRSYL
  93. DOUBLE PRECISION EPS, RTREXC, SFMIN
  94. * ..
  95. * .. Local Arrays ..
  96. INTEGER FTRSYL( 3 ), ITRSYL( 2 ), LTRSEN( 3 ),
  97. $ LTRSNA( 3 ), NTRSEN( 3 ), NTRSNA( 3 )
  98. DOUBLE PRECISION RTRSEN( 3 ), RTRSNA( 3 ), RTRSYL( 2 )
  99. * ..
  100. * .. External Subroutines ..
  101. EXTERNAL ZERREC, ZGET35, ZGET36, ZGET37, ZGET38, ZSYL01
  102. * ..
  103. * .. External Functions ..
  104. DOUBLE PRECISION DLAMCH
  105. EXTERNAL DLAMCH
  106. * ..
  107. * .. Executable Statements ..
  108. *
  109. PATH( 1: 1 ) = 'Zomplex precision'
  110. PATH( 2: 3 ) = 'EC'
  111. EPS = DLAMCH( 'P' )
  112. SFMIN = DLAMCH( 'S' )
  113. WRITE( NOUT, FMT = 9994 )
  114. WRITE( NOUT, FMT = 9993 )EPS, SFMIN
  115. WRITE( NOUT, FMT = 9992 )THRESH
  116. *
  117. * Test error exits if TSTERR is .TRUE.
  118. *
  119. IF( TSTERR )
  120. $ CALL ZERREC( PATH, NOUT )
  121. *
  122. OK = .TRUE.
  123. CALL ZGET35( RTRSYL( 1 ), LTRSYL, NTRSYL, KTRSYL, NIN )
  124. IF( RTRSYL( 1 ).GT.THRESH ) THEN
  125. OK = .FALSE.
  126. WRITE( NOUT, FMT = 9999 )RTRSYL( 1 ), LTRSYL, NTRSYL, KTRSYL
  127. END IF
  128. *
  129. CALL ZSYL01( THRESH, FTRSYL, RTRSYL, ITRSYL, KTRSYL3 )
  130. IF( FTRSYL( 1 ).GT.0 ) THEN
  131. OK = .FALSE.
  132. WRITE( NOUT, FMT = 9970 )FTRSYL( 1 ), RTRSYL( 1 ), THRESH
  133. END IF
  134. IF( FTRSYL( 2 ).GT.0 ) THEN
  135. OK = .FALSE.
  136. WRITE( NOUT, FMT = 9971 )FTRSYL( 2 ), RTRSYL( 2 ), THRESH
  137. END IF
  138. IF( FTRSYL( 3 ).GT.0 ) THEN
  139. OK = .FALSE.
  140. WRITE( NOUT, FMT = 9972 )FTRSYL( 3 )
  141. END IF
  142. *
  143. CALL ZGET36( RTREXC, LTREXC, NTREXC, KTREXC, NIN )
  144. IF( RTREXC.GT.THRESH .OR. NTREXC.GT.0 ) THEN
  145. OK = .FALSE.
  146. WRITE( NOUT, FMT = 9998 )RTREXC, LTREXC, NTREXC, KTREXC
  147. END IF
  148. *
  149. CALL ZGET37( RTRSNA, LTRSNA, NTRSNA, KTRSNA, NIN )
  150. IF( RTRSNA( 1 ).GT.THRESH .OR. RTRSNA( 2 ).GT.THRESH .OR.
  151. $ NTRSNA( 1 ).NE.0 .OR. NTRSNA( 2 ).NE.0 .OR. NTRSNA( 3 ).NE.0 )
  152. $ THEN
  153. OK = .FALSE.
  154. WRITE( NOUT, FMT = 9997 )RTRSNA, LTRSNA, NTRSNA, KTRSNA
  155. END IF
  156. *
  157. CALL ZGET38( RTRSEN, LTRSEN, NTRSEN, KTRSEN, NIN )
  158. IF( RTRSEN( 1 ).GT.THRESH .OR. RTRSEN( 2 ).GT.THRESH .OR.
  159. $ NTRSEN( 1 ).NE.0 .OR. NTRSEN( 2 ).NE.0 .OR. NTRSEN( 3 ).NE.0 )
  160. $ THEN
  161. OK = .FALSE.
  162. WRITE( NOUT, FMT = 9996 )RTRSEN, LTRSEN, NTRSEN, KTRSEN
  163. END IF
  164. *
  165. NTESTS = KTRSYL + KTRSYL3 + KTREXC + KTRSNA + KTRSEN
  166. IF( OK )
  167. $ WRITE( NOUT, FMT = 9995 )PATH, NTESTS
  168. *
  169. 9999 FORMAT( ' Error in ZTRSYL: RMAX =', D12.3, / ' LMAX = ', I8,
  170. $ ' NINFO=', I8, ' KNT=', I8 )
  171. 9998 FORMAT( ' Error in ZTREXC: RMAX =', D12.3, / ' LMAX = ', I8,
  172. $ ' NINFO=', I8, ' KNT=', I8 )
  173. 9997 FORMAT( ' Error in ZTRSNA: RMAX =', 3D12.3, / ' LMAX = ', 3I8,
  174. $ ' NINFO=', 3I8, ' KNT=', I8 )
  175. 9996 FORMAT( ' Error in ZTRSEN: RMAX =', 3D12.3, / ' LMAX = ', 3I8,
  176. $ ' NINFO=', 3I8, ' KNT=', I8 )
  177. 9995 FORMAT( / 1X, 'All tests for ', A3,
  178. $ ' routines passed the threshold ( ', I6, ' tests run)' )
  179. 9994 FORMAT( ' Tests of the Nonsymmetric eigenproblem condition',
  180. $ ' estimation routines', / ' ZTRSYL, ZTREXC, ZTRSNA, ZTRSEN',
  181. $ / )
  182. 9993 FORMAT( ' Relative machine precision (EPS) = ', D16.6,
  183. $ / ' Safe minimum (SFMIN) = ', D16.6, / )
  184. 9992 FORMAT( ' Routines pass computational tests if test ratio is ',
  185. $ 'less than', F8.2, / / )
  186. 9970 FORMAT( 'Error in ZTRSYL: ', I8, ' tests fail the threshold.', /
  187. $ 'Maximum test ratio =', D12.3, ' threshold =', D12.3 )
  188. 9971 FORMAT( 'Error in ZTRSYL3: ', I8, ' tests fail the threshold.', /
  189. $ 'Maximum test ratio =', D12.3, ' threshold =', D12.3 )
  190. 9972 FORMAT( 'ZTRSYL and ZTRSYL3 compute an inconsistent scale ',
  191. $ 'factor in ', I8, ' tests.')
  192. RETURN
  193. *
  194. * End of ZCHKEC
  195. *
  196. END