aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
PRMClassElementContainer.h File Reference

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org. 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
 Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
 
 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

Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see http://www.gnu.org/licenses/.

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 186 of file PRMClassElementContainer_tpl.h.

187  {
188  std::string tab = " ";
189  output << "digraph \"" << container.name() << "\" {" << std::endl;
190 
191  for (const auto node: container.containerDag().nodes()) {
192  if (container.containerDag().children(node).size() > 0) {
193  for (const auto chi: container.containerDag().children(node)) {
194  output << tab << "\"" << container.get(node).name() << "\" -> "
195  << "\"" << container.get(chi).name() << "\";" << std::endl;
196  }
197  } else if (container.containerDag().parents(node).size() == 0) {
198  output << tab << "\"" << container.get(node).name() << "\";" << std::endl;
199  }
200  }
201 
202  output << "}" << std::endl;
203  return output;
204 }
const std::string & name() const
Returns the name of this object.
Definition: PRMObject_inl.h:34
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.