| 1 |
/* ./src_f77/dsconv.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_DSCONV; |
| 15 |
|
| 16 |
#define debug_1 debug_DSCONV |
| 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_DSCONV; |
| 25 |
|
| 26 |
#define timing_1 timing_DSCONV |
| 27 |
|
| 28 |
/* Table of constant values */ |
| 29 |
|
| 30 |
static doublereal c_b3 = .66666666666666663; |
| 31 |
|
| 32 |
/* ----------------------------------------------------------------------- */ |
| 33 |
/* \BeginDoc */ |
| 34 |
|
| 35 |
/* \Name: dsconv */ |
| 36 |
|
| 37 |
/* \Description: */ |
| 38 |
/* Convergence testing for the symmetric Arnoldi eigenvalue routine. */ |
| 39 |
|
| 40 |
/* \Usage: */ |
| 41 |
/* call dsconv */ |
| 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 Double precision array of length N. (INPUT) */ |
| 49 |
/* The Ritz values to be checked for convergence. */ |
| 50 |
|
| 51 |
/* BOUNDS Double precision array of length N. (INPUT) */ |
| 52 |
/* Ritz estimates associated with the Ritz values in RITZ. */ |
| 53 |
|
| 54 |
/* TOL Double precision 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 |
/* dlamch 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 dsconv_(integer *n, doublereal *ritz, doublereal *bounds, |
| 91 |
doublereal *tol, integer *nconv) |
| 92 |
{ |
| 93 |
/* System generated locals */ |
| 94 |
integer i__1; |
| 95 |
doublereal d__1, d__2, d__3; |
| 96 |
|
| 97 |
/* Builtin functions */ |
| 98 |
double pow_dd(doublereal *, doublereal *); |
| 99 |
|
| 100 |
/* Local variables */ |
| 101 |
static integer i__; |
| 102 |
static real t0, t1; |
| 103 |
static doublereal eps23, temp; |
| 104 |
extern doublereal dlamch_(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 = dlamch_("Epsilon-Machine", (ftnlen)15); |
| 164 |
eps23 = pow_dd(&eps23, &c_b3); |
| 165 |
|
| 166 |
*nconv = 0; |
| 167 |
i__1 = *n; |
| 168 |
for (i__ = 1; i__ <= i__1; ++i__) { |
| 169 |
|
| 170 |
/* %-----------------------------------------------------% */ |
| 171 |
/* | The i-th Ritz value is considered "converged" | */ |
| 172 |
/* | when: bounds(i) .le. TOL*max(eps23, abs(ritz(i))) | */ |
| 173 |
/* %-----------------------------------------------------% */ |
| 174 |
|
| 175 |
/* Computing MAX */ |
| 176 |
d__2 = eps23, d__3 = (d__1 = ritz[i__], abs(d__1)); |
| 177 |
temp = max(d__2,d__3); |
| 178 |
if (bounds[i__] <= *tol * temp) { |
| 179 |
++(*nconv); |
| 180 |
} |
| 181 |
|
| 182 |
/* L10: */ |
| 183 |
} |
| 184 |
|
| 185 |
second_(&t1); |
| 186 |
timing_1.tsconv += t1 - t0; |
| 187 |
|
| 188 |
return 0; |
| 189 |
|
| 190 |
/* %---------------% */ |
| 191 |
/* | End of dsconv | */ |
| 192 |
/* %---------------% */ |
| 193 |
|
| 194 |
} /* dsconv_ */ |
| 195 |
|