47#ifndef GUM_LABELIZED_DISCRETE_VARIABLE_H
48#define GUM_LABELIZED_DISCRETE_VARIABLE_H
93 std::string_view aDesc,
94 const std::vector< std::string >&
labels);
DiscreteVariable(std::string_view aName, std::string_view aDesc)
Default constructor.
std::vector< std::string > labels() const
vector of labels
Idx closestIndex(double val) const final
returns the closest index of the value
std::string domain() const final
Returns the domain.
void eraseLabels()
erase all the labels
void changeLabel(Idx pos, std::string_view aLabel) const
change a label for this index
LabelizedVariable * clone() const final
a virtual clone ...
LabelizedVariable(std::string_view aName, std::string_view aDesc="", const Size nbrLabel=2)
constructor
LabelizedVariable & addLabel(std::string_view aLabel)
add a label with a new index (we assume that we will NEVER remove a label)
void copy_(const LabelizedVariable &aLDRV)
copies the content of aLDRV
bool isLabel(std::string_view aLabel) const
indicates whether the variable already has the label passed in argument
Idx index(std::string_view label) const final
returns the index of a given label
LabelizedVariable(const LabelizedVariable &aLDRV)
Copy constructor.
double numerical(Idx index) const final
get a numerical representation of the index-the value.
Idx posLabel(std::string_view label) const
return the pos from label
Size domainSize() const final
returns the size of the random discrete variable domain
LabelizedVariable(std::string_view aName, std::string_view aDesc, const std::vector< std::string > &labels)
constructor
VarType varType() const final
returns the type of variable
~LabelizedVariable() final
destructor
bool _checkSameDomain_(const Variable &aRV) const final
check the domain
Sequence< std::string > _labels_
the set of labels contained in the variable
std::string label(Idx i) const final
returns the ith label
std::string toFast() const final
indicates whether the variable already has the label passed in argument
std::string stype() const final
string represent the type of the variable
The generic class for storing (ordered) sequences of objects.
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 labelized discrete random variables.
gum is the global namespace for all aGrUM entities
Header file of gum::Sequence, a class for storing (ordered) sequences of objects.