aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
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::PRMClassElementContainer< GUM_SCALAR >
 <agrum/PRM/classElementContainer.h> More...

Namespaces

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

Functions

template<gum::GUM_Numeric 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.

Detailed Description

Headers of gum::prm::PRMClassElementContainer.

Author
Lionel TORTI and Pierre-Henri WUILLEMIN(_at_LIP6)

Definition in file PRMClassElementContainer.h.

Function Documentation

◆ operator<<()

template<gum::GUM_Numeric 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 207 of file PRMClassElementContainer_tpl.h.

208 {
209 std::string tab = " ";
210 output << "digraph \"" << container.name() << "\" {" << std::endl;
211
212 for (const auto node: container.containerDag().nodes()) {
213 if (container.containerDag().children(node).size() > 0) {
214 for (const auto chi: container.containerDag().children(node)) {
215 output << tab << "\"" << container.get(node).name() << "\" -> "
216 << "\"" << container.get(chi).name() << "\";" << std::endl;
217 }
218 } else if (container.containerDag().parents(node).size() == 0) {
219 output << tab << "\"" << container.get(node).name() << "\";" << std::endl;
220 }
221 }
222
223 output << "}" << std::endl;
224 return output;
225}
const NodeSet & parents(NodeId id) const
returns the set of nodes with arc ingoing to a given node
NodeSet children(const NodeSet &ids) const
returns the set of nodes which consists in the node and its parents returns the set of children of a ...
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
Size size() const noexcept
Returns the number of elements in the set.
Definition set_tpl.h:607
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
virtual PRMClassElement< GUM_SCALAR > & get(std::string_view name)=0
Getter on a member of this PRMClassElementContainer.
const std::string & name() const
Returns the name of this object.

References gum::ArcGraphPart::children(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMObject::name(), gum::NodeGraphPart::nodes(), gum::ArcGraphPart::parents(), and gum::Set< Key >::size().

Here is the call graph for this function: