14 double Amsterdam_Method(
double (*f)(
double),
double a,
double fa,
double c,
double fc,
15 double tol,
int max_iter,
int& err );
46 double p_x(
int ip)
const
50 double p_y(
int ip)
const
58 double p_numerator(
double dab,
double dcb,
double fa,
double fb,
double fc)
60 return fb*(dab*fc*(fc-fb)-fa*dcb*(fa-fb));
64 return (fc-fb)*(fa-fb)*(fa-fc);
108 int test = s1*
sign3(fx2);
114 p_history.push_back( pair<double,double>(x1,fx1) );
115 p_history.push_back( pair<double,double>(x2,fx2) );
116 p_a = ( x1 <
x2 ) ? 0 : 1;
117 p_c = ( x1 <
x2 ) ? 1 : 0;
120 void add(
double x,
double fx )
122 p_history.push_back( pair<double,double>(x,fx) );
132 double rel_step =
safe_div( next, last ) - 1.;
133 rel_step =
sign(
min(abs(rel_step),abs(max_rel_step)), rel_step );
134 return (1.+rel_step)*last;
138 double deriv(
int n,
double& sigma)
const;
146 return deriv( n, sigma );
155 double zero_fit(
int n,
double& sigma)
const;
189 for(
unsigned int i=0; i <
p_history.size(); ++i )
253 if( next_est < current )
double p_midpoint() const
Definition: iter_track.h:54
double deriv(double &sigma) const
Definition: iter_track.h:139
realnum m_lastnext
Definition: iter_track.h:270
static double x2[63]
Definition: atmdat_3body.cpp:18
T p_hi_bound
Definition: iter_track.h:234
double Amsterdam_Method(double(*f)(double), double a, double fa, double c, double fc, double tol, int max_iter, int &err)
Definition: iter_track.cpp:277
realnum m_lastcurr
Definition: iter_track.h:271
double bracket_width() const
Definition: iter_track.h:85
static double x1[83]
Definition: atmdat_3body.cpp:27
void set_NaN(sys_float &x)
Definition: cpu.cpp:871
void p_clear1()
Definition: iter_track.h:235
double next_val()
Definition: iter_track.cpp:57
void add(double x, double fx)
Definition: iter_track.h:120
void print_history() const
Definition: iter_track.h:186
double p_x(int ip) const
Definition: iter_track.h:46
double p_denominator(double fa, double fb, double fc)
Definition: iter_track.h:62
double deriv(int n) const
Definition: iter_track.h:143
void p_clear0()
Definition: iter_track.h:27
T p_lo_bound
Definition: iter_track.h:233
~iter_track()
Definition: iter_track.h:72
T sign(T x, T y)
Definition: cddefines.h:852
double zero_fit(int n) const
Definition: iter_track.h:160
realnum m_confidence
Definition: iter_track.h:269
static const int PREV_ITER
Definition: iter_track.h:264
bool p_lgRootFound
Definition: iter_track.h:25
FILE * ioQQQ
Definition: cddefines.cpp:7
int p_b
Definition: iter_track.h:23
T next_val(T current, T next_est)
Definition: iter_track.h:250
double p_y(int ip) const
Definition: iter_track.h:50
realnum next_val(realnum current, realnum next_est)
Definition: iter_track.cpp:19
double p_result
Definition: iter_track.h:20
Definition: iter_track.h:267
vector< pair< double, double > > p_history
Definition: iter_track.h:19
Definition: iter_track.h:231
secant_track()
Definition: iter_track.h:280
int init_bracket(double x1, double fx1, double x2, double fx2)
Definition: iter_track.h:104
static const int PREV_ITER
Definition: iter_track.h:289
int dprintf(FILE *fp, const char *format,...)
Definition: service.cpp:1306
void clear()
Definition: iter_track.h:284
void p_clear1()
Definition: iter_track.h:31
double zero_fit() const
Definition: iter_track.h:165
bool lgConverged()
Definition: iter_track.h:89
float realnum
Definition: cddefines.h:127
long max(int a, long b)
Definition: cddefines.h:821
int sign3(T x)
Definition: cddefines.h:860
long min(int a, long b)
Definition: cddefines.h:766
sys_float safe_div(sys_float x, sys_float y, sys_float res_0by0)
Definition: cddefines.h:1017
double zero_fit(double &sigma) const
Definition: iter_track.h:156
void print_status() const
Definition: iter_track.h:180
iter_track_basic()
Definition: iter_track.h:242
double p_tol
Definition: iter_track.h:21
void clear()
Definition: iter_track.h:76
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1325
void p_clear1()
Definition: iter_track.h:273
int p_c
Definition: iter_track.h:24
int in_bounds(double x) const
Definition: iter_track.h:170
void p_set_root(double x)
Definition: iter_track.h:41
iter_track()
Definition: iter_track.h:68
double deriv() const
Definition: iter_track.h:148
Definition: iter_track.h:17
void clear()
Definition: iter_track.h:246
void set_tol(double tol)
Definition: iter_track.h:81
int p_a
Definition: iter_track.h:22
double p_numerator(double dab, double dcb, double fa, double fb, double fc)
Definition: iter_track.h:58
double root() const
Definition: iter_track.h:100
double next_val(double max_rel_step)
Definition: iter_track.h:128