| 17 | namespace 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 | { |
nothing calls this directly
no outgoing calls
no test coverage detected