Definition at line 77 of file DefiniteIntegral.cc.
◆ XtMidpointQuadratureRule()
Genfun::DefiniteIntegral::Clockwork::XtMidpointQuadratureRule::XtMidpointQuadratureRule |
( |
| ) |
|
|
inline |
◆ ~XtMidpointQuadratureRule()
Genfun::DefiniteIntegral::Clockwork::XtMidpointQuadratureRule::~XtMidpointQuadratureRule |
( |
| ) |
|
|
inline |
◆ integrate()
double Genfun::DefiniteIntegral::Clockwork::XtMidpointQuadratureRule::integrate |
( |
const AbsFunction & |
function, |
|
|
double |
a, |
|
|
double |
b, |
|
|
unsigned int |
j |
|
) |
| const |
|
virtual |
Implements Genfun::DefiniteIntegral::Clockwork::QuadratureRule.
Definition at line 246 of file DefiniteIntegral.cc.
246 {
247 unsigned int it, j;
248 if (n==1) {
249 retVal = (bb-aa)*(function((aa+bb)/2.0));
250 nFunctionCalls+=1;
251 }
252 else {
253 for (it=1,j=1;j<
n-1;j++) it *=3;
254 double tnm=it;
255 double del = (bb-aa)/(3.0*tnm);
256 double ddel = del+del;
257 double x=aa+0.5*del;
258 double sum=0;
259 for (j=1;j<=it;j++) {
260 sum +=function(x);
261 x+=ddel;
262 sum +=function(x);
263 x+=del;
264 nFunctionCalls+=2;
265 }
266 retVal = (retVal+(bb-aa)*sum/tnm)/3.0;
267 }
268 return retVal;
269 }
◆ numFunctionCalls()
virtual unsigned int Genfun::DefiniteIntegral::Clockwork::XtMidpointQuadratureRule::numFunctionCalls |
( |
| ) |
const |
|
inlinevirtual |
◆ stepMultiplier()
virtual unsigned int Genfun::DefiniteIntegral::Clockwork::XtMidpointQuadratureRule::stepMultiplier |
( |
| ) |
const |
|
inlinevirtual |
The documentation for this class was generated from the following file: