Alexandria 2.31.0
SDC-CH common library for the Euclid project
|
Class implementing the NumericalIntegrationScheme interface. More...
#include <AdaptativeIntegration.h>
Public Member Functions | |
AdaptativeIntegration (double relative_precision, int initial_order) | |
Constructor. | |
double | operator() (const Function &function, double min, double max) override |
Functional call. | |
![]() | |
virtual | ~NumericalIntegrationScheme ()=default |
Default destructor. | |
Private Attributes | |
Quadrature | m_quadrature {} |
double | m_relative_precion |
int | m_initial_order |
Class implementing the NumericalIntegrationScheme interface.
AdaptativeIntegration is sampling the interval in 2^order points. It apply a quadrature to get an approximation of the integral. Then it double the sampling and recompute the integral computation and loop, increasing the order. The process stops when the relative difference between one approximation and the next is smaller than the prescription.
quadrature | The numerical quadrature used to compute the integral approximation. |
Definition at line 52 of file AdaptativeIntegration.h.
Euclid::MathUtils::AdaptativeIntegration< Quadrature >::AdaptativeIntegration | ( | double | relative_precision, |
int | initial_order | ||
) |
Constructor.
relative_precision | A double representing the maximal relative difference between an iteration and the next in order the computation to stop. |
initial_order | an integer giving the number of sampling, computed as 2^order, for the first integral approximation. Note that the quadrature may require a minimal order to work. |
|
overridevirtual |
Functional call.
Compute the integral using the quadrature and increasing the order until two successive iteration have relative difference smaller than the prescription.
function | the Function to integrate. |
min | The minimum range of the integration. |
max | The maximum range of the integration. |
Implements Euclid::MathUtils::NumericalIntegrationScheme.
|
private |
Definition at line 84 of file AdaptativeIntegration.h.
|
private |
Definition at line 82 of file AdaptativeIntegration.h.
|
private |
Definition at line 83 of file AdaptativeIntegration.h.