23 #ifndef GUM_DISCRETIZED_VARIABLE_H 24 #define GUM_DISCRETIZED_VARIABLE_H 56 template <
typename T_TICKS >
87 Idx _pos(
const T_TICKS& target)
const;
107 const std::string& aDesc,
108 const std::vector< T_TICKS >&
ticks);
143 bool isTick(
const T_TICKS& aTick)
const;
162 virtual std::string
label(
Idx i)
const;
176 virtual const std::string
domain()
const;
180 const T_TICKS&
tick(
Idx i)
const;
183 const std::vector< T_TICKS >&
ticks()
const;
virtual std::vector< double > ticksAsDoubles() const
return the list of ticks as a vector of doubles
std::vector< T_TICKS > __ticks
virtual Idx index(const std::string &label) const
from the label to its index in var.
Class for discretized random variable.
virtual Size domainSize() const
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~DiscretizedVariable()
Destructor.
virtual std::string label(Idx i) const
const std::vector< T_TICKS > & ticks() const
Return the list of ticks.
bool isTick(const T_TICKS &aTick) const
DiscretizedVariable & addTick(const T_TICKS &aTick)
add a tick.
virtual double numerical(Idx indice) const
get a numerical representation of he indice-the value.
DiscretizedVariable(const std::string &aName, const std::string &aDesc)
Constructor.
Idx _pos(const T_TICKS &target) const
seach the class of target (internally use _dichotomy)
DiscretizedVariable< T_TICKS > & operator=(const DiscretizedVariable< T_TICKS > &aDRV)
operator =
const T_TICKS & tick(Idx i) const
from the index to the tick.
void eraseTicks()
erase all the Ticks
virtual DiscretizedVariable< T_TICKS > * clone() const
a virtual clone
Size Idx
Type for indexes.
virtual const std::string domain() const
string represent the domain of the variable
virtual VarType varType() const
returns the type of variable
std::size_t Size
In aGrUM, hashed values are unsigned long int.
void _copy(const DiscretizedVariable< T_TICKS > &aDRV)
make a copy TODO since we removed T_OtherData maybe some changes are needed in this method...
Idx _dichotomy(const T_TICKS &target, Idx min, Idx max) const
perform a dichotomy on ticks
A base class for discretized variables, independent of the ticks type.