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::InterpN< T, Rest...> Class Template Reference
Collaboration diagram for Euclid::MathUtils::InterpN< T, Rest...>:
Collaboration graph
[legend]

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. More...
 

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

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(), N, 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:

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

template<typename T , typename... Rest>
double Euclid::MathUtils::InterpN< T, Rest...>::operator() ( 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.

References Euclid::MathUtils::interpolate().

Here is the call graph for this function:

Member Data Documentation

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

Definition at line 230 of file GridInterpolation.icpp.

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.

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: