22 #ifndef CRNCubicSpline_HEADER
23 #define CRNCubicSpline_HEADER
52 data(std::distance(beg, en)),
58 for (Iter tmp = beg; tmp != en; ++tmp)
59 data[cnt++] = makePoint(*tmp);
72 virtual double operator[](
double x)
const override;
74 using Cartesian2DFunction::operator[];
77 const std::vector<crn::Point2DDouble>&
GetData() const noexcept {
return data; }
87 template<
typename T,
typename Y> Point2DDouble makePoint(
const std::pair<T, Y> &p)
92 std::vector<double> z;
93 std::vector<crn::Point2DDouble> data;
void SetExtrapolationMode(Extrapolation ex) noexcept
Sets the behaviour for points before the first control point and after the last control point...
CubicSpline(Iter beg, Iter en)
Constructor from a list of points.
CubicSpline & operator=(const CubicSpline &)=default
virtual double operator[](double x) const override
Gets ordinate at x.
virtual ~CubicSpline() override
Extrapolation
Extrapolation modes.
Cubic spline interpolation.
Base class for 2D functions.
#define CRN_DECLARE_CLASS_CONSTRUCTOR(classname)
Declares a class constructor.
CRN_ALIAS_SMART_PTR(ImageBW)
const std::vector< crn::Point2DDouble > & GetData() const noexcept
Access to the sorted control point.