Alexandria  2.25.0
SDC-CH common library for the Euclid project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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. More...
 
double operator() (const Function &function, double min, double max) override
 Functional call. More...
 
- Public Member Functions inherited from Euclid::MathUtils::NumericalIntegrationScheme
virtual ~NumericalIntegrationScheme ()=default
 Default destructor. More...
 

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

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.

Definition at line 29 of file AdaptativeIntegration.icpp.

Member Function Documentation

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.

Definition at line 33 of file AdaptativeIntegration.icpp.

References m.

Member Data Documentation

template<typename Quadrature>
int Euclid::MathUtils::AdaptativeIntegration< Quadrature >::m_initial_order
private

Definition at line 84 of file AdaptativeIntegration.h.

template<typename Quadrature>
Quadrature Euclid::MathUtils::AdaptativeIntegration< Quadrature >::m_quadrature {}
private

Definition at line 82 of file AdaptativeIntegration.h.

template<typename Quadrature>
double Euclid::MathUtils::AdaptativeIntegration< Quadrature >::m_relative_precion
private

Definition at line 83 of file AdaptativeIntegration.h.


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