aGrUM  0.17.2
a C++ library for (probabilistic) graphical models
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-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
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-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Definition: agrum.h:25
Size Idx
Type for indexes.
Definition: types.h:53
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.