Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Euclid::MathUtils::AdaptativeIntegration< Quadrature > Class Template Reference

Class implementing the NumericalIntegrationScheme interface. More...

#include <AdaptativeIntegration.h>

Inheritance diagram for Euclid::MathUtils::AdaptativeIntegration< Quadrature >:
Inheritance graph
[legend]
Collaboration diagram for Euclid::MathUtils::AdaptativeIntegration< Quadrature >:
Collaboration graph
[legend]

Public Member Functions

 AdaptativeIntegration (double relative_precision, int initial_order)
 Constructor.
 
double operator() (const Function &function, double min, double max) override
 Functional call.
 
- Public Member Functions inherited from Euclid::MathUtils::NumericalIntegrationScheme
virtual ~NumericalIntegrationScheme ()=default
 Default destructor.
 

Private Attributes

Quadrature m_quadrature {}
 
double m_relative_precion
 
int m_initial_order
 

Detailed Description

template<typename Quadrature>
class Euclid::MathUtils::AdaptativeIntegration< Quadrature >

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.

Template Parameters
quadratureThe numerical quadrature used to compute the integral approximation.

Definition at line 52 of file AdaptativeIntegration.h.

Constructor & Destructor Documentation

◆ AdaptativeIntegration()

template<typename Quadrature >
Euclid::MathUtils::AdaptativeIntegration< Quadrature >::AdaptativeIntegration ( double  relative_precision,
int  initial_order 
)

Constructor.

Parameters
relative_precisionA double representing the maximal relative difference between an iteration and the next in order the computation to stop.
initial_orderan 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.

Member Function Documentation

◆ operator()()

template<typename Quadrature >
double Euclid::MathUtils::AdaptativeIntegration< Quadrature >::operator() ( const Function function,
double  min,
double  max 
)
overridevirtual

Functional call.

Compute the integral using the quadrature and increasing the order until two successive iteration have relative difference smaller than the prescription.

Parameters
functionthe Function to integrate.
minThe minimum range of the integration.
maxThe maximum range of the integration.

Implements Euclid::MathUtils::NumericalIntegrationScheme.

Member Data Documentation

◆ m_initial_order

Definition at line 84 of file AdaptativeIntegration.h.

◆ m_quadrature

Definition at line 82 of file AdaptativeIntegration.h.

◆ m_relative_precion

Definition at line 83 of file AdaptativeIntegration.h.


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