47#ifndef GUM_INTEGER_DISCRETE_VARIABLE_H
48#define GUM_INTEGER_DISCRETE_VARIABLE_H
81 const std::string& aDesc,
82 const std::vector< int >&
domain);
92 const std::string& aDesc,
165 std::
string stype() const final {
return "Integer"; };
DiscreteVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
Idx closestIndex(double val) const final
returns the closest index of the value
IntegerVariable(IntegerVariable &&from) noexcept
move constructor
std::string domain() const final
Returns the domain as a string.
Size domainSize() const final
returns the domain size of the discrete random variable
std::vector< int > _domain_
the domain of the variable
Idx index(const std::string &label) const final
returns the index of a given label
bool _checkSameDomain_(const Variable &aRV) const final
check the domain
void addValue(int value)
add a new value to the domain size
std::string closestLabel(double val) const
gives the value closets to val
std::string stype() const final
string represent the type of the variable
IntegerVariable(const std::string &aName, const std::string &aDesc="")
constructor
bool isValue(int value) const
does this value exist in the domain ?
void eraseValue(int value)
erase a value from the domain of the variable
void eraseValues()
clear the domain of the variable
std::string label(Idx index) const final
returns a string corresponding to the ith value of the domain
VarType varType() const final
returns the type of variable
IntegerVariable(const IntegerVariable &from)
Copy constructor.
const std::vector< int > & integerDomain() const
returns the domain as a sequence of values
void changeValue(int old_value, int new_value)
substitute a value by another one
std::string toFast() const final
returns the domain size of the discrete random variable
double numerical(Idx index) const final
get a integer representation of the value at a given index
IntegerVariable * clone() const final
virtual copy constructor
Base class for every random variable.
Base class for discrete random variable.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Base class for Integer discrete random variables.
gum is the global namespace for all aGrUM entities