27 #ifndef GUM_LINEAR_APPROXIMATION_POLICY_H 28 #define GUM_LINEAR_APPROXIMATION_POLICY_H 51 template <
typename GUM_SCALAR >
69 GUM_SCALAR high = (GUM_SCALAR)1.0,
70 GUM_SCALAR eps = (GUM_SCALAR)0.1);
90 GUM_SCALAR
fromExact(
const GUM_SCALAR& value)
const;
148 Idx encode(
const GUM_SCALAR& value)
const;
156 GUM_SCALAR
decode(
Idx representation)
const;
170 virtual void setLimits(
const GUM_SCALAR& newLowLimit,
171 const GUM_SCALAR& newHighLimit);
178 virtual void setLowLimit(
const GUM_SCALAR& newLowLimit);
191 virtual void setHighLimit(
const GUM_SCALAR& newHighLimit);
226 GUM_SCALAR
__decode(
const GUM_SCALAR& representation)
const;
239 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS void combineSub(const ApproximationPolicy< GUM_SCALAR > *ap)
Combine using substraction with the given gum::ApproximationPolicy.
virtual void setEpsilon(const GUM_SCALAR &e)
Sets approximation factor.
Idx __encode(const GUM_SCALAR &value) const
Concretely computes the approximate representation.
GUM_SCALAR _lowLimit
Lowest value possible.
void combineDiv(const ApproximationPolicy< GUM_SCALAR > *ap)
Combine using division with the given gum::ApproximationPolicy.
GUM_SCALAR _epsilon
Approximation factor.
void combineMin(const ApproximationPolicy< GUM_SCALAR > *ap)
Combine using min with the given gum::ApproximationPolicy.
virtual void setLimits(const GUM_SCALAR &newLowLimit, const GUM_SCALAR &newHighLimit)
Set bounds in a whole.
gum is the global namespace for all aGrUM entities
const GUM_SCALAR & highLimit() const
Gets Highest possible value.
GUM_SCALAR __decode(const GUM_SCALAR &representation) const
Concretely computes the approximate value from representation.
Idx encode(const GUM_SCALAR &value) const
Encode a given value into its approximation representation.
GUM_SCALAR _highLimit
Highest value possible.
Idx _nbInterval
The number of interval.
virtual void setHighLimit(const GUM_SCALAR &newHighLimit)
Sets Highest possible value.
const GUM_SCALAR & lowLimit() const
Gets lowest possible value.
LinearApproximationPolicy(GUM_SCALAR low=(GUM_SCALAR) 0.0, GUM_SCALAR high=(GUM_SCALAR) 1.0, GUM_SCALAR eps=(GUM_SCALAR) 0.1)
Default constructor.
void combineMult(const ApproximationPolicy< GUM_SCALAR > *ap)
Combine using multiplication with the given gum::ApproximationPolicy.
Classes used to practice approximation on value.
Size Idx
Type for indexes.
Inlined implementation of gum::LienarApproxiationPolicy.
Class implementing linear approximation policy (meaning possible value are split out in interval)...
GUM_SCALAR decode(Idx representation) const
Convert approximation representation to value.
GUM_SCALAR safeFromExact(const GUM_SCALAR &value)
Convert value to his approximation.
void combineMax(const ApproximationPolicy< GUM_SCALAR > *ap)
Combine using max with the given gum::ApproximationPolicy.
Mother class for all approximation policy classes.
virtual void setLowLimit(const GUM_SCALAR &newLowLimit)
Sets lowest possible value.
void combineAdd(const ApproximationPolicy< GUM_SCALAR > *ap)
Combine using addition with the given gum::ApproximationPolicy.
GUM_SCALAR fromExact(const GUM_SCALAR &value) const
Convert value to his approximation.
void _computeNbInterval()
Get the number of interval.