aGrUM  0.17.2
a C++ library for (probabilistic) graphical models
MarkovBlanket.h
Go to the documentation of this file.
1 
30 #ifndef GUM_MARKOVBLANKET_H
31 #define GUM_MARKOVBLANKET_H
32 
36 
37 namespace gum {
38 
49  class MarkovBlanket {
50  public:
51  MarkovBlanket(const DAGmodel& m, NodeId n, int level = 1);
52  MarkovBlanket(const DAGmodel& m, const std::string& name, int level = 1);
53 
55 
57  DAG dag();
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  bool __buildMarkovBlanket(const NodeId id);
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:47
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
const NodeSet & parents(const NodeId id) const
wrapping DAG::parents(id)
Size sizeArcs() const
wrapping DAG::sizeArcs()
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
Size sizeNodes() const
wrapping DAG::sizeNodes()
const NodeSet & children(const NodeId id) const
wrapping DAG::parents(id)
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
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
bool __buildMarkovBlanket(const NodeId id)
std::string toDot() const
Size size() const
wrapping DAG::size()
bool hasSameStructure(const DAGmodel &other)
const ArcSet & arcs() const
wrapping DAG::arcs()
MarkovBlanket(const DAGmodel &m, NodeId n, int level=1)
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
const DAGmodel & __model
Definition: MarkovBlanket.h:93
Class for node sets in graph.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
Base class for dag.
Definition: DAG.h:102
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
const NodeGraphPart & nodes() const
wrapping DAG::nodes()