SpECTRE
v2024.09.29

Base class for interpolators so that the factory options mechanism can be used. More...
#include <SpanInterpolator.hpp>
Public Types  
using  creatable_classes = tmpl::list< LinearSpanInterpolator, CubicSpanInterpolator, BarycentricRationalSpanInterpolator > 
Public Member Functions  
WRAPPED_PUPable_abstract (SpanInterpolator)  
virtual std::unique_ptr< SpanInterpolator >  get_clone () const =0 
Produce a std::unique_ptr that points to a copy of *this `. More...  
virtual double  interpolate (const gsl::span< const double > &source_points, const gsl::span< const double > &values, double target_point) const =0 
Perform the interpolation of function represented by values at source_points to the requested target_point , returning the interpolation result. More...  
std::complex< double >  interpolate (const gsl::span< const double > &source_points, const gsl::span< const std::complex< double > > &values, double target_point) const 
Perform the interpolation of function represented by complex values at source_points to the requested target_point , returning the (complex) interpolation result.  
virtual size_t  required_number_of_points_before_and_after () const =0 
The number of domain points that should be both before and after the requested target point for best interpolation. For instance, for a linear interpolator, this function would return 1 to request that the target is between the two domain points passed to source_points . More...  
Base class for interpolators so that the factory options mechanism can be used.
The virtual functions in this class demand only that the real interpolate
function, get_clone
function, and required_number_of_points_before_and_after
function be overridden in the derived class. The interpolate
for complex values can just be used from this base class, which calls the real version for each component. If it is possible to make a specialized complex version that avoids allocations, that is probably more efficient.

pure virtual 
Produce a std::unique_ptr
that points to a copy of *this
`.
Implemented in intrp::BarycentricRationalSpanInterpolator, intrp::CubicSpanInterpolator, and intrp::LinearSpanInterpolator.

pure virtual 
Perform the interpolation of function represented by values
at source_points
to the requested target_point
, returning the interpolation result.
Implemented in intrp::BarycentricRationalSpanInterpolator, intrp::CubicSpanInterpolator, intrp::LinearSpanInterpolator, and intrp::BarycentricRationalSpanInterpolator.

pure virtual 
The number of domain points that should be both before and after the requested target point for best interpolation. For instance, for a linear interpolator, this function would return 1
to request that the target is between the two domain points passed to source_points
.
Implemented in intrp::BarycentricRationalSpanInterpolator, intrp::CubicSpanInterpolator, and intrp::LinearSpanInterpolator.