Class NearestNeighborInterpolator#

Inheritance Relationships#

Base Type#

Class Documentation#

class NearestNeighborInterpolator : public Karana::Math::BaseInterpolator#

Nearest neighbor interpolation method

Public Functions

NearestNeighborInterpolator(ConstVecSlice indep, ConstVecSlice dep)#

NearestNeighborInterpolator constructor.

Parameters:
  • indep – Monotonically increasing independent variable values

  • dep – Corresponding dependent variable values

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

Sample the dependent variable.

Parameters:

x – A value for the independent variable

Returns:

The corresponding value for the dependent variable

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