28 #ifndef GUM_LABELIZED_DISCRETE_VARIABLE_H 29 #define GUM_LABELIZED_DISCRETE_VARIABLE_H 66 const std::string& aDesc =
"",
67 const Size nbrLabel = 2);
76 const std::string& aDesc,
77 const std::vector< std::string >&
labels);
123 bool isLabel(
const std::string& aLabel)
const;
152 virtual std::string
label(
Idx i)
const;
167 virtual const std::string
domain()
const;
195 #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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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