3#include "CLHEP/GenericFunctions/InterpolatingPolynomial.hh"
27 double dif = fabs(x-xPoints[0].first),dift;
28 const unsigned int _K = (
unsigned int)xPoints.size(),_KP=_K+1;
29 std::vector<double>c(_KP),d(_KP);
31 for (
unsigned int i=0;i<_K;i++) {
32 dift=fabs(x-xPoints[i].first);
37 c[i]=d[i]=xPoints[i].second;
39 y = xPoints[ns--].second;
40 for (
unsigned int m=0;m<_K-1;m++) {
41 for (
unsigned int i=0;i<_K-m-1;i++) {
42 double ho = xPoints[i].first-x;
43 double hp= xPoints[i+m+1].first-x;
48 <<
"Error in polynomial extrapolation"
54 deltay = 2*(ns+1) < (
int)(_K-m-1) ? c[ns+1]: d[ns--];
61 xPoints.push_back(std::make_pair(x,y));
65 min=DBL_MAX, max=-DBL_MAX;
66 for (
unsigned int i=0;i<xPoints.size();i++) {
67 min = std::min(min,xPoints[i].first);
68 max = std::max(max,xPoints[i].first);
#define FUNCTION_OBJECT_IMP(classname)
void getRange(double &min, double &max) const
virtual ~InterpolatingPolynomial()
virtual double operator()(double argument) const override
InterpolatingPolynomial()
void addPoint(double x, double y)