29 #ifndef GUM_CONTINUOUS_VARIABLE_H 30 #define GUM_CONTINUOUS_VARIABLE_H 46 template <
typename GUM_SCALAR =
float >
60 const std::string& aName,
61 const std::string& aDesc,
62 GUM_SCALAR lower_bound = -std::numeric_limits< GUM_SCALAR >::infinity(),
63 GUM_SCALAR upper_bound = std::numeric_limits< GUM_SCALAR >::infinity());
69 template <
typename TX_VAL >
96 template <
typename TX_VAL >
108 GUM_SCALAR
operator[](
const std::string& str)
const;
157 virtual std::string
label(
const GUM_SCALAR& value)
const;
160 bool belongs(
const GUM_SCALAR& value)
const;
163 virtual const std::string
domain()
const;
184 template <
typename TX_VAL >
190 template <
typename T_VAL >
191 std::ostream& operator<<(std::ostream&, const ContinuousVariable< T_VAL >&);
207 #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
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual VarType varType() const
returns the type of the variable
GUM_SCALAR upperBound() const
returns the upper bound of the domain of the variable
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual ~ContinuousVariable()
destructor
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.