48#ifndef GUM_DISCRETE_VARIABLE_H
49#define GUM_DISCRETE_VARIABLE_H
119 std::vector< std::string >
labels()
const;
176 virtual std::string
stype()
const = 0;
Base class for discrete random variable.
std::string toStringWithDescription() const
string version of *this using description attribute instead of name.
virtual bool isEmpirical() const
virtual std::string toFast() const =0
DiscreteVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
virtual Idx index(const std::string &label) const =0
DiscreteVariable()
(protected) Default constructor
virtual Idx closestIndex(double val) const =0
for numerical variables, returns the closest index for the value
std::string toString() const
string version of *this
virtual double numerical(Idx indice) const =0
get a numerical representation of the indice-th value.
DiscreteVariable & operator=(const DiscreteVariable &aRV)
Copy operator.
Idx operator[](const std::string &label) const
from the label to its index in var.
std::vector< std::string > labels() const
vector of labels
VarType varType() const override=0
returns the varType of variable
virtual std::string label(Idx i) const =0
get the indice-th label. This method is pure virtual.
~DiscreteVariable() override
destructor
std::string closestLabel(double val) const
for numerical variables, returns the closest label for the value
virtual std::string stype() const =0
string represent the type of the variable
DiscreteVariable * clone() const override=0
Copy Factory.
DiscreteVariable(const DiscreteVariable &aDRV)
Copy constructor.
virtual Size domainSize() const =0
std::string domain() const override=0
string represent the domain of the variable
Variable()
(protected) Default constructor
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
Set< const DiscreteVariable * > VariableSet
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
Base class for random variable.