33 #endif // GUM_NOINLINE 40 __arcs(arcs_size, arcs_resize_policy) {
51 for (
const auto& elt : pars) {
60 for (
const auto& elt : children) {
67 for (
const auto& arc :
__arcs) {
95 for (
const auto& arc : tmp)
126 for (
const auto& arc :
__arcs) {
140 for (
const auto& arc :
__arcs) {
167 while (!nodeFIFO.
empty()) {
168 current = nodeFIFO.
front();
173 for (
const auto new_one :
parents(current)) {
177 mark.
insert(new_one, current);
180 std::vector< NodeId > v;
182 for (current = n1; current != n2; current = mark[current])
183 v.push_back(current);
197 const std::vector< NodeId >
209 while (!nodeFIFO.
empty()) {
210 current = nodeFIFO.
front();
214 for (
const auto new_one :
parents(current)) {
218 mark.
insert(new_one, current);
221 std::vector< NodeId > v;
223 for (current = n1; current != n2; current = mark[current])
224 v.push_back(current);
235 for (
const auto new_one :
children(current)) {
239 mark.
insert(new_one, current);
242 std::vector< NodeId > v;
244 for (current = n1; current != n2; current = mark[current])
245 v.push_back(current);
260 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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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)
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.