47#ifndef GUM_INTEGER_DISCRETE_VARIABLE_H
48#define GUM_INTEGER_DISCRETE_VARIABLE_H
81 std::string_view aDesc,
82 const std::vector< int >&
domain);
91 IntegerVariable(std::string_view aName, std::string_view aDesc,
int first,
int last,
Size nb);
158 std::string
domain()
const override;
DiscreteVariable(std::string_view aName, std::string_view aDesc)
Default constructor.
bool _checkSameDomain_(const Variable &aRV) const override
check the domain
IntegerVariable(IntegerVariable &&from) noexcept
move constructor
IntegerVariable & operator=(const IntegerVariable &from)
copy operator
std::vector< int > _domain_
the domain of the variable
Size domainSize() const override
returns the domain size of the discrete random variable
Idx index(std::string_view label) const override
returns the index of a given label
std::string closestLabel(double val) const override
gives the value closets to val
void addValue(int value)
add a new value to the domain size
double numerical(Idx index) const override
get an integer representation of the value at a given index
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
IntegerVariable & operator=(IntegerVariable &&from)
move operator
void eraseValues()
clear the domain of the variable
std::string stype() const override
string represent the type of the variable
IntegerVariable(std::string_view aName, std::string_view aDesc="")
constructor
IntegerVariable * clone() const override
virtual copy constructor
Idx closestIndex(double val) const override
returns the closest index of the value
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 label(Idx index) const override
returns a string corresponding to the ith value of the domain
VarType varType() const override
returns the type of variable
~IntegerVariable() override
destructor
std::string domain() const override
Returns the domain as a string.
std::string toFast() const override
returns the domain size of the discrete random variable
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