Alexandria 2.31.2
SDC-CH common library for the Euclid project
Loading...
Searching...
No Matches
Euclid::MathUtils::InterpN< T, Rest... > Class Template Reference
Collaboration diagram for Euclid::MathUtils::InterpN< T, Rest... >:

Public Member Functions

 InterpN (const std::tuple< std::vector< T >, std::vector< Rest >... > &grid, const NdArray::NdArray< double > &values, bool extrapolate)
 
double operator() (T x, Rest... rest) const
 
 InterpN (const InterpN &other)
 Copy constructor.
 

Private Attributes

std::vector< T > m_knots
 
std::vector< std::unique_ptr< InterpN< Rest... > > > m_interpolators
 
bool m_extrapolate
 

Detailed Description

template<typename T, typename... Rest>
class Euclid::MathUtils::InterpN< T, Rest... >

Recursive specialization of an N-Dimensional interpolator

Template Parameters
NDimensionality (N > 1)
FThe first element of the index sequence
RestThe rest of the elements from the index sequence

Definition at line 172 of file GridInterpolation.icpp.

Constructor & Destructor Documentation

◆ InterpN() [1/2]

template<typename T , typename... Rest>
Euclid::MathUtils::InterpN< T, Rest... >::InterpN ( const std::tuple< std::vector< T >, std::vector< Rest >... > & grid,
const NdArray::NdArray< double > & values,
bool extrapolate )
inline

Constructor

Parameters
grid
values
type
extrapolate

Definition at line 181 of file GridInterpolation.icpp.

References std::vector< T >::back(), std::move(), Euclid::NdArray::NdArray< T >::rslice(), Euclid::NdArray::NdArray< T >::shape(), std::vector< T >::size(), and Euclid::Tuple::Tail().

Here is the call graph for this function:

◆ InterpN() [2/2]

template<typename T , typename... Rest>
Euclid::MathUtils::InterpN< T, Rest... >::InterpN ( const InterpN< T, Rest... > & other)
inline

Copy constructor.

Definition at line 220 of file GridInterpolation.icpp.

Member Function Documentation

◆ operator()()

template<typename T , typename... Rest>
double Euclid::MathUtils::InterpN< T, Rest... >::operator() ( T x,
Rest... rest ) const
inline

Call as a function

Parameters
xValue for the axis for the first dimension
restValues for the next set of axes
Returns
The interpolated value

Doubles<Rest>... is used to expand into (N-1) doubles x is used to find the interpolators for x1 and x2 s.t. x1 <= x <=x2 Those two interpolators are used to compute y1 for x1, and y2 for x2 (based on the rest of the parameters) A final linear interpolator is used to get the value of y at the position x

Definition at line 215 of file GridInterpolation.icpp.

Member Data Documentation

◆ m_extrapolate

template<typename T , typename... Rest>
bool Euclid::MathUtils::InterpN< T, Rest... >::m_extrapolate
private

Definition at line 230 of file GridInterpolation.icpp.

◆ m_interpolators

template<typename T , typename... Rest>
std::vector<std::unique_ptr<InterpN<Rest...> > > Euclid::MathUtils::InterpN< T, Rest... >::m_interpolators
private

Definition at line 229 of file GridInterpolation.icpp.

◆ m_knots

template<typename T , typename... Rest>
std::vector<T> Euclid::MathUtils::InterpN< T, Rest... >::m_knots
private

Definition at line 228 of file GridInterpolation.icpp.


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