aGrUM  0.16.0
labelizedVariable.cpp
Go to the documentation of this file.
1 
24 
25 #ifdef GUM_NO_INLINE
27 #endif /* GUM_NO_INLINE */
28 
29 namespace gum {
30  const std::string LabelizedVariable::domain() const {
31  std::stringstream s;
32  s << "<";
33 
34  if (domainSize() > 0) {
35  s << label(0);
36 
37  for (Idx i = 1; i < domainSize(); ++i) {
38  s << ",";
39  s << label(i);
40  }
41  }
42 
43  s << ">";
44 
45  return s.str();
46  }
47 } // namespace gum
virtual const std::string domain() const
Returns the domain.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
virtual std::string label(Idx i) const
returns the ith label
virtual Size domainSize() const
returns the size of the random discrete variable domain
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Size Idx
Type for indexes.
Definition: types.h:53
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.