30 #endif // GUM_NOINLINE 37 __arcs(arcs_size, arcs_resize_policy) {
48 for (
const auto& elt : pars) {
57 for (
const auto& elt : children) {
64 for (
const auto& arc :
__arcs) {
92 for (
const auto& arc : tmp)
123 for (
const auto& arc :
__arcs) {
137 for (
const auto& arc :
__arcs) {
164 while (!nodeFIFO.
empty()) {
165 current = nodeFIFO.
front();
170 for (
const auto new_one :
parents(current)) {
174 mark.
insert(new_one, current);
177 std::vector< NodeId > v;
179 for (current = n1; current != n2; current = mark[current])
180 v.push_back(current);
194 const std::vector< NodeId >
206 while (!nodeFIFO.
empty()) {
207 current = nodeFIFO.
front();
211 for (
const auto new_one :
parents(current)) {
215 mark.
insert(new_one, current);
218 std::vector< NodeId > v;
220 for (current = n1; current != n2; current = mark[current])
221 v.push_back(current);
232 for (
const auto new_one :
children(current)) {
236 mark.
insert(new_one, current);
239 std::vector< NodeId > v;
241 for (current = n1; current != n2; current = mark[current])
242 v.push_back(current);
257 stream <<
set.toString();
bool empty() const noexcept
Returns a boolean indicating whether the chained list is empty.
const std::vector< NodeId > directedUnorientedPath(const NodeId node1, const NodeId node2) const
returns an unoriented (directed) path from node1 to node2 in the arc set
const std::string toString() const
to friendly display the content of the ArcGraphPart
ArcGraphPart & operator=(const ArcGraphPart &s)
copy operator
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
void clearArcs()
removes all the arcs from the ArcGraphPart
Classes for directed edge sets.
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
Generic doubly linked lists.
gum is the global namespace for all aGrUM entities
void popFront()
Removes the first element of a List, if any.
The class for generic Hash Tables.
Representation of a setA Set is a structure that contains arbitrary elements.
Inline implementation of classes for directed edge sets.
std::ostream & operator<<(std::ostream &output, const BayesNet< GUM_SCALAR > &bn)
Prints map's DAG in output using the Graphviz-dot format.
#define GUM_EMIT2(signal, arg1, arg2)
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
Val & pushBack(const Val &val)
Inserts a new element (a copy) at the end of the chained list.
const std::vector< NodeId > directedPath(const NodeId node1, const NodeId node2) const
returns a directed path from node1 to node2 belonging to the set of arcs
NodeProperty< NodeSet *> __parents
for each arc, the sets of its parents
Size capacity() const noexcept
Returns the number of slots in the 'nodes' vector of the hashtable.
Val & front() const
Returns a reference to first element of a list, if any.
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
Signaler2< NodeId, NodeId > onArcAdded
virtual ~ArcGraphPart()
destructor
NodeProperty< NodeSet *> __children
for each arc, the set of its children
Signaler2< NodeId, NodeId > onArcDeleted
void clear()
Removes all the elements, if any, from the set.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
ArcGraphPart(Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
Size NodeId
Type for node ids.
#define GUM_ERROR(type, msg)
some utils for topology : NodeId, Edge, Arc and consorts ...