aGrUM  0.16.0
MarkovBlanket.h
Go to the documentation of this file.
1 
30 #ifndef GUM_MARKOVBLANKET_H
31 #define GUM_MARKOVBLANKET_H
32 
34 #include <agrum/graphs/diGraph.h>
36 
37 namespace gum {
38 
49  class MarkovBlanket {
50  public:
51  MarkovBlanket(const DAGmodel& m, NodeId n);
52  MarkovBlanket(const DAGmodel& m, const std::string& name);
53 
55 
57  DiGraph mb();
58 
59  // @return a dot representation of this MarkovBlanket
60  // node of interest is in red
61  // special arcs (not used during the construction of the Markov Blanket) are in
62  // grey
63  std::string toDot() const;
64 
66  const NodeSet& parents(const NodeId id) const;
67 
69  const NodeSet& children(const NodeId id) const;
70 
72  Size sizeArcs() const;
73 
75  const ArcSet& arcs() const;
76 
78  Size sizeNodes() const;
79 
81  Size size() const;
82 
84  const NodeGraphPart& nodes() const;
85 
88  bool hasSameStructure(const DAGmodel& other);
89 
90  private:
91  void __buildMarkovBlanket();
92 
93  const DAGmodel& __model;
95  const NodeId __node;
97  };
98 } // namespace gum
99 
100 #ifndef GUM_NO_INLINE
102 #endif // GUM_NOINLINE
103 
104 #endif // GUM_MARKOVBLANKET_H
Virtual base class for PGMs using a DAG.
Definition: DAGmodel.h:48
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const NodeSet & parents(const NodeId id) const
wrapping DiGraph::parents(id)
Size sizeArcs() const
wrapping DiGraph::sizeArcs()
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size sizeNodes() const
wrapping DiGraph::sizeNodes()
MarkovBlanket(const DAGmodel &m, NodeId n)
const NodeSet & children(const NodeId id) const
wrapping DiGraph::parents(id)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
const NodeId __node
Definition: MarkovBlanket.h:95
Class building the markov Blanket from a BN and a nodeName.
Definition: MarkovBlanket.h:49
std::string toDot() const
Size size() const
wrapping DiGraph::size()
bool hasSameStructure(const DAGmodel &other)
const ArcSet & arcs() const
wrapping DiGraph::arcs()
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const DAGmodel & __model
Definition: MarkovBlanket.h:93
Base class for all oriented graphs.
Definition: diGraph.h:111
Class for node sets in graph.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const NodeGraphPart & nodes() const
wrapping DiGraph::nodes()