Class ConstantInterpolator#

Inheritance Relationships#

Base Type#

Class Documentation#

class ConstantInterpolator : public Karana::Math::BaseInterpolator#

Constant value implementation of BaseInterpolator

This just interpolates to the same constant value everywhere, which may be useful when a BaseInterpolator is expected but only a constant value is needed.

Public Functions

ConstantInterpolator(double constant)#

ConstantInterpolator constructor.

Parameters:

constant – The constant value to use

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 Vec operator()(ConstVecSlice x) const override#

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

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

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