Class CubicHermiteInterpolator#
Defined in File Interpolation.h
Inheritance Relationships#
Base Type#
public Karana::Math::BaseInterpolator(Class BaseInterpolator)
Class Documentation#
-
class CubicHermiteInterpolator : public Karana::Math::BaseInterpolator#
Interpolate using a cubic Hermite spline.
Public Types
Public Functions
-
CubicHermiteInterpolator(ConstVecSlice indep, ConstVecSlice dep, std::optional<Extrapolation> extrapolation = std::nullopt, std::optional<ConstVecSlice> deriv = std::nullopt)#
CubicHermiteInterpolator 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.
deriv – Derivative at each indep value; computed using finite difference if omitted.
-
CubicHermiteInterpolator(const CubicHermiteInterpolator&) = default#
Copy constructor.
-
CubicHermiteInterpolator &operator=(const CubicHermiteInterpolator&) = default#
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.
-
ConstVecSlice derivatives() const#
Derivatives at each indep value.
- Returns:
A vector containing the derivatives
-
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
-
CubicHermiteInterpolator(ConstVecSlice indep, ConstVecSlice dep, std::optional<Extrapolation> extrapolation = std::nullopt, std::optional<ConstVecSlice> deriv = std::nullopt)#