42#ifndef GUM_DISCRETIZED_VARIABLE_H
43#define GUM_DISCRETIZED_VARIABLE_H
75 template <
typename T_TICKS >
115 const std::string& aDesc,
116 const std::vector< T_TICKS >&
ticks,
117 bool is_empirical =
false);
193 std::
string stype() const override final {
return "Discretized"; };
200 const std::vector< T_TICKS >&
ticks()
const;
VarType varType() const override
returns the type of variable
DiscretizedVariable< T_TICKS > * clone() const override
a virtual clone
std::string label(Idx i) const override
const T_TICKS & tick(Idx i) const
from the index to the tick.
std::vector< T_TICKS > _ticks_
Size domainSize() const override
std::string domain() const override
string represent the domain of the variable
Idx index(const std::string &label) const override
from the label to its index in var.
DiscretizedVariable(const std::string &aName, const std::string &aDesc)
Constructor.
~DiscretizedVariable() override final
Destructor.
double numerical(Idx indice) const override
get a (deterministic) numerical representation of he indice-the value.
bool isTick(const T_TICKS &aTick) const
const std::vector< T_TICKS > & ticks() const
Return the list of ticks.
void copy_(const DiscretizedVariable< T_TICKS > &aDRV)
make a copy
double draw(Idx indice) const override
get a random value in the intervall indice
DiscretizedVariable(const DiscretizedVariable< T_TICKS > &aDRV)
Copy constructor.
void eraseTicks()
erase all the Ticks
Idx pos_(const T_TICKS &target) const
search the class of target (internally use dichotomy_)
Idx closestIndex(double val) const override
returns the closest index of the value
bool _checkSameDomain_(const Variable &aRV) const override
check the domain
DiscretizedVariable(const std::string &aName, const std::string &aDesc, const std::vector< T_TICKS > &ticks, bool is_empirical=false)
Constructor.
std::string toFast() const override
std::string stype() const override final
string represent the type of the variable
std::vector< double > ticksAsDoubles() const override
return the list of ticks as a vector of doubles
DiscretizedVariable & addTick(const T_TICKS &aTick)
add a tick.
IDiscretizedVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
Base class for every random variable.
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