aGrUM  0.16.0
discreteVariable.cpp
Go to the documentation of this file.
1 
24 #include <sstream>
25 
26 #ifdef GUM_NO_INLINE
28 #endif /* GUM_NO_INLINE */
29 
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 
32 namespace gum {
33 
34  const std::string DiscreteVariable::toStringWithDescription() const {
35  std::stringstream s;
36  s << description();
37  s << domain();
38 
39  return s.str();
40  }
41 
42  const std::string DiscreteVariable::toString() const {
43  std::stringstream s;
44  s << name();
45  s << domain();
46 
47  return s.str();
48  }
49 
51 
52  std::ostream& operator<<(std::ostream& s, const DiscreteVariable& DRV) {
53  s << DRV.toString();
54  return s;
55  }
56 
57 } /* namespace gum */
58 
59 #endif // DOXYGEN_SHOULD_SKIP_THIS
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual const std::string domain() const =0
string represent the domain of the variable
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
const std::string toStringWithDescription() const
string version of *this using description attribute instead of name.
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map&#39;s DAG in output using the Graphviz-dot format.
Definition: BayesNet_tpl.h:605
const std::string & description() const
returns the description of the variable
DiscreteVariable()
(protected) Default constructor
const std::string toString() const
string version of *this
const std::string & name() const
returns the name of the variable