1c-----------------------------------------------------------------------
2c\BeginDoc
3c
4c\Name: ssconv
5c
6c\Description:
7c  Convergence testing for the symmetric Arnoldi eigenvalue routine.
8c
9c\Usage:
10c  call ssconv
11c     ( N, RITZ, BOUNDS, TOL, NCONV )
12c
13c\Arguments
14c  N       Integer.  (INPUT)
15c          Number of Ritz values to check for convergence.
16c
17c  RITZ    Real array of length N.  (INPUT)
18c          The Ritz values to be checked for convergence.
19c
20c  BOUNDS  Real array of length N.  (INPUT)
21c          Ritz estimates associated with the Ritz values in RITZ.
22c
23c  TOL     Real scalar.  (INPUT)
24c          Desired relative accuracy for a Ritz value to be considered
25c          "converged".
26c
27c  NCONV   Integer scalar.  (OUTPUT)
28c          Number of "converged" Ritz values.
29c
30c\EndDoc
31c
32c-----------------------------------------------------------------------
33c
34c\BeginLib
35c
36c\Routines called:
37c     arscnd  ARPACK utility routine for timing.
38c     slamch  LAPACK routine that determines machine constants.
39c
40c\Author
41c     Danny Sorensen               Phuong Vu
42c     Richard Lehoucq              CRPC / Rice University
43c     Dept. of Computational &     Houston, Texas
44c     Applied Mathematics
45c     Rice University
46c     Houston, Texas
47c
48c\SCCS Information: @(#)
49c FILE: sconv.F   SID: 2.4   DATE OF SID: 4/19/96   RELEASE: 2
50c
51c\Remarks
52c     1. Starting with version 2.4, this routine no longer uses the
53c        Parlett strategy using the gap conditions.
54c
55c\EndLib
56c
57c-----------------------------------------------------------------------
58c
59      subroutine ssconv (n, ritz, bounds, tol, nconv)
60c
61c     %----------------------------------------------------%
62c     | Include files for debugging and timing information |
63c     %----------------------------------------------------%
64c
65      include   'debug.h'
66      include   'stat.h'
67c
68c     %------------------%
69c     | Scalar Arguments |
70c     %------------------%
71c
72      integer    n, nconv
73      Real
74     &           tol
75c
76c     %-----------------%
77c     | Array Arguments |
78c     %-----------------%
79c
80      Real
81     &           ritz(n), bounds(n)
82c
83c     %---------------%
84c     | Local Scalars |
85c     %---------------%
86c
87      integer    i
88      Real
89     &           temp, eps23
90c
91c     %-------------------%
92c     | External routines |
93c     %-------------------%
94c
95      Real
96     &           slamch
97      external   slamch
98
99c     %---------------------%
100c     | Intrinsic Functions |
101c     %---------------------%
102c
103      intrinsic    abs
104c
105c     %-----------------------%
106c     | Executable Statements |
107c     %-----------------------%
108c
109      call arscnd (t0)
110c
111      eps23 = slamch('Epsilon-Machine')
112      eps23 = eps23**(2.0E+0 / 3.0E+0)
113c
114      nconv  = 0
115      do 10 i = 1, n
116c
117c        %-----------------------------------------------------%
118c        | The i-th Ritz value is considered "converged"       |
119c        | when: bounds(i) .le. TOL*max(eps23, abs(ritz(i)))   |
120c        %-----------------------------------------------------%
121c
122         temp = max( eps23, abs(ritz(i)) )
123         if ( bounds(i) .le. tol*temp ) then
124            nconv = nconv + 1
125         end if
126c
127   10 continue
128c
129      call arscnd (t1)
130      tsconv = tsconv + (t1 - t0)
131c
132      return
133c
134c     %---------------%
135c     | End of ssconv |
136c     %---------------%
137c
138      end
139