Public Types | Public Member Functions | List of all members
intrp::SpanInterpolator Class Referenceabstract

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< SpanInterpolatorget_clone () const noexcept=0
 Produce a std::unique_ptr that points to a copy of *this`.
 
virtual double interpolate (const gsl::span< const double > &source_points, const gsl::span< const double > &values, double target_point) const noexcept=0
 Perform the interpolation of function represented by values at source_points to the requested target_point, returning the interpolation result.
 
std::complex< double > interpolate (const gsl::span< const double > &source_points, const gsl::span< const std::complex< double >> &values, double target_point) const noexcept
 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 noexcept=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.
 

Detailed Description

Base class for interpolators so that the factory options mechanism can be used.

Details

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.


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