aGrUM  0.16.0
simplicialSet_inl.h
Go to the documentation of this file.
1 
28 #include <limits>
29 #include <sstream>
30 
31 #ifndef DOXYGEN_SHOULD_SKIP_THIS
32 
33 // to ease IDE parser
34 # include <agrum/core/math/math.h>
36 
37 namespace gum {
38 
39  /* ===========================================================================
40  */
41  /* ===========================================================================
42  */
43  /* === CLASS FOR RETRIEVING SIMPLICIAL, ALMOST AND QUASI SIMPLICIAL NODES ===
44  */
45  /* ===========================================================================
46  */
47  /* ===========================================================================
48  */
49 
51  INLINE
52  bool SimplicialSet::isSimplicial(const NodeId id) {
53  // update the list to which the node belongs if needed
55 
56  // check if the node belongs to the simplicial list
57  return __simplicial_nodes.contains(id);
58  }
59 
60 
62  INLINE
64  if (!hasSimplicialNode()) {
65  GUM_ERROR(NotFound, "No simplicial node could be found");
66  }
67 
68  return __simplicial_nodes.top();
69  }
70 
71 
73  INLINE
75  if (!hasAlmostSimplicialNode()) {
76  GUM_ERROR(NotFound, "no almost simplicial node could be found");
77  }
78 
80  }
81 
82 
84  INLINE
86  if (!hasQuasiSimplicialNode()) {
87  GUM_ERROR(NotFound, "no quasi simplicial node could be found");
88  }
89 
91  }
92 
93 
95  INLINE
97  // check if a node can enter the simplicial list
98  for (auto iter = __changed_status.beginSafe(); // safe iterator needed here
99  iter != __changed_status.endSafe();
100  ++iter) {
101  __updateList(*iter);
102  }
103  }
104 
105 
107  INLINE
110  return __simplicial_nodes;
111  }
112 
113 
115  INLINE
120  }
121 
122 
124  INLINE
128  }
129 
130 
132  INLINE
133  void SimplicialSet::setFillIns(bool b) { __we_want_fill_ins = b; }
134 
135 
137  INLINE
138  const EdgeSet& SimplicialSet::fillIns() const { return __fill_ins_list; }
139 
140 
141 } /* namespace gum */
142 
143 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool contains(const Key &k) const
Indicates whether a given elements belong to the set.
Definition: set_tpl.h:581
NodeId bestQuasiSimplicialNode()
gets a quasi simplicial node with the lowest clique weight
bool hasQuasiSimplicialNode()
indicates whether there exists a quasi simplicial node
bool hasAlmostSimplicialNode()
indicates whether there exists an almost simplicial node
const Val & top() const
returns the element at the top of the priority queue
void __updateAllNodes()
put all the nodes in their appropriate list
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Set< Edge > EdgeSet
Some typdefs and define for shortcuts ...
void __updateList(const NodeId id)
put node id in the correct simplicial/almost simplicial/quasi simplicial list
NodeSet __changed_status
the set of nodes that have potentially changed of status
const iterator_safe & endSafe() const noexcept
The usual safe end iterator to parse the set.
Definition: set_tpl.h:502
const PriorityQueue< NodeId, double > & allSimplicialNodes()
returns all the simplicial nodes
PriorityQueue< NodeId, double > __simplicial_nodes
a queue of the simplicial nodes ordered by increasing node weight
PriorityQueue< NodeId, double > __quasi_simplicial_nodes
a queue of the quasi simplicial nodes ordered by increasing node weight
bool hasSimplicialNode()
indicates whether there exists a simplicial node
EdgeSet __fill_ins_list
fill-ins list
bool isSimplicial(const NodeId id)
indicates whether a given node is a simplicial node
NodeId bestAlmostSimplicialNode()
gets the almost simplicial node with the lowest clique weight
iterator_safe beginSafe() const
The usual safe begin iterator to parse the set.
Definition: set_tpl.h:488
NodeId bestSimplicialNode()
returns the simplicial node with the lowest clique weight
const PriorityQueue< NodeId, double > & allAlmostSimplicialNodes()
returns all the almost simplicial nodes
PriorityQueue< NodeId, double > __almost_simplicial_nodes
a queue of the almost simplicial nodes ordered by increasing node weight
bool __we_want_fill_ins
a boolean indicating if we want fill-ins list with the standard triangulation method ...
const PriorityQueue< NodeId, double > & allQuasiSimplicialNodes()
returns all the quasi simplicial nodes
void setFillIns(bool on_off)
sets/unset the fill-ins storage in the standard triangulation procedure
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Size NodeId
Type for node ids.
Definition: graphElements.h:98
bool contains(const Val &val) const
Indicates whether the priority queue contains a given value.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
const EdgeSet & fillIns() const
returns the set of all the fill-ins added to the graph so far