1 #ifndef GRAIL_SINGLE_STEP_FUNCTION_H
2 #define GRAIL_SINGLE_STEP_FUNCTION_H
11 template <
typename ContextType>
27 float threshold,
float beforeThresholdValue,
float afterThresholdValue)
28 :
Curve<ContextType>{childEvaluator},
29 threshold{ threshold }, beforeThresholdValue{ beforeThresholdValue }, afterThresholdValue{ afterThresholdValue }
33 virtual float Sample(
float argument)
const override final
35 return argument > threshold ? afterThresholdValue : beforeThresholdValue;
54 EvaluatorType GetEvaluatorType() const override final {
return EvaluatorType::CURVE_UNIT_STEP; }
57 float threshold = 0.0f;
58 float beforeThresholdValue = 0.0f;
59 float afterThresholdValue = 0.0f;
The Curve class - Defines objects transforming one value into the other.
Definition: Curve.hh:21
The UnitStepFunction class - Unit Step Function.
Definition: UnitStepFunction.hh:17
float GetBeforeThresholdValue() const
GetBeforeThresholdValue.
Definition: UnitStepFunction.hh:47
float GetAfterThresholdValue() const
GetAfterThresholdValue.
Definition: UnitStepFunction.hh:52
float GetThreshold() const
GetThreshold.
Definition: UnitStepFunction.hh:42
virtual float Sample(float argument) const override final
Sample - Transforms argument into output value depending on the type of Curve.
Definition: UnitStepFunction.hh:33
UnitStepFunction(std::shared_ptr< utility::Evaluator< ContextType >> childEvaluator, float threshold, float beforeThresholdValue, float afterThresholdValue)
UnitStepFunction - Constructor.
Definition: UnitStepFunction.hh:26
The Evaluator class - base class being able to evaluate given context and output the result.
Definition: Evaluator.hh:21