23 class model_parameters;
42 const double base = 4;
46 for(
int j=1; j<=MAXN+1; j++)
51 for(
int iter=1; iter<=MAXN+1; iter++)
53 for(
int j=1; j<=MAXN+1-iter; j++)
55 s[j] = (
pow(base,iter)*s[j+1]-s[j])/(
pow(base,iter)-1);
71 const double base = 4;
75 for(
int j=1; j<=MAXN+1; j++)
80 for(
int iter=1; iter<=MAXN+1; iter++)
82 for(
int j=1; j<=MAXN+1-iter; j++)
84 s[j] = (
pow(base,iter)*s[j+1]-s[j])/(
pow(base,iter)-1);
100 const double base = 4;
104 for(
int j=1; j<=MAXN+1; j++)
106 s[j] =
trapzd(func,a,b,j);
109 for(
int iter=1; iter<=MAXN+1; iter++)
111 for(
int j=1; j<=MAXN+1-iter; j++)
113 s[j] = (
pow(base,iter)*s[j+1]-s[j])/(
pow(base,iter)-1);
129 const double base = 4;
133 for(
int j=1; j<=MAXN+1; j++)
135 s[j] =
trapzd(func,a,b,j);
138 for(
int iter=1; iter<=MAXN+1; iter++)
140 for(
int j=1; j<=MAXN+1-iter; j++)
142 s[j] = (
pow(base,iter)*s[j+1]-s[j])/(
pow(base,iter)-1);
158 double x,num_interval,hn;
165 return (s=0.5*(b-a)*(func(a)+func(b)));
167 num_interval=interval;
168 hn=(b-a)/num_interval;
170 for (sum=0.0,j=1;j<=interval;j++,x+=hn) sum += func(x);
172 s=0.5*(s+(b-a)*sum/num_interval);
193 return (s=0.5*(b-a)*(func(a)+func(b)));
195 num_interval=interval;
196 hn=(b-a)/num_interval;
198 for (sum=0.0,j=1;j<=interval;j++,x+=hn) sum += func(x);
200 s=0.5*(s+(b-a)*sum/num_interval);
222 return (s=0.5*(b-a)*(func(a)+func(b)));
224 num_interval=interval;
225 hn=(b-a)/num_interval;
227 for (sum=0.0,j=1;j<=interval;j++,x+=hn) sum += func(x);
229 s=0.5*(s+(b-a)*sum/num_interval);
250 return (s=0.5*(b-a)*(func(a)+func(b)));
252 num_interval=interval;
253 hn=(b-a)/num_interval;
255 for (sum=0.0,j=1;j<=interval;j++,x+=hn) sum += func(x);
257 s=0.5*(s+(b-a)*sum/num_interval);
273 double dif,dift,ho,hp;
280 if ( (dift=
fabs(x-xa[i])) < dif) {
289 for (i=1;i<=n-m;i++) {
293 if ( (den=ho-hp) == 0.0)
295 cerr <<
"Error in routine POLINT" <<
endl;
302 y += (dy=(2*ns < (n-m) ? c[ns+1] : d[ns--]));
Vector of double precision numbers.
void polint(const dvector &xa, const dvar_vector &ya, int n, double x, const dvariable &y, const dvariable &dy)
std::function< dvariable(const dvariable &)> _func
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
df1_two_variable fabs(const df1_two_variable &x)
dvariable trapzd(_func func, double a, double b, int n)
prnstream & endl(prnstream &)
Description not yet available.
dvariable trapzd(void *, double a, double b, int n)
Fundamental data type for reverse mode automatic differentiation.
d3_array pow(const d3_array &m, int e)
Description not yet available.
dvariable adromb(_func func, double a, double b, int ns=9)
Romberg integration.