aGrUM  0.14.2
PRMClassElementContainer.h File Reference

Headers of gum::prm::PRMClassElementContainer. More...

+ Include dependency graph for PRMClassElementContainer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  gum::prm::PRMClass< GUM_SCALAR >
 A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantiated in PRMInstance. More...
 
class  gum::prm::PRMInterface< GUM_SCALAR >
 An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALAR> and PRMAttribute<GUM_SCALAR> which the implementing Class<GUM_SCALAR> must contain. More...
 
class  gum::prm::PRMClassElementContainer< GUM_SCALAR >
 <agrum/PRM/classElementContainer.h> More...
 

Namespaces

 gum
 gum is the global namespace for all aGrUM entities
 
 gum::prm
 namespace for all probabilistic relational models entities
 

Functions

template<typename GUM_SCALAR >
std::ostream & operator<< (std::ostream &output, const gum::prm::PRMClassElementContainer< GUM_SCALAR > &container)
 An << operator for PRMClassElementContainer. Output in the graphviz-dot format. More...
 

Detailed Description

Headers of gum::prm::PRMClassElementContainer.

Author
Lionel TORTI and Pierre-Henri WUILLEMIN

Definition in file PRMClassElementContainer.h.

Function Documentation

◆ operator<<()

template<typename GUM_SCALAR >
std::ostream& operator<< ( std::ostream &  output,
const gum::prm::PRMClassElementContainer< GUM_SCALAR > &  container 
)

An << operator for PRMClassElementContainer. Output in the graphviz-dot format.

Definition at line 192 of file PRMClassElementContainer_tpl.h.

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), and gum::prm::PRMObject::name().

193  {
194  std::string tab = " ";
195  output << "digraph \"" << container.name() << "\" {" << std::endl;
196 
197  for (const auto node : container.containerDag().nodes()) {
198  if (container.containerDag().children(node).size() > 0) {
199  for (const auto chi : container.containerDag().children(node)) {
200  output << tab << "\"" << container.get(node).name() << "\" -> "
201  << "\"" << container.get(chi).name() << "\";" << std::endl;
202  }
203  } else if (container.containerDag().parents(node).size() == 0) {
204  output << tab << "\"" << container.get(node).name() << "\";" << std::endl;
205  }
206  }
207 
208  output << "}" << std::endl;
209  return output;
210 }
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:32
virtual PRMClassElement< GUM_SCALAR > & get(const std::string &name)=0
Getter on a member of this PRMClassElementContainer.
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
+ Here is the call graph for this function: