70 long target =
static_cast< long >(indice) +
_minBound_;
72 std::stringstream strBuff;
86 std::istringstream i(
label);
97 int res =
static_cast< int >(std::rint(val));
98 if (res - val == 0.5) res--;
140 if (
_minBound_ != cv._minBound_)
return false;
141 if (
_maxBound_ != cv._maxBound_)
return false;
Exception : the element we looked for cannot be found.
Exception : out of bound.
void setMaxVal(long maxVal)
Set a new value of the upper bound.
RangeVariable * clone() const final
Copy Factory.
Idx index(const std::string &) const final
Idx closestIndex(double val) const final
returns the closest index of the value
std::string label(Idx index) const final
Get the index-th label.
long maxVal() const
Returns the upper bound.
long _minBound_
The upper bound.
bool belongs(long val) const
Returns true if the param belongs to the variable's interval.
bool _checkSameDomain_(const Variable &aRV) const final
check the domain
void setMinVal(long minVal)
Set a new value for the lower bound.
Size domainSize() const final
returns the size of the random discrete variable domain
VarType varType() const final
returns the type of variable
RangeVariable & operator=(const RangeVariable &aRV)
Copy operator.
double numerical(Idx index) const final
get a numerical representation of the index-the value.
RangeVariable(const std::string &aName, const std::string &aDesc, long minVal, long maxVal)
constructors
long minVal() const
Returns the lower bound.
long _maxBound_
The upper bound.
Base class for every random variable.
#define GUM_ERROR(type, msg)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
gum is the global namespace for all aGrUM entities
Header of gumRangeVariable.