CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Genfun::DefiniteIntegral::Clockwork Class Reference

Classes

class  QuadratureRule
 
class  TrapezoidQuadratureRule
 
class  XtMidpointQuadratureRule
 

Public Member Functions

void polint (std::vector< double >::iterator xArray, std::vector< double >::iterator yArray, double x, double &y, double &deltay) const
 

Public Attributes

double a
 
double b
 
DefiniteIntegral::Type type
 
unsigned int nFunctionCalls
 
unsigned int MAXITER
 
double EPS
 
unsigned int K
 

Detailed Description

Definition at line 15 of file DefiniteIntegral.cc.

Member Function Documentation

◆ polint()

void Genfun::DefiniteIntegral::Clockwork::polint ( std::vector< double >::iterator  xArray,
std::vector< double >::iterator  yArray,
double  x,
double y,
double deltay 
) const

Definition at line 187 of file DefiniteIntegral.cc.

187 {
188 double dif = fabs(x-xArray[1]),dift;
189 std::vector<double> cc(K+1),d(K+1);
190 unsigned int ns=1;
191 for (unsigned int i=1;i<=K;i++) {
192 dift=fabs(x-xArray[i]);
193 if (dift<dif) {
194 ns=i;
195 dif=dift;
196 }
197 cc[i]=d[i]=yArray[i];
198 }
199 y = yArray[ns--];
200 for (unsigned int m=1;m<K;m++) {
201 for (unsigned int i=1;i<=K-m;i++) {
202 double ho = xArray[i]-x;
203 double hp= xArray[i+m]-x;
204 double w=cc[i+1]-d[i];
205 double den=ho-hp;
206 if (den==0)
207 std::cerr
208 << "Error in polynomial extrapolation"
209 << std::endl;
210 den=w/den;
211 d[i]=hp*den;
212 cc[i]=ho*den;
213 }
214 deltay = 2*ns < (K-m) ? cc[ns+1]: d[ns--];
215 y += deltay;
216 }
217 }

Referenced by Genfun::DefiniteIntegral::operator[]().

Member Data Documentation

◆ a

double Genfun::DefiniteIntegral::Clockwork::a

◆ b

double Genfun::DefiniteIntegral::Clockwork::b

◆ EPS

◆ K

unsigned int Genfun::DefiniteIntegral::Clockwork::K

◆ MAXITER

unsigned int Genfun::DefiniteIntegral::Clockwork::MAXITER

◆ nFunctionCalls

unsigned int Genfun::DefiniteIntegral::Clockwork::nFunctionCalls
mutable

◆ type

DefiniteIntegral::Type Genfun::DefiniteIntegral::Clockwork::type

The documentation for this class was generated from the following file: