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 >
103 INLINE ContinuousVariable< GUM_SCALAR >&
105 const ContinuousVariable< GUM_SCALAR >& from) {
114 template <
typename GUM_SCALAR >
115 template <
typename TX_VAL >
116 INLINE ContinuousVariable< GUM_SCALAR >&
118 const ContinuousVariable< TX_VAL >& from) {
127 template <
typename GUM_SCALAR >
128 INLINE ContinuousVariable< GUM_SCALAR >&
130 ContinuousVariable< GUM_SCALAR >&& from) {
139 template <
typename GUM_SCALAR >
142 std::istringstream stream(str);
150 "the value does not delong to the domain of the variable");
155 template <
typename GUM_SCALAR >
162 template <
typename GUM_SCALAR >
169 template <
typename GUM_SCALAR >
176 template <
typename GUM_SCALAR >
183 template <
typename GUM_SCALAR >
190 "the new lower bound would be higher than the upper bound");
195 template <
typename GUM_SCALAR >
197 const double new_bound) {
203 template <
typename GUM_SCALAR >
210 "the new upper bound would be lower than the lower bound");
215 template <
typename GUM_SCALAR >
217 const double new_bound) {
223 template <
typename GUM_SCALAR >
230 template <
typename GUM_SCALAR >
235 "the value does not belong to the domain of the variable");
240 template <
typename GUM_SCALAR >
248 template <
typename GUM_SCALAR >
250 std::ostringstream stream;
257 template <
typename GUM_SCALAR >
259 std::string str(this->
name());
266 template <
typename GUM_SCALAR >
267 INLINE
const std::string
276 template <
typename GUM_SCALAR >
277 std::ostream&
operator<<(std::ostream& stream,
278 const ContinuousVariable< GUM_SCALAR >& var) {
279 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-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
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-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
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