42#ifndef GUM_DISCRETIZED_VARIABLE_H
43#define GUM_DISCRETIZED_VARIABLE_H
75 template <
typename T_TICKS >
115 std::string_view aDesc,
116 const std::vector< T_TICKS >&
ticks,
117 bool is_empirical =
false);
222#include <agrum/base/variables/discretizedVariable_tpl.h>
VarType varType() const override
returns the type of variable
DiscretizedVariable< T_TICKS > * clone() const override
a virtual clone
std::string stype() const final
string represent the type of the variable
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
DiscretizedVariable(std::string_view aName, std::string_view aDesc)
Constructor.
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() final
Destructor.
DiscretizedVariable(const DiscretizedVariable< T_TICKS > &aDRV)
Copy constructor.
DiscretizedVariable(std::string_view aName, std::string_view aDesc, const std::vector< T_TICKS > &ticks, bool is_empirical=false)
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
std::string toFast() const override
Idx index(std::string_view label) const override
from the label to its index in var.
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(std::string_view aName, std::string_view 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