35 #ifndef DOXYGEN_SHOULD_SKIP_THIS 41 template <
typename GUM_SCALAR >
44 const std::string& aDesc,
45 GUM_SCALAR lower_bound,
46 GUM_SCALAR upper_bound) :
47 IContinuousVariable(aName, aDesc),
48 __lower_bound(lower_bound), __upper_bound(upper_bound) {
55 template <
typename GUM_SCALAR >
57 const ContinuousVariable< GUM_SCALAR >& from) :
65 template <
typename GUM_SCALAR >
66 template <
typename TX_VAL >
68 const ContinuousVariable< TX_VAL >& from) :
77 template <
typename GUM_SCALAR >
79 ContinuousVariable< GUM_SCALAR >&& from) :
87 template <
typename GUM_SCALAR >
94 template <
typename GUM_SCALAR >
95 INLINE ContinuousVariable< GUM_SCALAR >*
97 return new ContinuousVariable< GUM_SCALAR >(*this);
102 template <
typename GUM_SCALAR >
104 operator=(
const ContinuousVariable< GUM_SCALAR >& from) {
113 template <
typename GUM_SCALAR >
114 template <
typename TX_VAL >
116 operator=(
const ContinuousVariable< TX_VAL >& from) {
125 template <
typename GUM_SCALAR >
127 operator=(ContinuousVariable< GUM_SCALAR >&& from) {
136 template <
typename GUM_SCALAR >
139 std::istringstream stream(str);
147 "the value does not delong to the domain of the variable");
152 template <
typename GUM_SCALAR >
159 template <
typename GUM_SCALAR >
166 template <
typename GUM_SCALAR >
173 template <
typename GUM_SCALAR >
180 template <
typename GUM_SCALAR >
187 "the new lower bound would be higher than the upper bound");
192 template <
typename GUM_SCALAR >
194 const double new_bound) {
200 template <
typename GUM_SCALAR >
207 "the new upper bound would be lower than the lower bound");
212 template <
typename GUM_SCALAR >
214 const double new_bound) {
220 template <
typename GUM_SCALAR >
227 template <
typename GUM_SCALAR >
232 "the value does not belong to the domain of the variable");
237 template <
typename GUM_SCALAR >
245 template <
typename GUM_SCALAR >
247 std::ostringstream stream;
254 template <
typename GUM_SCALAR >
256 std::string str(this->
name());
263 template <
typename GUM_SCALAR >
264 INLINE
const std::string
273 template <
typename GUM_SCALAR >
274 std::ostream&
operator<<(std::ostream& stream,
275 const ContinuousVariable< GUM_SCALAR >& var) {
276 return stream << var.toString();
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
IContinuousVariable & operator=(const IContinuousVariable &from)
copy operator
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
const std::string toString() const
string version of *this
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void swap(HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
Swap the addresses of two pointers to hashTables.
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
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map's DAG in output using the Graphviz-dot format.
std::string to_string(const Formula &f)
friend class ContinuousVariable
IContinuousVariable(const std::string &aName, const std::string &aDesc)
Default constructor.
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.
const std::string & description() const
returns the description 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.
const std::string & name() const
returns the name of the variable
virtual VarType varType() const
returns the type of the variable
#define GUM_ERROR(type, msg)
GUM_SCALAR upperBound() const
returns the upper bound of the domain of the variable
virtual ~ContinuousVariable()
destructor