Alexandria 2.31.0
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Euclid::MathUtils::CubicInterpolator Class Referencefinal
Inheritance diagram for Euclid::MathUtils::CubicInterpolator:
Inheritance graph
[legend]
Collaboration diagram for Euclid::MathUtils::CubicInterpolator:
Collaboration graph
[legend]

Public Member Functions

 CubicInterpolator (std::vector< double > knots, std::vector< double > coef0, std::vector< double > coef1, std::vector< double > coef2, std::vector< double > coef3)
 
virtual ~CubicInterpolator ()=default
 
double operator() (double x) const override
 
void operator() (const std::vector< double > &xs, std::vector< double > &out) const override
 
std::unique_ptr< NAryFunctionclone () const override
 
double integrate (const double a, const double b) const override
 
- Public Member Functions inherited from Euclid::MathUtils::PiecewiseBase
virtual ~PiecewiseBase ()=default
 
const std::vector< double > & getKnots () const
 Returns the knots of the piecewise function.
 
- Public Member Functions inherited from Euclid::MathUtils::Integrable
virtual ~Integrable ()=default
 Default destructor.
 

Private Member Functions

double antiderivative (int i, double x) const
 

Private Attributes

std::vector< doublem_coef0
 
std::vector< doublem_coef1
 
std::vector< doublem_coef2
 
std::vector< doublem_coef3
 

Additional Inherited Members

- Protected Member Functions inherited from Euclid::MathUtils::PiecewiseBase
 PiecewiseBase (std::vector< double > knots)
 
ssize_t findKnot (double x) const
 
- Protected Attributes inherited from Euclid::MathUtils::PiecewiseBase
std::vector< doublem_knots
 A vector where the knots are kept.
 

Detailed Description

Definition at line 33 of file spline.cpp.

Constructor & Destructor Documentation

◆ CubicInterpolator()

Euclid::MathUtils::CubicInterpolator::CubicInterpolator ( std::vector< double knots,
std::vector< double coef0,
std::vector< double coef1,
std::vector< double coef2,
std::vector< double coef3 
)
inline

Definition at line 35 of file spline.cpp.

◆ ~CubicInterpolator()

virtual Euclid::MathUtils::CubicInterpolator::~CubicInterpolator ( )
virtualdefault

Member Function Documentation

◆ antiderivative()

double Euclid::MathUtils::CubicInterpolator::antiderivative ( int  i,
double  x 
) const
inlineprivate

Definition at line 133 of file spline.cpp.

References m_coef0, m_coef1, m_coef2, and m_coef3.

Referenced by integrate().

◆ clone()

std::unique_ptr< NAryFunction > Euclid::MathUtils::CubicInterpolator::clone ( ) const
inlineoverridevirtual

Creates a clone of the function object. All subclasses must implement this method, to enable copying of Function objects when only a reference to the Function class is available.

Returns
A copy of the Function object

Implements Euclid::MathUtils::NAryFunction< N >.

Definition at line 93 of file spline.cpp.

References m_coef0, m_coef1, m_coef2, m_coef3, and Euclid::MathUtils::PiecewiseBase::m_knots.

◆ integrate()

double Euclid::MathUtils::CubicInterpolator::integrate ( const double  a,
const double  b 
) const
inlineoverridevirtual

Calculates the integral of the function in the range [a,b].

Parameters
aThe lower bound of the integration
bThe upper bound of the integration
Returns
The integral of the function in the range [a,b]

Implements Euclid::MathUtils::Integrable.

Definition at line 97 of file spline.cpp.

References antiderivative(), std::vector< T >::begin(), std::vector< T >::end(), Euclid::MathUtils::PiecewiseBase::m_knots, and std::upper_bound().

Here is the call graph for this function:

◆ operator()() [1/2]

void Euclid::MathUtils::CubicInterpolator::operator() ( const std::vector< double > &  xs,
std::vector< double > &  out 
) const
inlineoverride

◆ operator()() [2/2]

double Euclid::MathUtils::CubicInterpolator::operator() ( double  x) const
inlineoverride

Member Data Documentation

◆ m_coef0

std::vector<double> Euclid::MathUtils::CubicInterpolator::m_coef0
private

Definition at line 131 of file spline.cpp.

Referenced by antiderivative(), clone(), operator()(), and operator()().

◆ m_coef1

std::vector<double> Euclid::MathUtils::CubicInterpolator::m_coef1
private

Definition at line 131 of file spline.cpp.

Referenced by antiderivative(), clone(), operator()(), and operator()().

◆ m_coef2

std::vector<double> Euclid::MathUtils::CubicInterpolator::m_coef2
private

Definition at line 131 of file spline.cpp.

Referenced by antiderivative(), clone(), operator()(), and operator()().

◆ m_coef3

std::vector<double> Euclid::MathUtils::CubicInterpolator::m_coef3
private

Definition at line 131 of file spline.cpp.

Referenced by antiderivative(), clone(), operator()(), and operator()().


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