43#ifndef DOXYGEN_SHOULD_SKIP_THIS
60 GUM_CONSTRUCTOR(DiscreteVariable)
64 INLINE DiscreteVariable::DiscreteVariable(
const DiscreteVariable& aDRV) : Variable(aDRV) {
65 GUM_CONSTRUCTOR(DiscreteVariable)
69 INLINE DiscreteVariable::~DiscreteVariable() { GUM_DESTRUCTOR(DiscreteVariable) }
72 INLINE DiscreteVariable& DiscreteVariable::operator=(
const DiscreteVariable& aRV) {
73 if (&aRV !=
this) { Variable::operator=(aRV); }
79 INLINE
bool DiscreteVariable::empty()
const {
return domainSize() < 2; }
81 INLINE std::string DiscreteVariable::closestLabel(
double val)
const {
82 return label(closestIndex(val));
86 INLINE std::vector< std::string > DiscreteVariable::labels()
const {
87 std::vector< std::string > v;
88 for (Idx i = 0; i < domainSize(); i++)
89 v.push_back(label(i));
DiscreteVariable()
(protected) Default constructor
Base class for every random variable.
Base class for discrete random variable.
gum is the global namespace for all aGrUM entities