26 #ifndef DOXYGEN_SHOULD_SKIP_THIS 43 value = std::stof(str, &pos);
44 }
catch (std::invalid_argument&) {
45 GUM_ERROR(TypeError,
"the value is not a number");
46 }
catch (std::out_of_range&) {
47 GUM_ERROR(OutOfBounds,
"the value is too huge");
51 for (
auto iter = str.begin() + pos, end = str.end(); iter != end; ++iter) {
52 if (!std::isspace(static_cast< unsigned char >(*iter)))
53 GUM_ERROR(TypeError,
"the value is not a number");
60 "the value does not belong to the domain of the variable");
71 value = std::stod(str, &pos);
72 }
catch (std::invalid_argument&) {
73 GUM_ERROR(TypeError,
"the value is not a number");
74 }
catch (std::out_of_range&) {
75 GUM_ERROR(OutOfBounds,
"the value is too huge");
79 for (
auto iter = str.begin() + pos, end = str.end(); iter != end; ++iter) {
80 if (!std::isspace(static_cast< unsigned char >(*iter)))
81 GUM_ERROR(TypeError,
"the value is not a number");
88 "the value does not belong to the domain of the variable");
93 #endif // DOXYGEN_SHOULD_SKIP_THIS GUM_SCALAR operator[](const std::string &str) const
returns the T_VAL corresponding to a string
Header of ContinuousVariable.
gum is the global namespace for all aGrUM entities
#define GUM_ERROR(type, msg)