32 #ifndef DOXYGEN_SHOULD_SKIP_THIS 38 template <
typename GUM_SCALAR >
41 const std::string& aDesc,
42 GUM_SCALAR lower_bound,
43 GUM_SCALAR upper_bound) :
44 IContinuousVariable(aName, aDesc),
45 __lower_bound(lower_bound), __upper_bound(upper_bound) {
52 template <
typename GUM_SCALAR >
54 const ContinuousVariable< GUM_SCALAR >& from) :
62 template <
typename GUM_SCALAR >
63 template <
typename TX_VAL >
65 const ContinuousVariable< TX_VAL >& from) :
74 template <
typename GUM_SCALAR >
76 ContinuousVariable< GUM_SCALAR >&& from) :
84 template <
typename GUM_SCALAR >
91 template <
typename GUM_SCALAR >
92 INLINE ContinuousVariable< GUM_SCALAR >*
94 return new ContinuousVariable< GUM_SCALAR >(*this);
99 template <
typename GUM_SCALAR >
101 operator=(
const ContinuousVariable< GUM_SCALAR >& from) {
110 template <
typename GUM_SCALAR >
111 template <
typename TX_VAL >
113 operator=(
const ContinuousVariable< TX_VAL >& from) {
122 template <
typename GUM_SCALAR >
124 operator=(ContinuousVariable< GUM_SCALAR >&& from) {
133 template <
typename GUM_SCALAR >
136 std::istringstream stream(str);
144 "the value does not delong to the domain of the variable");
149 template <
typename GUM_SCALAR >
156 template <
typename GUM_SCALAR >
163 template <
typename GUM_SCALAR >
170 template <
typename GUM_SCALAR >
177 template <
typename GUM_SCALAR >
184 "the new lower bound would be higher than the upper bound");
189 template <
typename GUM_SCALAR >
191 const double new_bound) {
197 template <
typename GUM_SCALAR >
204 "the new upper bound would be lower than the lower bound");
209 template <
typename GUM_SCALAR >
211 const double new_bound) {
217 template <
typename GUM_SCALAR >
224 template <
typename GUM_SCALAR >
229 "the value does not belong to the domain of the variable");
234 template <
typename GUM_SCALAR >
242 template <
typename GUM_SCALAR >
244 std::ostringstream stream;
251 template <
typename GUM_SCALAR >
253 std::string str(this->
name());
260 template <
typename GUM_SCALAR >
261 INLINE
const std::string
270 template <
typename GUM_SCALAR >
271 std::ostream&
operator<<(std::ostream& stream,
272 const ContinuousVariable< GUM_SCALAR >& var) {
273 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
Header of ContinuousVariable.
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
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
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