164 DataType helper = (to - from);
167 Size nsteps = (
Size) (sqrt((helper*helper)/(h*h)));
168 for (count=1; count<nsteps-1; count++)
170 sum +=function_(from+(count*h));
173 sum+=function_(from)+function_(to);
183 (DataType from, DataType to)
186 result_.push_back(trapezoid(h, from, to));
195 result_.push_back(trapezoid(h/((
float) i+1), from, to));
197 for (j=1; j <= i; j++)
199 result_.push_back(result_[(i*(i+1))/2 + (j-1)] + 1. / (pow(4, j) - 1) * (result_[(i*(i+1))/2 + j-1 - result_[((i-1)*i)/2+j-1]));
203 dev = result_[((i-2)*(i-1))/2+(i-2)] - result_[((i-1)*(i))/2+(i-1)];
204 }
while ( (sqrt(dev*dev) > epsilon_) && (count < maxNumSteps_));
206 return (result_[((i-1)*(i))/2 + (i-1)]);