54 const std::string& aDesc,
55 const std::vector< int >&
domain) :
58 for (
const auto value:
domain) {
61 "Value '" << value <<
"' is not allowed for variable " <<
toString())
73 const std::string& aDesc,
82 double step = (last - first) /
double(nb - 1);
85 "With nb=" << nb <<
", increment is less (or equal) than 1 ! (" << step <<
")")
91 double current = first;
92 for (
Idx i = 1; i < nb - 1; i++) {
112 for (
Idx i = 1; i < size; ++i)
Exception base for argument error.
Exception : default in label.
DiscreteVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
std::string toString() const
string version of *this
std::string domain() const final
Returns the domain as a string.
Size domainSize() const final
returns the domain size of the discrete random variable
std::vector< int > _domain_
the domain of the variable
IntegerVariable(const std::string &aName, const std::string &aDesc="")
constructor
bool isValue(int value) const
does this value exist in the domain ?
#define GUM_ERROR(type, msg)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size Idx
Type for indexes.
Base class for integer discrete random variables.
Base class for Integer discrete random variables.
gum is the global namespace for all aGrUM entities