Debian Codegraph @

debian/external_deps/fetk/punc/src/arpack/ssconv.c

raw
1 /* ./src_f77/ssconv.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 /* Common Block Declarations */
9
10 struct {
11 integer logfil, ndigit, mgetv0, msaupd, msaup2, msaitr, mseigt, msapps,
12 msgets, mseupd, mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets,
13 mneupd, mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd;
14 } debug_SSCONV;
15
16 #define debug_1 debug_SSCONV
17
18 struct {
19 integer nopx, nbx, nrorth, nitref, nrstrt;
20 real tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv, tnaupd,
21 tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv, tcaupd, tcaup2,
22 tcaitr, tceigh, tcgets, tcapps, tcconv, tmvopx, tmvbx, tgetv0,
23 titref, trvec;
24 } timing_SSCONV;
25
26 #define timing_1 timing_SSCONV
27
28 /* Table of constant values */
29
30 static doublereal c_b3 = .66666666666666663;
31
32 /* ----------------------------------------------------------------------- */
33 /* \BeginDoc */
34
35 /* \Name: ssconv */
36
37 /* \Description: */
38 /* Convergence testing for the symmetric Arnoldi eigenvalue routine. */
39
40 /* \Usage: */
41 /* call ssconv */
42 /* ( N, RITZ, BOUNDS, TOL, NCONV ) */
43
44 /* \Arguments */
45 /* N Integer. (INPUT) */
46 /* Number of Ritz values to check for convergence. */
47
48 /* RITZ Real array of length N. (INPUT) */
49 /* The Ritz values to be checked for convergence. */
50
51 /* BOUNDS Real array of length N. (INPUT) */
52 /* Ritz estimates associated with the Ritz values in RITZ. */
53
54 /* TOL Real scalar. (INPUT) */
55 /* Desired relative accuracy for a Ritz value to be considered */
56 /* "converged". */
57
58 /* NCONV Integer scalar. (OUTPUT) */
59 /* Number of "converged" Ritz values. */
60
61 /* \EndDoc */
62
63 /* ----------------------------------------------------------------------- */
64
65 /* \BeginLib */
66
67 /* \Routines called: */
68 /* second ARPACK utility routine for timing. */
69 /* slamch LAPACK routine that determines machine constants. */
70
71 /* \Author */
72 /* Danny Sorensen Phuong Vu */
73 /* Richard Lehoucq CRPC / Rice University */
74 /* Dept. of Computational & Houston, Texas */
75 /* Applied Mathematics */
76 /* Rice University */
77 /* Houston, Texas */
78
79 /* \SCCS Information: @(#) */
80 /* FILE: sconv.F SID: 2.4 DATE OF SID: 4/19/96 RELEASE: 2 */
81
82 /* \Remarks */
83 /* 1. Starting with version 2.4, this routine no longer uses the */
84 /* Parlett strategy using the gap conditions. */
85
86 /* \EndLib */
87
88 /* ----------------------------------------------------------------------- */
89
90 /* Subroutine */ int ssconv_(integer *n, real *ritz, real *bounds, real *tol,
91 integer *nconv)
92 {
93 /* System generated locals */
94 integer i__1;
95 real r__1, r__2, r__3;
96 doublereal d__1;
97
98 /* Builtin functions */
99 double pow_dd(doublereal *, doublereal *);
100
101 /* Local variables */
102 static integer i__;
103 static real t0, t1, eps23, temp;
104 extern doublereal slamch_(char *, ftnlen);
105 extern /* Subroutine */ int second_(real *);
106
107
108 /* %----------------------------------------------------% */
109 /* | Include files for debugging and timing information | */
110 /* %----------------------------------------------------% */
111
112
113 /* \SCCS Information: @(#) */
114 /* FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2 */
115
116 /* %---------------------------------% */
117 /* | See debug.doc for documentation | */
118 /* %---------------------------------% */
119
120 /* %------------------% */
121 /* | Scalar Arguments | */
122 /* %------------------% */
123
124 /* %--------------------------------% */
125 /* | See stat.doc for documentation | */
126 /* %--------------------------------% */
127
128 /* \SCCS Information: @(#) */
129 /* FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2 */
130
131
132
133 /* %-----------------% */
134 /* | Array Arguments | */
135 /* %-----------------% */
136
137
138 /* %---------------% */
139 /* | Local Scalars | */
140 /* %---------------% */
141
142
143 /* %-------------------% */
144 /* | External routines | */
145 /* %-------------------% */
146
147 /* %---------------------% */
148 /* | Intrinsic Functions | */
149 /* %---------------------% */
150
151
152 /* %-----------------------% */
153 /* | Executable Statements | */
154 /* %-----------------------% */
155
156 /* Parameter adjustments */
157 --bounds;
158 --ritz;
159
160 /* Function Body */
161 second_(&t0);
162
163 eps23 = slamch_("Epsilon-Machine", (ftnlen)15);
164 d__1 = (doublereal) eps23;
165 eps23 = pow_dd(&d__1, &c_b3);
166
167 *nconv = 0;
168 i__1 = *n;
169 for (i__ = 1; i__ <= i__1; ++i__) {
170
171 /* %-----------------------------------------------------% */
172 /* | The i-th Ritz value is considered "converged" | */
173 /* | when: bounds(i) .le. TOL*max(eps23, abs(ritz(i))) | */
174 /* %-----------------------------------------------------% */
175
176 /* Computing MAX */
177 r__2 = eps23, r__3 = (r__1 = ritz[i__], dabs(r__1));
178 temp = dmax(r__2,r__3);
179 if (bounds[i__] <= *tol * temp) {
180 ++(*nconv);
181 }
182
183 /* L10: */
184 }
185
186 second_(&t1);
187 timing_1.tsconv += t1 - t0;
188
189 return 0;
190
191 /* %---------------% */
192 /* | End of ssconv | */
193 /* %---------------% */
194
195 } /* ssconv_ */
196