1
       2
       3
       4
       5
       6
       7
       8
       9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      19
      20
      21
      22
      23
      24
      25
      26
      27
      28
      29
      30
      31
      32
      33
      34
      35
      36
      37
      38
      39
      40
      41
      42
      43
      44
      45
      46
      47
      48
      49
      50
      51
      52
      53
      54
      55
      56
      57
      58
      59
      60
      61
      62
      63
      64
      65
      66
      67
      68
      69
      70
      71
      72
      73
      74
      75
      76
      77
      78
      79
      80
      81
      82
      83
      84
      85
      86
      87
      88
      89
      90
      91
      92
      93
      94
      95
      96
      97
      98
      99
     100
     101
     102
     103
     104
     105
     106
     107
     108
     109
     110
     111
     112
     113
     114
     115
     116
     117
     118
     119
     120
     121
     122
     123
     124
     125
     126
     127
     128
     129
     130
     131
      SUBROUTINE CCHKECTHRESHTSTERRNINNOUT )
*
*  -- LAPACK test routine (version 3.1) --
*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
*     November 2006
*
*     .. Scalar Arguments ..
      LOGICAL            TSTERR
      INTEGER            NINNOUT
      REAL               THRESH
*     ..
*
*  Purpose
*  =======
*
*  CCHKEC tests eigen- condition estimation routines
*         CTRSYL, CTREXC, CTRSNA, CTRSEN
*
*  In all cases, the routine runs through a fixed set of numerical
*  examples, subjects them to various tests, and compares the test
*  results to a threshold THRESH. In addition, CTRSNA and CTRSEN are
*  tested by reading in precomputed examples from a file (on input unit
*  NIN).  Output is written to output unit NOUT.
*
*  Arguments
*  =========
*
*  THRESH  (input) REAL
*          Threshold for residual tests.  A computed test ratio passes
*          the threshold if it is less than THRESH.
*
*  TSTERR  (input) LOGICAL
*          Flag that indicates whether error exits are to be tested.
*
*  NIN     (input) INTEGER
*          The logical unit number for input.
*
*  NOUT    (input) INTEGER
*          The logical unit number for output.
*
*  =====================================================================
*
*     .. Local Scalars ..
      LOGICAL            OK
      CHARACTER*3        PATH
      INTEGER            KTREXCKTRSENKTRSNAKTRSYLLTREXCLTRSYL,
     $                   NTESTSNTREXCNTRSYL
      REAL               EPSRTREXCRTRSYLSFMIN
*     ..
*     .. Local Arrays ..
      INTEGER            LTRSEN3 ), LTRSNA3 ), NTRSEN3 ),
     $                   NTRSNA3 )
      REAL               RTRSEN3 ), RTRSNA3 )
*     ..
*     .. External Subroutines ..
      EXTERNAL           CERRECCGET35CGET36CGET37CGET38
*     ..
*     .. External Functions ..
      REAL               SLAMCH
      EXTERNAL           SLAMCH
*     ..
*     .. Executable Statements ..
*
      PATH11 ) = 'Complex precision'
      PATH23 ) = 'EC'
      EPS = SLAMCH'P' )
      SFMIN = SLAMCH'S' )
      WRITENOUT, FMT = 9994 )
      WRITENOUT, FMT = 9993 )EPS, SFMIN
      WRITENOUT, FMT = 9992 )THRESH
*
*     Test error exits if TSTERR is .TRUE.
*
      IFTSTERR )
     $   CALL CERRECPATHNOUT )
*
      OK = .TRUE.
      CALL CGET35RTRSYLLTRSYLNTRSYLKTRSYLNIN )
      IFRTRSYL.GT.THRESH ) THEN
         OK = .FALSE.
         WRITENOUT, FMT = 9999 )RTRSYL, LTRSYL, NTRSYL, KTRSYL
      END IF
*
      CALL CGET36RTREXCLTREXCNTREXCKTREXCNIN )
      IFRTREXC.GT.THRESH .OR. NTREXC.GT.0 ) THEN
         OK = .FALSE.
         WRITENOUT, FMT = 9998 )RTREXC, LTREXC, NTREXC, KTREXC
      END IF
*
      CALL CGET37RTRSNALTRSNANTRSNAKTRSNANIN )
      IFRTRSNA1 ).GT.THRESH .OR. RTRSNA2 ).GT.THRESH .OR.
     $    NTRSNA1 ).NE.0 .OR. NTRSNA2 ).NE.0 .OR. NTRSNA3 ).NE.0 )
     $     THEN
         OK = .FALSE.
         WRITENOUT, FMT = 9997 )RTRSNA, LTRSNA, NTRSNA, KTRSNA
      END IF
*
      CALL CGET38RTRSENLTRSENNTRSENKTRSENNIN )
      IFRTRSEN1 ).GT.THRESH .OR. RTRSEN2 ).GT.THRESH .OR.
     $    NTRSEN1 ).NE.0 .OR. NTRSEN2 ).NE.0 .OR. NTRSEN3 ).NE.0 )
     $     THEN
         OK = .FALSE.
         WRITENOUT, FMT = 9996 )RTRSEN, LTRSEN, NTRSEN, KTRSEN
      END IF
*
      NTESTS = KTRSYL + KTREXC + KTRSNA + KTRSEN
      IFOK )
     $   WRITENOUT, FMT = 9995 )PATH, NTESTS
*
 9999 FORMAT( ' Error in CTRSYL: RMAX =', E12.3, / ' LMAX = ', I8,
     $      ' NINFO=', I8, ' KNT=', I8 )
 9998 FORMAT( ' Error in CTREXC: RMAX =', E12.3, / ' LMAX = ', I8,
     $      ' NINFO=', I8, ' KNT=', I8 )
 9997 FORMAT( ' Error in CTRSNA: RMAX =', 3E12.3, / ' LMAX = ',
     $      3I8, ' NINFO=', 3I8, ' KNT=', I8 )
 9996 FORMAT( ' Error in CTRSEN: RMAX =', 3E12.3, / ' LMAX = ',
     $      3I8, ' NINFO=', 3I8, ' KNT=', I8 )
 9995 FORMAT( / 1X, 'All tests for ', A3,
     $      ' routines passed the threshold (', I6, ' tests run)' )
 9994 FORMAT( ' Tests of the Nonsymmetric eigenproblem condition',
     $      ' estimation routines', / ' CTRSYL, CTREXC, CTRSNA, CTRSEN',
     $      / )
 9993 FORMAT( ' Relative machine precision (EPS) = ', E16.6,
     $      / ' Safe minimum (SFMIN)             = ', E16.6, / )
 9992 FORMAT( ' Routines pass computational tests if test ratio is ',
     $      'less than', F8.2, / / )
      RETURN
*
*     End of CCHKEC
*
      END