18#ifndef OPALX_ABSTRACTSPLINE_H
19#define OPALX_ABSTRACTSPLINE_H
49 virtual void init(
const std::vector<double>& x,
const std::vector<double>& y);
70 size_t findInterval(
double x,
size_t& intervalCache)
const;
73 std::vector<double>
x_{};
74 std::vector<double>
y_{};
Accelerator caching last interval indices.
Base class for the linear and cubic interpolation spline classes.
virtual double eval(double x, Accelerator &accel) const =0
Evaluate the spline at x using an accelerator.
virtual void init(const std::vector< double > &x, const std::vector< double > &y)
Initialize from tabulated data (natural spline).
size_t findInterval(double x, size_t &intervalCache) const
Return the interval index for the given x-coordinate, using the supplied cached value if possible.
AbstractSpline()=default
Default constructor.
virtual double evalIntegral(double xa, double xb, Accelerator &accel) const =0
Evaluate the integral of the spline at x.
virtual ~AbstractSpline()=default
Polymorphic destructor.