MCPcopy Create free account
hub / github.com/BIMCoderLiang/LNLib / Simpson

Method Simpson

src/LNLib/Algorithm/Integrator.cpp:19–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17namespace LNLib
18{
19 double Integrator::Simpson(IntegrationFunction& function, void* customData, double start, double end)
20 {
21 double st = (function)(start, customData);
22 double mt = (function)((start + end) / 2.0, customData);
23 double et = (function)((end), customData);
24 double result = ((end - start) / 6.0) * (st + 4 * mt + et);
25 return result;
26 }
27
28 double Integrator::Simpson(BinaryIntegrationFunction& function, void* customData, double uStart, double uEnd, double vStart, double vEnd)
29 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected