Class AkimaSplineInterpolator#

Inheritance Relationships#

Base Type#

Class Documentation#

class AkimaSplineInterpolator : public Karana::Math::BaseInterpolator#

Akima spline interpolation method

Uses a piecewise-cubic spline well-suited to cases where the underlying data has a rapidly varying second derivative.

Public Types

enum class Extrapolation#

How to extrapolate when sampling past the given data points

Values:

enumerator CONSTANT#

Use the value of the boundary data point.

enumerator LINEAR#

Linearly extend from the boundary point.

enumerator CUBIC#

Extend the boundary cubic spline segment.

Public Functions

AkimaSplineInterpolator(ConstVecSlice indep, ConstVecSlice dep, std::optional<Extrapolation> extrapolation = std::nullopt)#

AkimaSplineInterpolator constructor.

Parameters:
  • indep – Strictly increasing independent variable values

  • dep – Corresponding dependent variable values

  • extrapolation – How to extrapolate outside the data points. If omitted, extrapolated values are NaN.

AkimaSplineInterpolator(const AkimaSplineInterpolator&)#

Copy constructor.

AkimaSplineInterpolator &operator=(const AkimaSplineInterpolator&)#

Copy assignment operator.

Returns:

A reference the recently assigned to ConstantInterpolator.

virtual double operator()(double x) const override#

Call operator to do interpolation.

Parameters:

x – The value to interpolate at.

Returns:

The interpolated value.

virtual void operator()(ConstVecSlice x, VecSlice out) const#

Sample the dependent variable at multiple values.

Parameters:
  • x – A vector containing values for the independent variable

  • out – A matching sized vector to contain the result

virtual Vec operator()(ConstVecSlice x) const#

Sample the dependent variable at multiple values.

Parameters:

x – A vector containing values for the independent variable

Returns:

A corresponding vector of dependent variable values