25 #ifndef GUM_LABELIZED_DISCRETE_VARIABLE_H 26 #define GUM_LABELIZED_DISCRETE_VARIABLE_H 63 const std::string& aDesc =
"",
64 const Size nbrLabel = 2);
73 const std::string& aDesc,
74 const std::vector< std::string >&
labels);
120 bool isLabel(
const std::string& aLabel)
const;
149 virtual std::string
label(
Idx i)
const;
164 virtual const std::string
domain()
const;
192 #ifndef GUM_NO_INLINE virtual double numerical(Idx indice) const
get a numerical representation of he indice-the value.
std::vector< std::string > labels() const
vector of labels
virtual const std::string domain() const
Returns the domain.
void changeLabel(Idx pos, const std::string &aLabel) const
change a label for this index
Base class for discrete random variable.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
Base class for labelized discrete random variables.
virtual std::string label(Idx i) const
returns the ith label
virtual VarType varType() const
returns the type of variable
void eraseLabels()
erase all the labels
virtual Size domainSize() const
returns the size of the random discrete variable domain
Base class for discrete random variable.
virtual ~LabelizedVariable()
destructor
gum is the global namespace for all aGrUM entities
bool isLabel(const std::string &aLabel) const
indicates whether the variable already has the label passed in argument
void _copy(const LabelizedVariable &aLDRV)
copies the content of aLDRV
Sequence< std::string > __labels
the set of labels contained in the variable
Idx posLabel(const std::string &label) const
return the pos from label
virtual LabelizedVariable * clone() const
a virtual clone ...
LabelizedVariable & operator=(const LabelizedVariable &aLDRV)
copy operator
LabelizedVariable()
(protected) Default constructor
Size Idx
Type for indexes.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
LabelizedVariable & addLabel(const std::string &aLabel)
add a label with a new index (we assume that we will NEVER remove a label)
virtual Idx index(const std::string &label) const
returns the index of a given label