occ
Loading...
Searching...
No Matches
occ::core::Interpolator1D< T, mapping > Class Template Reference

Class for interpolating one-dimensional functions. More...

#include <interpolator.h>

Public Member Functions

 Interpolator1D ()
 Default constructor.
 
template<typename F >
 Interpolator1D (const F &f, T left, T right, size_t N)
 Construct an Interpolator1D from a given function.
 
OCC_ALWAYS_INLINE T operator() (T x) const
 Evaluate the interpolated function at the value provided.
 
OCC_ALWAYS_INLINE T gradient (T x) const
 
Eigen::Array< T, Eigen::Dynamic, 1 > operator() (const Eigen::Array< T, Eigen::Dynamic, 1 > &xs) const
 
T find_threshold (T threshold_value) const
 

Detailed Description

template<typename T, DomainMapping mapping = Linear>
class occ::core::Interpolator1D< T, mapping >

Class for interpolating one-dimensional functions.

Templated by the type of data to be interpolated, and the DomainMapping (default = Linear)

Constructor & Destructor Documentation

◆ Interpolator1D() [1/2]

template<typename T , DomainMapping mapping = Linear>
occ::core::Interpolator1D< T, mapping >::Interpolator1D ( )
inline

Default constructor.

◆ Interpolator1D() [2/2]

template<typename T , DomainMapping mapping = Linear>
template<typename F >
occ::core::Interpolator1D< T, mapping >::Interpolator1D ( const F &  f,
T  left,
T  right,
size_t  N 
)
inline

Construct an Interpolator1D from a given function.

Parameters
fthe function to interpolate
leftthe lowest (left most) value in the domain
rightthe highest (right most) value in the domain
Nthe number of points to sample in the domain [left, right]

Will evaluate the function f N times, and map the domain values internally based on the specified DomainMapping....

Member Function Documentation

◆ find_threshold()

template<typename T , DomainMapping mapping = Linear>
T occ::core::Interpolator1D< T, mapping >::find_threshold ( T  threshold_value) const
inline

◆ gradient()

template<typename T , DomainMapping mapping = Linear>
OCC_ALWAYS_INLINE T occ::core::Interpolator1D< T, mapping >::gradient ( T  x) const
inline

◆ operator()() [1/2]

template<typename T , DomainMapping mapping = Linear>
Eigen::Array< T, Eigen::Dynamic, 1 > occ::core::Interpolator1D< T, mapping >::operator() ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  xs) const
inline

◆ operator()() [2/2]

template<typename T , DomainMapping mapping = Linear>
OCC_ALWAYS_INLINE T occ::core::Interpolator1D< T, mapping >::operator() ( T  x) const
inline

Evaluate the interpolated function at the value provided.

Parameters
xthe value where the interpolated function should be evaluated.

The provided value will be mapped based on DomainMapping. If the provided value falls outside the domain, it will be yield the f(left) and f(right) values from the original construction of the Interpolator1D.


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