aGrUM  0.14.2
PRMClassElementContainer_tpl.h File Reference

Inline implementation of gum::PRMClassElementContainer. More...

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

Go to the source code of this file.

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

Inline implementation of gum::PRMClassElementContainer.

Author
Lionel TORTI and Pierre-Henri WUILLEMIN

Definition in file PRMClassElementContainer_tpl.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: