26 #ifndef GUM_CONTINUOUS_VARIABLE_H 27 #define GUM_CONTINUOUS_VARIABLE_H 43 template <
typename GUM_SCALAR =
float >
57 const std::string& aName,
58 const std::string& aDesc,
59 GUM_SCALAR lower_bound = -std::numeric_limits< GUM_SCALAR >::infinity(),
60 GUM_SCALAR upper_bound = std::numeric_limits< GUM_SCALAR >::infinity());
66 template <
typename TX_VAL >
93 template <
typename TX_VAL >
105 GUM_SCALAR
operator[](
const std::string& str)
const;
154 virtual std::string
label(
const GUM_SCALAR& value)
const;
157 bool belongs(
const GUM_SCALAR& value)
const;
160 virtual const std::string
domain()
const;
181 template <
typename TX_VAL >
187 template <
typename T_VAL >
188 std::ostream& operator<<(std::ostream&, const ContinuousVariable< T_VAL >&);
204 #ifndef GUM_NO_INLINE const std::string toStringWithDescription() const
string version of *this using description attribute instead of name.
virtual std::string label(const GUM_SCALAR &value) const
returns a string containing the value of the variable passed in argument
Defines a continuous random variable.
GUM_SCALAR operator[](const std::string &str) const
returns the T_VAL corresponding to a string
virtual double upperBoundAsDouble() const
returns the upper bound of the domain of the variable as a double
virtual double lowerBoundAsDouble() const
returns the lower bound of the domain of the variable as a double
A base class for continuous variables, independent of the GUM_SCALAR type.
const std::string toString() const
string version of *this
ContinuousVariable< GUM_SCALAR > & operator=(const ContinuousVariable< GUM_SCALAR > &from)
copy operator
gum is the global namespace for all aGrUM entities
virtual const std::string domain() const
returns the domain of the variable as a string
GUM_SCALAR lowerBound() const
returns the lower bound of the domain of the variable
virtual void setLowerBoundFromDouble(const double new_bound)
updates the lower bound of the domain of the variable
friend class ContinuousVariable
virtual void setUpperBoundFromDouble(const double new_bound)
updates the lower bound of the domain of the variable
bool belongs(const GUM_SCALAR &value) const
Returns true if the param belongs to the domain of the variable.
void setUpperBound(const GUM_SCALAR &new_bound)
updates the lower bound of the domain of the variable
void setLowerBound(const GUM_SCALAR &new_bound)
updates the lower bound of the domain of the variable
virtual ContinuousVariable< GUM_SCALAR > * clone() const
Copy Factory.
Header of IContinuousVariable.
virtual VarType varType() const
returns the type of the variable
GUM_SCALAR upperBound() const
returns the upper bound of the domain of the variable
virtual ~ContinuousVariable()
destructor
The databases' cell translators for continuous variables.