51#ifndef DOXYGEN_SHOULD_SKIP_THIS
68 value = std::stof(s, &pos);
69 }
catch (std::invalid_argument&) {
70 GUM_ERROR(TypeError,
"the value is not a number")
71 }
catch (std::out_of_range&) {
GUM_ERROR(OutOfBounds,
"the value is too huge") }
74 for (
auto iter = str.begin() + pos, end = str.end(); iter != end; ++iter) {
75 if (!std::isspace(
static_cast< unsigned char >(*iter)))
76 GUM_ERROR(TypeError,
"the value is not a number")
79 if (belongs(value))
return value;
80 else GUM_ERROR(OutOfBounds,
"the value does not belong to the domain of the variable")
90 value = std::stod(s, &pos);
91 }
catch (std::invalid_argument&) {
92 GUM_ERROR(TypeError,
"the value is not a number")
93 }
catch (std::out_of_range&) {
GUM_ERROR(OutOfBounds,
"the value is too huge") }
96 for (
auto iter = str.begin() + pos, end = str.end(); iter != end; ++iter) {
97 if (!std::isspace(
static_cast< unsigned char >(*iter)))
98 GUM_ERROR(TypeError,
"the value is not a number")
101 if (belongs(value))
return value;
102 else GUM_ERROR(OutOfBounds,
"the value does not belong to the domain of the variable")
GUM_SCALAR operator[](std::string_view str) const
returns the T_VAL corresponding to a string
Header of ContinuousVariable.
#define GUM_ERROR(type, msg)
gum is the global namespace for all aGrUM entities