47#ifndef GUM_NUMERICAL_DISCRETE_VARIABLE_H
48#define GUM_NUMERICAL_DISCRETE_VARIABLE_H
81 const std::string& aDesc,
82 const std::vector< double >&
domain);
92 const std::string& aDesc,
168 std::
string stype() const final {
return "NumericalDiscrete"; };
DiscreteVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
std::string toFast() const final
returns the domain size of the discrete random variable
std::string stype() const final
string represent the type 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
bool _checkSameDomain_(const Variable &aRV) const final
check the domain
double numerical(Idx index) const final
get a numerical representation of the value at a given index
NumericalDiscreteVariable(const NumericalDiscreteVariable &from)
Copy constructor.
void addValue(double value)
add a new value to the domain size
std::string closestLabel(double val) const
gives the value closets to val
std::string _generateLabel_(double f) const
Size domainSize() const final
returns the domain size of the discrete random variable
Idx index(const std::string &label) const final
returns the index of a given label
std::string domain() const final
Returns the domain as a string.
NumericalDiscreteVariable(NumericalDiscreteVariable &&from)
move constructor
Idx closestIndex(double val) const final
gives the index of the value closest to val
NumericalDiscreteVariable * clone() const final
virtual copy constructor
void changeValue(double old_value, double new_value)
substitute a value by another one
const std::vector< double > & numericalDomain() const
returns the domain as a sequence of values
bool isValue(double value) const
does this value exist in the domain ?
void eraseValues()
clear the domain of the variable
NumericalDiscreteVariable(const std::string &aName, const std::string &aDesc="")
constructor
void eraseValue(double value)
erase a value from the domain of the variable
std::vector< double > _domain_
the domain of the 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.
gum is the global namespace for all aGrUM entities
Base class for NumericalDiscrete discrete random variables.