Class LinearInterpolator#
Defined in File Interpolation.h
Inheritance Relationships#
Base Type#
public Karana::Math::BaseInterpolator(Class BaseInterpolator)
Class Documentation#
-
class LinearInterpolator : public Karana::Math::BaseInterpolator#
Piecewise linear interpolation method
Public Types
Public Functions
-
LinearInterpolator(ConstVecSlice indep, ConstVecSlice dep, std::optional<Extrapolation> extrapolation = std::nullopt)#
LinearInterpolator constructor.
- Parameters:
indep – Monotonically increasing independent variable values
dep – Corresponding dependent variable values
extrapolation – How to extrapolate outside the data points. If omitted, extrapolated values are NaN.
-
LinearInterpolator(const LinearInterpolator&) = default#
Copy constructor.
-
LinearInterpolator &operator=(const LinearInterpolator&) = 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.
-
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
-
LinearInterpolator(ConstVecSlice indep, ConstVecSlice dep, std::optional<Extrapolation> extrapolation = std::nullopt)#