aGrUM  0.18.1
a C++ library for (probabilistic) graphical models
DAGmodel_inl.h
Go to the documentation of this file.
1 
33 
34 namespace gum {
35  INLINE
36  const DAG& DAGmodel::dag() const { return dag_; }
37 
38  INLINE
39  Size DAGmodel::size() const { return dag().size(); }
40 
41  INLINE
42  Size DAGmodel::sizeArcs() const { return dag_.sizeArcs(); }
43 
44  INLINE const ArcSet& DAGmodel::arcs() const { return dag_.arcs(); }
45 
46  INLINE bool DAGmodel::existsArc(const NodeId tail, const NodeId head) const {
47  return dag_.existsArc(tail, head);
48  }
49 
50  INLINE bool DAGmodel::existsArc(const std::string& nametail,
51  const std::string& namehead) const {
52  return existsArc(idFromName(nametail), idFromName(namehead));
53  }
54 
55  INLINE const NodeSet& DAGmodel::parents(const NodeId id) const {
56  return dag_.parents(id);
57  }
58 
59  INLINE const NodeSet& DAGmodel::parents(const std::string& name) const {
60  return parents(idFromName(name));
61  }
62 
63  INLINE const NodeSet& DAGmodel::children(const NodeId id) const {
64  return dag_.children(id);
65  }
66  INLINE const NodeSet& DAGmodel::children(const std::string& name) const {
67  return dag_.children(idFromName(name));
68  }
69 
70  INLINE const NodeGraphPart& DAGmodel::nodes() const {
71  return (NodeGraphPart&)dag_;
72  }
73 } /* namespace gum */
Copyright 2005-2020 Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
const ArcSet & arcs() const
return true if the arc tail->head exists in the DAGmodel
Definition: DAGmodel_inl.h:44
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
Definition: DAGmodel_inl.h:63
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
Definition: DAGmodel_inl.h:55
Size sizeArcs() const
Returns the number of arcs in this Directed Graphical Model.
Definition: DAGmodel_inl.h:42
Size size() const
alias for sizeNodes
virtual Size size() const final
Returns the number of variables in this Directed Graphical Model.
Definition: DAGmodel_inl.h:39
Copyright 2005-2020 Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
Definition: agrum.h:25
bool existsArc(const NodeId tail, const NodeId head) const
return true if the arc tail->head exists in the DAGmodel
Definition: DAGmodel_inl.h:46
virtual NodeId idFromName(const std::string &name) const =0
Getter by name.
Copyright 2005-2020 Pierre-Henri WUILLEMIN() & Christophe GONZALES() info_at_agrum_dot_org.
Size sizeArcs() const
indicates the number of arcs stored within the ArcGraphPart
const NodeGraphPart & nodes() const
Returns a constant reference to the dag of this Bayes Net.
Definition: DAGmodel_inl.h:70
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
Class for node sets in graph.
DAG dag_
The DAG of this Directed Graphical Model.
Definition: DAGmodel.h:213
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
Base class for dag.
Definition: DAG.h:102
bool existsArc(const Arc &arc) const
indicates whether a given arc exists
const DAG & dag() const
Returns a constant reference to the dag of this Bayes Net.
Definition: DAGmodel_inl.h:36
Size NodeId
Type for node ids.
Definition: graphElements.h:98