59 _arcs_(arcs_size, arcs_resize_policy) {
70 for (
const auto& [key, nodeset]: pars) {
79 for (
const auto& [key, nodeset]:
children) {
86 for (
const auto& arc:
_arcs_) {
114 for (
const auto& arc: tmp)
131 for (
const auto& [key, nodeset]: s.
_parents_) {
139 for (
const auto& [key, nodeset]: s.
_children_) {
145 for (
const auto& arc:
_arcs_) {
159 for (
const auto& arc:
_arcs_) {
180 while (!tmp.
empty()) {
181 auto current = *(tmp.
begin());
184 for (
auto next:
children(current)) {
197 while (!tmp.
empty()) {
198 auto current = *(tmp.
begin());
201 for (
auto next:
parents(current)) {
219 while (!nodeFIFO.
empty()) {
220 current = nodeFIFO.
front();
225 for (
const auto new_one:
parents(current)) {
229 mark.
insert(new_one, current);
232 std::vector< NodeId > v;
234 for (current = n1; current != n2; current = mark[current])
235 v.push_back(current);
260 while (!nodeFIFO.
empty()) {
261 current = nodeFIFO.
front();
265 for (
const auto new_one:
parents(current)) {
269 mark.
insert(new_one, current);
272 std::vector< NodeId > v;
274 for (current = n1; current != n2; current = mark[current])
275 v.push_back(current);
286 for (
const auto new_one:
children(current)) {
290 mark.
insert(new_one, current);
293 std::vector< NodeId > v;
295 for (current = n1; current != n2; current = mark[current])
296 v.push_back(current);
Inline implementation of classes for directed edge sets.
Classes for directed edge sets.
virtual ~ArcGraphPart()
destructor
const NodeSet & parents(NodeId id) const
returns the set of nodes with arc ingoing to a given node
Signaler2< NodeId, NodeId > onArcAdded
Set< Arc > _arcs_
the set of all the arcs contained within the ArcGraphPart
ArcGraphPart & operator=(const ArcGraphPart &s)
copy operator
std::vector< NodeId > directedUnorientedPath(NodeId node1, NodeId node2) const
returns an unoriented (directed) path from node1 to node2 in the arc set
void clearArcs()
removes all the arcs from the ArcGraphPart
NodeProperty< NodeSet * > _children_
for each arc, the set of its children
NodeSet descendants(NodeId id) const
returns the set of nodes with directed path outgoing from a given node
NodeProperty< NodeSet * > _parents_
for each arc, the sets of its parents
NodeSet children(const NodeSet &ids) const
returns the set of children of a set of nodes
NodeSet ancestors(NodeId id) const
returns the set of nodes with directed path ingoing to a given node
ArcGraphPart(Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
std::vector< NodeId > directedPath(NodeId node1, NodeId node2) const
returns a directed path from node1 to node2 belonging to the set of arcs
Signaler2< NodeId, NodeId > onArcDeleted
std::string toString() const
to friendly display the content of the ArcGraphPart
bool exists(const Key &key) const
Checks whether there exists an element with a given key in the hashtable.
value_type & insert(const Key &key, const Val &val)
Adds a new element (actually a copy of this element) into the hash table.
Size capacity() const noexcept
Returns the number of slots in the 'nodes' vector of the hashtable.
Generic doubly linked lists.
Val & front() const
Returns a reference to first element of a list, if any.
bool empty() const noexcept
Returns a boolean indicating whether the chained list is empty.
void popFront()
Removes the first element of a List, if any.
Val & pushBack(const Val &val)
Inserts a new element (a copy) at the end of the chained list.
Exception : the element we looked for cannot be found.
iterator begin() const
The usual unsafe begin iterator to parse the set.
bool contains(const Key &k) const
Indicates whether a given elements belong to the set.
void insert(const Key &k)
Inserts a new element into the set.
bool empty() const noexcept
Indicates whether the set is the empty set.
void erase(const Key &k)
Erases an element from the set.
#define GUM_ERROR(type, msg)
some utils for topology : NodeId, Edge, Arc and consorts ...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
Set< Arc > ArcSet
Some typdefs and define for shortcuts ...
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
gum is the global namespace for all aGrUM entities
std::ostream & operator<<(std::ostream &stream, const AVLTree< Val, Cmp > &tree)
display the content of a tree
#define GUM_EMIT2(signal, arg1, arg2)