aGrUM  0.14.2
essentialGraph.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
28 #ifndef GUM_ESSENTIALGRAPH_H
29 #define GUM_ESSENTIALGRAPH_H
30 
34 
35 namespace gum {
36 
55  public:
56  EssentialGraph() = default;
57  // this constructor will build the essential graph
58  explicit EssentialGraph(const DAGmodel& m);
59  // this constructor will use mh as essential graph for m
60  EssentialGraph(const DAGmodel& m, const MixedGraph& mg);
63 
65 
68 
70  std::string toDot() const;
71 
73  const NodeSet& parents(const NodeId id) const;
74 
76  const NodeSet& children(const NodeId id) const;
77 
79  const NodeSet& neighbours(const NodeId id) const;
80 
82  Size sizeArcs() const;
83 
85  const ArcSet& arcs() const;
87  Size sizeEdges() const;
88 
90  const EdgeSet& edges() const;
91 
93  Size sizeNodes() const;
95  Size size() const;
96 
98  const NodeGraphPart& nodes() const;
99 
100  private:
101  void __buildEssentialGraph();
103 
106  };
107 } // namespace gum
108 
109 #ifndef GUM_NO_INLINE
111 #endif // GUM_NOINLINE
112 
113 #endif // GUM_ESSENTIALGRAPH_H
Inline implementation of the class building the essential Graph from a DAGmodel.
Virtual base class for PGMs using a DAG.
Definition: DAGmodel.h:45
const NodeGraphPart & nodes() const
wrapping MixedGraph::nodes()
const NodeSet & parents(const NodeId id) const
wrapping MixedGraph::parents(id)
EssentialGraph & operator=(const EssentialGraph &g)
const NodeSet & neighbours(const NodeId id) const
wrapping MixedGraph::parents(id)
std::string toDot() const
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
bool __strongly_protected(NodeId a, NodeId b)
Size size() const
wrapping MixedGraph::size()
const DAGmodel * __dagmodel
Size sizeEdges() const
wrapping MixedGraph::sizeEdges()
Class representing probabilistic DAG model.
Size sizeArcs() const
wrapping MixedGraph::sizeArcs()
Size sizeNodes() const
wrapping MixedGraph::sizeNodes()
const EdgeSet & edges() const
wrapping MixedGraph::edges()
Class for node sets in graph.
Class building the essential graph from a BN.
Base classes for mixed directed/undirected graphs.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:45
const NodeSet & children(const NodeId id) const
wrapping MixedGraph::parents(id)
EssentialGraph()=default
const ArcSet & arcs() const
wrapping MixedGraph::arcs()
Size NodeId
Type for node ids.
Definition: graphElements.h:97
some utils for topology : NodeId, Edge, Arc and consorts ...
Base class for mixed graphs.
Definition: mixedGraph.h:124