aGrUM  0.13.2
gum::prm::gspan::Pattern Class Reference

This contains all the information we want for a node in a DFSTree. More...

#include <agrum/PRM/gspan/pattern.h>

+ Inheritance diagram for gum::prm::gspan::Pattern:
+ Collaboration diagram for gum::prm::gspan::Pattern:

Public Member Functions

Constructor and destructor.
 Pattern ()
 Default constructor. More...
 
 Pattern (const Pattern &source)
 Copy constructor. More...
 
 ~Pattern ()
 Destructor. More...
 
Graphical getters and setters.
NodeId addNodeWithLabel (LabelData &l)
 Insert a node with the given LabelData. More...
 
LabelDatalabel (NodeId node)
 Returns the LabelData assigned to node. More...
 
const LabelDatalabel (NodeId node) const
 Returns the LabelData assigned to node. More...
 
LabelDatalabel (NodeId i, NodeId j)
 Returns the LabelData assigned to arc. More...
 
const LabelDatalabel (NodeId i, NodeId j) const
 Returns the LabelData assigned to arc. More...
 
LabelDatalabel (const Arc &arc)
 Returns the LabelData assigned to arc. More...
 
const LabelDatalabel (const Arc &arc) const
 Returns the LabelData assigned to arc. More...
 
LabelDatalastAdded ()
 Insert a node with the given LabelData. More...
 
const LabelDatalastAdded () const
 Insert a node with the given LabelData. More...
 
void addArc (NodeId i, NodeId j, LabelData &l)
 Add an arc to this Pattern. More...
 
bool exists (NodeId id) const
 Returns true if id is a node in this Pattern. More...
 
bool exists (NodeId tail, NodeId head) const
 Returns true if (tail, head) is an arc in this Pattern. More...
 
Size size () const
 Returns the number of nodes in this Pattern. More...
 
Size sizeArcs () const
 Returns the number of arcs in this Pattern. More...
 
void rightmostPath (std::list< NodeId > &r_path) const
 Fill r_path with the rightmost path of this Pattern. The list is supposed empty. More...
 
std::string toDot (size_t name) const
 Print the pattern in the DOT syntax. More...
 
Access to topology
const NodeGraphPartnodes () const
 
const ArcSetarcs () const
 
DFSCode related methods.
DFSCodecode ()
 Returns the DFSCode of this Pattern. More...
 
const DFSCodecode () const
 Returns the DFSCode of this Pattern. More...
 
EdgeCodeedgeCode (NodeId tail, NodeId head)
 Returns the EdgeCode of an edge of this Pattern. More...
 
EdgeCodeedgeCode (const Arc &arc)
 Returns the EdgeCode of an edge of this Pattern. More...
 
const EdgeCodeedgeCode (NodeId tail, NodeId head) const
 Returns the EdgeCode of an edge of this Pattern. More...
 
const EdgeCodeedgeCode (const Arc &arc) const
 Returns the EdgeCode of an edge of this Pattern. More...
 
void pop_back ()
 Remove the last EdgeCode of this pattern. More...
 
void remove (NodeId node)
 Remove a node if it has no neighbors, raise an OperationNotAllowed otherwise. More...
 
bool isMinimal ()
 Returns the DFSCode of this Pattern. More...
 

Detailed Description

This contains all the information we want for a node in a DFSTree.

Several rules are used regarding nodes in Pattern::graph. First nodes are added respecting a depth-first search, thus each node is labelled from 1 to n, where n is the number of nodes in Pattern::graph.

Given two nodes id i and j, if i < j then i was discovered before j in the depth first search.

To retrieve the depth first search tree from Pattern::graph simple consider only arcs (u, v) with u < v. The set of arcs { (u,v) | u < v} is called the forward edge set and the set of arcs { (u,v) | u > v} is called the backward edge set.

The orientation in Pattern::graph is only used to differentiate forward edges from backward edges.

Definition at line 70 of file pattern.h.

Member Typedef Documentation

Definition at line 78 of file arcGraphPart.h.

types for STL compliance

Definition at line 258 of file nodeGraphPart.h.

types for STL compliance

Definition at line 260 of file nodeGraphPart.h.

types for STL compliance

Definition at line 257 of file nodeGraphPart.h.

types for STL compliance

Definition at line 259 of file nodeGraphPart.h.

Definition at line 267 of file nodeGraphPart.h.

Definition at line 266 of file nodeGraphPart.h.

Constructor & Destructor Documentation

INLINE gum::prm::gspan::Pattern::Pattern ( )

Default constructor.

Definition at line 32 of file pattern_inl.h.

32 : DiGraph(), __last(0) { GUM_CONSTRUCTOR(Pattern); }
DiGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
Definition: diGraph.cpp:34
Pattern()
Default constructor.
Definition: pattern_inl.h:32
LabelData * __last
The last LabelData added to this pattern.
Definition: pattern.h:213
gum::prm::gspan::Pattern::Pattern ( const Pattern source)

Copy constructor.

Definition at line 37 of file pattern.cpp.

References addArc(), addNodeWithLabel(), code(), gum::prm::gspan::DFSCode::codes, gum::HashTable< Key, Val, Alloc >::insert(), label(), and size().

37  : DiGraph(), __last(0) {
38  GUM_CONS_CPY(Pattern);
39  NodeProperty< NodeId > node_map;
40 
41  for (NodeId node = 1; node <= source.size(); ++node) {
42  node_map.insert(
43  node, addNodeWithLabel(const_cast< LabelData& >(source.label(node))));
44  }
45 
46  for (const auto edge : source.code().codes)
47  addArc(node_map[edge->i],
48  node_map[edge->j],
49  const_cast< LabelData& >(
50  source.label(node_map[edge->i], node_map[edge->j])));
51  }
DiGraph(Size nodes_size=HashTableConst::default_size, bool nodes_resize_policy=true, Size arcs_size=HashTableConst::default_size, bool arcs_resize_policy=true)
default constructor
Definition: diGraph.cpp:34
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
Pattern()
Default constructor.
Definition: pattern_inl.h:32
NodeId addNodeWithLabel(LabelData &l)
Insert a node with the given LabelData.
Definition: pattern_inl.h:38
LabelData * __last
The last LabelData added to this pattern.
Definition: pattern.h:213
void addArc(NodeId i, NodeId j, LabelData &l)
Add an arc to this Pattern.
Definition: pattern_inl.h:115

+ Here is the call graph for this function:

INLINE gum::prm::gspan::Pattern::~Pattern ( )

Destructor.

Definition at line 35 of file pattern_inl.h.

35 { GUM_DESTRUCTOR(Pattern); }
Pattern()
Default constructor.
Definition: pattern_inl.h:32

Member Function Documentation

bool gum::prm::gspan::Pattern::__expandCodeIsMinimal ( NodeId  u,
NodeId  v 
)
private

Returns true if the expand code by adding and edge betwenne u and v is minimal with respect to __code.

Parameters
uA node in this Pattern.
vA node in this Pattern.
Returns
true if the expand code by adding and edge betwenne u and v is minimal with respect to __code.

Definition at line 96 of file pattern.cpp.

References __rec(), addArc(), addNodeWithLabel(), gum::ArcGraphPart::children(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), label(), and gum::ArcGraphPart::parents().

Referenced by isMinimal().

96  {
97  Bijection< NodeId, NodeId > node_map;
98  Pattern p;
99  node_map.insert(u, p.addNodeWithLabel(label(u)));
100  node_map.insert(v, p.addNodeWithLabel(label(v)));
101 
102  try {
103  p.addArc(1, 2, label(u, v));
104  } catch (NotFound&) { p.addArc(1, 2, label(v, u)); }
105 
106  for (const auto nei : children(u))
107  if (nei != v)
108  if (__rec(p, node_map, u, nei)) return true;
109 
110  for (const auto nei : parents(u))
111  if (nei != v)
112  if (__rec(p, node_map, u, nei)) return true;
113 
114  for (const auto nei : children(v))
115  if (nei != u)
116  if (__rec(p, node_map, v, nei)) return true;
117 
118  for (const auto nei : parents(v))
119  if (nei != u)
120  if (__rec(p, node_map, v, nei)) return true;
121 
122  return false;
123  }
Pattern()
Default constructor.
Definition: pattern_inl.h:32
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
Definition: pattern_inl.h:47
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
bool __rec(Pattern &p, Bijection< NodeId, NodeId > &node_map, NodeId u, NodeId v)
Recurisve method used by __expandCodeIsMinimal.
Definition: pattern.cpp:125
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool gum::prm::gspan::Pattern::__not_rec ( Pattern p,
Bijection< NodeId, NodeId > &  node_map,
NodeId  u,
NodeId  v 
)
private

A non recursive bugged version of __rec.

Definition at line 186 of file pattern.cpp.

References addArc(), addNodeWithLabel(), gum::ArcGraphPart::children(), code(), gum::prm::gspan::DFSCode::codes, gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::eraseFirst(), gum::ArcGraphPart::existsArc(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::existsFirst(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::first(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), label(), gum::ArcGraphPart::parents(), pop_back(), remove(), rightmostPath(), and gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::second().

189  {
190  std::vector< std::pair< NodeId, NodeId > > stack;
191  std::vector< size_t > rec_call;
192  stack.push_back(std::make_pair(a_u, a_v));
193  NodeId u = 0;
194  NodeId v = 0;
195 
196  while (!stack.empty()) {
197  bool go = true;
198  u = stack.back().first;
199  v = stack.back().second;
200  stack.pop_back();
201 
202  if ((u == 0) && (v == 0)) {
203  p.pop_back();
204  } else {
205  if (node_map.existsFirst(v)) {
206  if (node_map.second(u) < node_map.second(v)) {
207  // Invalid forward edge
208  go = false;
209  } else if ((p.existsArc(node_map.second(u), node_map.second(v)))
210  || (p.existsArc(node_map.second(v),
211  node_map.second(u)))) {
212  // Duplicate arc !
213  go = false;
214  }
215  } else {
216  node_map.insert(v, p.addNodeWithLabel(label(v)));
217  }
218 
219  if (go) {
220  // Retrieving arc label data
221  LabelData* data = 0;
222 
223  try {
224  data = &(label(u, v));
225  } catch (NotFound&) { data = &(label(v, u)); }
226 
227  // Adding arc
228  try {
229  p.addArc(node_map.second(u), node_map.second(v), *data);
230  } catch (OperationNotAllowed&) {
231  // Invalid neighbor
232  if (node_map.second(u) < node_map.second(v)) {
233  p.remove(node_map.second(v));
234  node_map.eraseFirst(v);
235  }
236 
237  go = false;
238  }
239 
240  if (go) {
241  // Check if this is minimal or if equal find another growth
242  size_t depth = p.code().codes.size() - 1;
243 
244  if (*(p.code().codes.back()) < *(code().codes[depth])) {
245  return true;
246  } else if (*(p.code().codes.back()) == *(code().codes[depth])) {
247  std::list< NodeId > r_path;
248  p.rightmostPath(r_path);
249  stack.push_back(std::make_pair((NodeId)0, (NodeId)0));
250 
251  for (const auto node : r_path) {
252  for (const auto nei : children(node)) {
253  stack.push_back(std::make_pair(node_map.first(node), nei));
254  ++(rec_call.back());
255  }
256 
257  for (const auto nei : parents(node)) {
258  stack.push_back(std::make_pair(node_map.first(node), nei));
259  ++(rec_call.back());
260  }
261  }
262  }
263 
264  if (p.code().codes.back()->isForward()) node_map.eraseFirst(v);
265  }
266  }
267  }
268  }
269 
270  return false;
271  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
DFSCode & code()
Returns the DFSCode of this Pattern.
Definition: pattern_inl.h:170
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
Definition: DFSCode.h:87
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
Definition: pattern_inl.h:47
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node

+ Here is the call graph for this function:

bool gum::prm::gspan::Pattern::__rec ( Pattern p,
Bijection< NodeId, NodeId > &  node_map,
NodeId  u,
NodeId  v 
)
private

Recurisve method used by __expandCodeIsMinimal.

Parameters
pA Pattern.
node_mapA bijection.
uA node in this Pattern.
vA node in this Pattern.
Returns
true if the expansion is minimal.

Definition at line 125 of file pattern.cpp.

References addArc(), addNodeWithLabel(), gum::ArcGraphPart::children(), code(), gum::prm::gspan::DFSCode::codes, gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::eraseFirst(), gum::ArcGraphPart::existsArc(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::existsFirst(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::first(), gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), label(), gum::ArcGraphPart::parents(), pop_back(), remove(), rightmostPath(), and gum::BijectionImplementation< T1, T2, Alloc, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::second().

Referenced by __expandCodeIsMinimal().

128  {
129  if (node_map.existsFirst(v)) {
130  if (node_map.second(u) < node_map.second(v)) {
131  // Invalid forward edge
132  return false;
133  } else if ((p.existsArc(node_map.second(u), node_map.second(v)))
134  || (p.existsArc(node_map.second(v), node_map.second(u)))) {
135  // Duplicate arc !
136  return false;
137  }
138  } else {
139  node_map.insert(v, p.addNodeWithLabel(label(v)));
140  }
141 
142  // Retrieving arc label data
143  LabelData* data = 0;
144 
145  try {
146  data = &(label(u, v));
147  } catch (NotFound&) { data = &(label(v, u)); }
148 
149  // Adding arc
150  try {
151  p.addArc(node_map.second(u), node_map.second(v), *data);
152  } catch (OperationNotAllowed&) {
153  // Invalid neighbor
154  if (node_map.second(u) < node_map.second(v)) {
155  p.remove(node_map.second(v));
156  node_map.eraseFirst(v);
157  }
158 
159  return false;
160  }
161 
162  // Check if this is minimal or if equal find another growth
163  size_t depth = p.code().codes.size() - 1;
164 
165  if (*(p.code().codes.back()) < *(code().codes[depth])) {
166  return true;
167  } else if (*(p.code().codes.back()) == *(code().codes[depth])) {
168  std::list< NodeId > r_path;
169  p.rightmostPath(r_path);
170 
171  for (const auto node : r_path) {
172  for (const auto nei : children(node_map.first(node)))
173  if (__rec(p, node_map, node_map.first(node), nei)) return true;
174 
175  for (const auto nei : parents(node_map.first(node)))
176  if (__rec(p, node_map, node_map.first(node), nei)) return true;
177  }
178  }
179 
180  if (p.code().codes.back()->isForward()) node_map.eraseFirst(v);
181 
182  p.pop_back();
183  return false;
184  }
DFSCode & code()
Returns the DFSCode of this Pattern.
Definition: pattern_inl.h:170
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
Definition: DFSCode.h:87
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
Definition: pattern_inl.h:47
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
bool __rec(Pattern &p, Bijection< NodeId, NodeId > &node_map, NodeId u, NodeId v)
Recurisve method used by __expandCodeIsMinimal.
Definition: pattern.cpp:125
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::ArcGraphPart::_eraseSetOfArcs ( const ArcSet set)
protectedinherited

a (virtualized) function to remove a given set of arcs

Warning
this function uses eraseArc, which is a virtual function. Hence the behaviour of this function is that of a virtual function

Definition at line 88 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::eraseArc().

88  {
89  for (const auto arc : set)
90  eraseArc(arc);
91  }
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart

+ Here is the call graph for this function:

INLINE void gum::ArcGraphPart::_unvirtualizedEraseSetOfArcs ( const ArcSet set)
protectedinherited

similar to _eraseSetOfArcs except that it is unvirtualized

Warning
this function uses ArcGraphPart::eraseArc, hence, as compared with _eraseSetOfArcs, it removes the arcs without calling a virtual eraseArc

Definition at line 121 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::eraseArc().

121  {
122  for (const auto& arc : set)
124  }
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart

+ Here is the call graph for this function:

INLINE void gum::prm::gspan::Pattern::addArc ( NodeId  i,
NodeId  j,
LabelData l 
)

Add an arc to this Pattern.

This create an EdgeCode and check if it respects neighborhood restriction, if not an exception is raised.

Parameters
iThe DFS subscript of the first node in the code.
jThe DFS subscript of the second node in the code.
lThe label data of the added edge.
Exceptions
OperationNotAllowedRaised if the neighborhood restriction is not respected.

Definition at line 115 of file pattern_inl.h.

References __arc_map, __node_map, gum::DiGraph::addArc(), code(), gum::prm::gspan::DFSCode::codes, gum::NodeGraphPart::exists(), GUM_ERROR, gum::prm::gspan::LabelData::id, and gum::prm::gspan::DFSCode::validNeighbors().

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth(), __expandCodeIsMinimal(), __not_rec(), __rec(), gum::prm::gspan::DFSTree< GUM_SCALAR >::addRoot(), and Pattern().

115  {
116  if (!(DiGraph::exists(i) && DiGraph::exists(j))) {
117  GUM_ERROR(NotFound, "node not found in this pattern");
118  }
119 
120  EdgeCode* edge =
121  new EdgeCode(i, j, __node_map[i]->id, l.id, __node_map[j]->id);
122 
123  if ((code().codes.size() == 0)
124  || (DFSCode::validNeighbors(code().codes.back(), edge))) {
125  DiGraph::addArc(i, j);
126  __arc_map.insert(Arc(i, j), std::make_pair(&l, edge));
127  code().codes.push_back(edge);
128  } else {
129  delete edge;
130  GUM_ERROR(OperationNotAllowed,
131  "illegal arc considering neighborhood restriction");
132  }
133  }
virtual void addArc(const NodeId tail, const NodeId head)
insert a new arc into the directed graph
Definition: diGraph_inl.h:32
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
DFSCode & code()
Returns the DFSCode of this Pattern.
Definition: pattern_inl.h:170
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
Definition: DFSCode.h:87
NodeProperty< LabelData * > __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Definition: pattern.h:206
static bool validNeighbors(EdgeCode *e1, EdgeCode *e2)
Returns true of e2 is a valid neighbor for e1 (i.e.
Definition: DFSCode.h:139
bool exists(const NodeId id) const
alias for existsNode
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::DiGraph::addArc ( const NodeId  tail,
const NodeId  head 
)
virtualinherited

insert a new arc into the directed graph

Parameters
tailthe id of the tail of the new inserted arc
headthe id of the head of the new inserted arc
Warning
if the arc already exists, nothing is done. In particular, no exception is raised.
Exceptions
InvalidNodeif head or tail does not belong to the graph nodes

Reimplemented from gum::ArcGraphPart.

Reimplemented in gum::DAG.

Definition at line 32 of file diGraph_inl.h.

References gum::ArcGraphPart::addArc(), gum::NodeGraphPart::exists(), and GUM_ERROR.

Referenced by gum::EssentialGraph::__buildEssentialGraph(), gum::MarkovBlanket::__buildMarkovBlanket(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_propagatesHead(), addArc(), gum::DAG::addArc(), and gum::DAGCycleDetector::addArc().

32  {
33  if (!exists(head)) { GUM_ERROR(InvalidNode, "head node"); }
34 
35  if (!exists(tail)) { GUM_ERROR(InvalidNode, "tail node"); }
36 
37  ArcGraphPart::addArc(tail, head);
38  }
virtual void addArc(const NodeId tail, const NodeId head)
insert a new arc into the ArcGraphPart
bool exists(const NodeId id) const
alias for existsNode
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE NodeId gum::NodeGraphPart::addNode ( )
virtualinherited

insert a new node and return its id

Returns
the id chosen by the internal idFactory

Reimplemented in gum::CliqueGraph.

Definition at line 247 of file nodeGraphPart_inl.h.

References GUM_EMIT1.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__addChild(), gum::prm::StructuredInference< GUM_SCALAR >::__addEdgesInReducedGraph(), gum::prm::o3prm::O3InterfaceFactory< GUM_SCALAR >::__addInterface2Dag(), gum::prm::ClassDependencyGraph< GUM_SCALAR >::__addNode(), gum::prm::o3prm::O3TypeFactory< GUM_SCALAR >::__addTypes2Dag(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::__buildPatternGraph(), gum::prm::StructuredInference< GUM_SCALAR >::__buildPatternGraph(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::__checkAndAddNodesToDag(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::gspan::DFSTree< GUM_SCALAR >::__initialiaze_root(), gum::IncrementalGraphLearner< AttributeSelection, isScalar >::_insertNode(), gum::prm::PRMSystem< GUM_SCALAR >::add(), gum::prm::gspan::DFSTree< GUM_SCALAR >::addRoot(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::clear(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), gum::IncrementalGraphLearner< AttributeSelection, isScalar >::IncrementalGraphLearner(), gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert(), gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::MultiDimFunctionGraph(), and gum::LeafAggregator::update().

247  {
248  NodeId newNode;
249 
250  // fill the first hole if holes exist
251  if (__holes && (!__holes->empty())) {
252  newNode = *(__holes->begin());
253  __eraseHole(newNode);
254  } else {
255  newNode = __boundVal;
256  ++__boundVal;
258  }
259 
260  GUM_EMIT1(onNodeAdded, newNode);
261 
262  return newNode;
263  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
bool empty() const noexcept
Indicates whether the set is the empty set.
Definition: set_tpl.h:707
NodeSet * __holes
the set of nodes not contained in the NodeGraphPart in the interval 1..__max
#define GUM_EMIT1(signal, arg1)
Definition: signaler1.h:40
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart
iterator begin() const
The usual unsafe begin iterator to parse the set.
Definition: set_tpl.h:517
void __updateEndIteratorSafe()
updating endIterator (always at __max+1)
Signaler1< NodeId > onNodeAdded
void __eraseHole(NodeId id)
to delete hole.

+ Here is the caller graph for this function:

INLINE std::vector< NodeId > gum::NodeGraphPart::addNodes ( Size  n)
inherited

insert n nodes

Parameters
nthe number of nodes to add
Returns
the vector of chosen ids

Definition at line 265 of file nodeGraphPart_inl.h.

265  {
266  std::vector< NodeId > v;
267  v.reserve(N);
268  for (Idx i = 0; i < N; i++)
269  v.push_back(this->addNode());
270  return v;
271  }
unsigned long Idx
Type for indexes.
Definition: types.h:43
void gum::NodeGraphPart::addNodeWithId ( const NodeId  id)
virtualinherited

try to insert a node with the given id

Warning
This method should be carefully used. Please prefer populateNodes or populateNodesFromProperty when possible
Exceptions
DuplicateElementexception if the id already exists

Definition at line 126 of file nodeGraphPart.cpp.

References gum::NodeGraphPart::__boundVal, gum::NodeGraphPart::__eraseHole(), gum::NodeGraphPart::__holes, gum::NodeGraphPart::__inHoles(), gum::NodeGraphPart::__updateEndIteratorSafe(), GUM_EMIT1, GUM_ERROR, gum::Set< Key, Alloc >::insert(), and gum::NodeGraphPart::onNodeAdded.

Referenced by gum::prm::PRMClass< GUM_SCALAR >::__addCastDescendants(), gum::prm::PRMInterface< GUM_SCALAR >::__addCastDescendants(), gum::EssentialGraph::__buildEssentialGraph(), gum::MarkovBlanket::__buildMarkovBlanket(), gum::SpanningForestPrim::__computeInAComponent(), gum::prm::PRMClass< GUM_SCALAR >::__implementInterfaces(), gum::prm::PRMInterface< GUM_SCALAR >::__inheritInterface(), gum::learning::genericBNLearner::__learnDAG(), gum::prm::PRMInterface< GUM_SCALAR >::__overloadAttribute(), gum::prm::PRMClass< GUM_SCALAR >::__overloadAttribute(), gum::learning::genericBNLearner::__prepare_miic_3off2(), gum::prm::GSpan< GUM_SCALAR >::__sortPatterns(), gum::InfluenceDiagram< GUM_SCALAR >::_addNode(), gum::InfluenceDiagram< GUM_SCALAR >::_moralGraph(), gum::prm::PRMInterface< GUM_SCALAR >::add(), gum::prm::PRMClass< GUM_SCALAR >::add(), gum::BayesNet< GUM_SCALAR >::add(), addNodeWithLabel(), gum::prm::StructuredInference< GUM_SCALAR >::CData::CData(), gum::InfluenceDiagram< GUM_SCALAR >::getDecisionGraph(), gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates(), gum::prm::PRMClass< GUM_SCALAR >::inheritAttributes(), gum::prm::PRMClass< GUM_SCALAR >::inheritParameters(), gum::prm::PRMClass< GUM_SCALAR >::inheritReferenceSlots(), gum::prm::PRMClass< GUM_SCALAR >::inheritSlotChains(), gum::BayesNetFragment< GUM_SCALAR >::installNode(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph(), gum::learning::Miic::learnStructure(), gum::UndiGraph::partialUndiGraph(), and gum::learning::StructuralConstraintDAG::StructuralConstraintDAG().

126  {
127  if (id >= __boundVal) {
128  if (id > __boundVal) { // we have to add holes
129  if (!__holes) __holes = new NodeSet();
130 
131  for (NodeId i = __boundVal; i < id; ++i)
132  __holes->insert(i);
133  }
134 
135  __boundVal = id + 1;
136 
138  } else {
139  if (__inHoles(id)) { // we fill a hole
140  __eraseHole(id);
141  } else {
142  GUM_ERROR(DuplicateElement, "Id " << id << " is already used");
143  }
144  }
145 
146  GUM_EMIT1(onNodeAdded, id);
147  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
NodeSet * __holes
the set of nodes not contained in the NodeGraphPart in the interval 1..__max
#define GUM_EMIT1(signal, arg1)
Definition: signaler1.h:40
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
bool __inHoles(NodeId id) const
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart
void __updateEndIteratorSafe()
updating endIterator (always at __max+1)
Signaler1< NodeId > onNodeAdded
void __eraseHole(NodeId id)
to delete hole.
void insert(const Key &k)
Inserts a new element into the set.
Definition: set_tpl.h:613
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

INLINE NodeId gum::prm::gspan::Pattern::addNodeWithLabel ( LabelData l)

Insert a node with the given LabelData.

Returns
The id assigned to the inserted node.

Definition at line 38 of file pattern_inl.h.

References __last, __node_map, gum::NodeGraphPart::addNodeWithId(), and size().

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth(), __expandCodeIsMinimal(), __not_rec(), __rec(), gum::prm::gspan::DFSTree< GUM_SCALAR >::addRoot(), and Pattern().

38  {
39  NodeId n = NodeId(size() + 1);
41  __node_map.insert(n, &l);
42  __last = &l;
43  return n;
44  }
virtual void addNodeWithId(const NodeId id)
try to insert a node with the given id
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
NodeProperty< LabelData * > __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Definition: pattern.h:206
LabelData * __last
The last LabelData added to this pattern.
Definition: pattern.h:213
Size size() const
Returns the number of nodes in this Pattern.
Definition: pattern_inl.h:144

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE const ArcSet & gum::prm::gspan::Pattern::arcs ( ) const

Definition at line 167 of file pattern_inl.h.

References gum::ArcGraphPart::arcs().

Referenced by toDot().

167 { return DiGraph::arcs(); }
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename VAL >
ArcProperty< VAL > gum::ArcGraphPart::arcsProperty ( VAL(*)(const Arc &)  f,
Size  size = 0 
) const
inherited

a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL f(x))

Parameters
fa function assigning a VAL to any arc
sizean optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of arcs. If you do not specify this parameter, the method will assign it for you.
template<typename VAL >
ArcProperty< VAL > gum::ArcGraphPart::arcsProperty ( const VAL &  a,
Size  size = 0 
) const
inherited

a method to create a hashMap of VAL from a set of arcs (using for every arc, say x, the VAL a)

Parameters
athe default value assigned to each arc in the returned Property
sizean optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of arcs. If you do not specify this parameter, the method will assign it for you.
INLINE NodeSet gum::NodeGraphPart::asNodeSet ( ) const
inherited

returns a copy of the set of nodes represented by the NodeGraphPart

Warning
this function is o(n) where n is the number of nodes. In space and in time. Usually, when you need to parse the nodes of a NodeGraphPart, prefer using
for(const auto n : nodes())
rather than
for(const auto n : asNodeSet())
as this is faster and consumes much less memory.

Definition at line 355 of file nodeGraphPart_inl.h.

References gum::Set< Key, Alloc >::insert().

Referenced by gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder().

355  {
356  NodeSet son(sizeNodes());
357 
358  if (!empty()) {
359  for (NodeId n = 0; n < __boundVal; ++n) {
360  if (!__inHoles(n)) son.insert(n);
361  }
362  }
363 
364  return son;
365  }
Size sizeNodes() const
returns the number of nodes in the NodeGraphPart
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
bool __inHoles(NodeId id) const
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart
bool empty() const
alias for emptyNodes

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE NodeGraphPartIterator gum::NodeGraphPart::begin ( ) const
noexceptinherited

a begin iterator to parse the set of nodes contained in the NodeGraphPart

Definition at line 327 of file nodeGraphPart_inl.h.

References gum::NodeGraphPartIterator::_validate().

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::parent(), and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().

327  {
328  NodeGraphPartIterator it(*this);
329  it._validate(); // stop the iterator at the first not-in-holes
330  return it;
331  }
friend class NodeGraphPartIterator

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE NodeGraphPartIteratorSafe gum::NodeGraphPart::beginSafe ( ) const
inherited

a begin iterator to parse the set of nodes contained in the NodeGraphPart

Definition at line 313 of file nodeGraphPart_inl.h.

References gum::NodeGraphPartIterator::_validate().

313  {
314  NodeGraphPartIteratorSafe it(*this);
315  it._validate(); // stop the iterator at the first not-in-holes
316  return it;
317  }
friend class NodeGraphPartIteratorSafe

+ Here is the call graph for this function:

INLINE NodeId gum::NodeGraphPart::bound ( ) const
inherited

returns a number n such that all node ids are strictly lower than n

Definition at line 302 of file nodeGraphPart_inl.h.

Referenced by gum::NodeGraphPart::__clearNodes(), gum::StaticTriangulation::__computeEliminationTree(), gum::NodeGraphPartIterator::_setPos(), and gum::NodeGraphPartIterator::_validate().

302 { return __boundVal; }
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart

+ Here is the caller graph for this function:

INLINE const NodeSet & gum::ArcGraphPart::children ( const NodeId  id) const
inherited

returns the set of nodes with arc outgoing from a given node

Note that the set of arcs returned may be empty if no arc within the ArcGraphPart is outgoing from the given node.

Parameters
idthe node which is the tail of the arcs returned

Definition at line 59 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__checkChildren(), and gum::ArcGraphPart::__children.

Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AR(), gum::EssentialGraph::__buildEssentialGraph(), gum::prm::PRMClass< GUM_SCALAR >::__checkInterface(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__connect(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__directedPath(), __expandCodeIsMinimal(), gum::DAG::__hasDirectedPath(), gum::IBayesNet< GUM_SCALAR >::__minimalCondSetVisitDn(), gum::IBayesNet< GUM_SCALAR >::__minimalCondSetVisitUp(), __not_rec(), gum::prm::PRMClass< GUM_SCALAR >::__overloadReference(), __rec(), gum::InfluenceDiagram< GUM_SCALAR >::_getChildrenDecision(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_initialize(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_makeInferenceNodeToNeighbours(), gum::ArcGraphPart::ArcGraphPart(), gum::MarkovBlanket::children(), gum::EssentialGraph::children(), gum::DAGmodel::children(), gum::ArcGraphPart::directedUnorientedPath(), gum::InfluenceDiagram< GUM_SCALAR >::erase(), gum::ArcGraphPart::eraseChildren(), gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween(), isMinimal(), gum::IBayesNet< GUM_SCALAR >::minimalCondSet(), gum::MixedGraph::mixedUnorientedPath(), gum::BayesBall::relevantPotentials(), gum::dSeparation::relevantPotentials(), remove(), gum::BayesBall::requisiteNodes(), gum::dSeparation::requisiteNodes(), gum::MarkovBlanket::toDot(), gum::EssentialGraph::toDot(), gum::InfluenceDiagram< GUM_SCALAR >::toDot(), gum::MixedGraph::toDot(), and gum::ArcGraphPart::unvirtualizedEraseChildren().

59  {
60  __checkChildren(id);
61  return *(__children[id]);
62  }
void __checkChildren(const NodeId id) const
when the ArcGraphPart contains no arc outgoing from a given node, this function adds an empty set ent...
NodeProperty< NodeSet * > __children
for each arc, the set of its children
Definition: arcGraphPart.h:272

+ Here is the call graph for this function:

INLINE void gum::DiGraph::clear ( )
virtualinherited

removes all the nodes and arcs from the graph

Reimplemented from gum::NodeGraphPart.

Reimplemented in gum::MixedGraph.

Definition at line 40 of file diGraph_inl.h.

References gum::ArcGraphPart::clearArcs(), and gum::NodeGraphPart::clearNodes().

Referenced by gum::DiGraph::operator=().

40  {
43  }
void clearArcs()
removes all the arcs from the ArcGraphPart
virtual void clearNodes()
remove all the nodes from the NodeGraphPart

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gum::ArcGraphPart::clearArcs ( )
inherited

removes all the arcs from the ArcGraphPart

Definition at line 76 of file arcGraphPart.cpp.

References gum::ArcGraphPart::__arcs, gum::ArcGraphPart::__children, gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::clear(), GUM_EMIT2, and gum::ArcGraphPart::onArcDeleted.

Referenced by gum::DiGraph::clear(), gum::MixedGraph::clear(), gum::ArcGraphPart::operator=(), gum::MixedGraph::operator=(), and gum::ArcGraphPart::~ArcGraphPart().

76  {
77  for (const auto& elt : __parents)
78  delete elt.second;
79 
80  __parents.clear();
81 
82  for (const auto& elt : __children)
83  delete elt.second;
84 
85  __children.clear();
86 
87  // we need this copy only if at least one onArcDeleted listener exists
88  if (onArcDeleted.hasListener()) {
89  ArcSet tmp = __arcs;
90  __arcs.clear();
91 
92  for (const auto& arc : tmp)
93  GUM_EMIT2(onArcDeleted, arc.tail(), arc.head());
94  } else {
95  __arcs.clear();
96  }
97  }
Set< Arc > ArcSet
Some typdefs and define for shortcuts ...
#define GUM_EMIT2(signal, arg1, arg2)
Definition: signaler2.h:40
NodeProperty< NodeSet * > __parents
for each arc, the sets of its parents
Definition: arcGraphPart.h:269
NodeProperty< NodeSet * > __children
for each arc, the set of its children
Definition: arcGraphPart.h:272
Signaler2< NodeId, NodeId > onArcDeleted
Definition: arcGraphPart.h:81
void clear()
Removes all the elements, if any, from the set.
Definition: set_tpl.h:375
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
Definition: arcGraphPart.h:266

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::NodeGraphPart::clearNodes ( )
virtualinherited

remove all the nodes from the NodeGraphPart

Definition at line 304 of file nodeGraphPart_inl.h.

Referenced by gum::DiGraph::clear(), gum::UndiGraph::clear(), gum::MixedGraph::clear(), and gum::MixedGraph::operator=().

304 { __clearNodes(); }
void __clearNodes()
code for clearing nodes (called twice)

+ Here is the caller graph for this function:

INLINE DFSCode & gum::prm::gspan::Pattern::code ( )

Returns the DFSCode of this Pattern.

Definition at line 170 of file pattern_inl.h.

References __code.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__addChild(), gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth(), __not_rec(), __rec(), gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining(), addArc(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), isMinimal(), and Pattern().

170 { return __code; }
DFSCode __code
The DFSCode of this Pattern.
Definition: pattern.h:202

+ Here is the caller graph for this function:

INLINE const DFSCode & gum::prm::gspan::Pattern::code ( ) const

Returns the DFSCode of this Pattern.

Definition at line 173 of file pattern_inl.h.

References __code.

173 { return __code; }
DFSCode __code
The DFSCode of this Pattern.
Definition: pattern.h:202
const std::vector< NodeId > gum::ArcGraphPart::directedPath ( const NodeId  node1,
const NodeId  node2 
) const
inherited

returns a directed path from node1 to node2 belonging to the set of arcs

Parameters
node1the id from which the path begins
node2the id to which the path ends
Exceptions
NotFoundexception is raised if no path can be found between the two nodes

Definition at line 152 of file arcGraphPart.cpp.

References gum::List< Val, Alloc >::empty(), gum::HashTable< Key, Val, Alloc >::exists(), gum::List< Val, Alloc >::front(), GUM_ERROR, gum::HashTable< Key, Val, Alloc >::insert(), gum::ArcGraphPart::parents(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().

Referenced by gum::learning::Miic::_orientation_latents().

153  {
154  // not recursive version => use a FIFO for simulating the recursion
155  List< NodeId > nodeFIFO;
156  nodeFIFO.pushBack(n2);
157 
158  // mark[node] = successor if visited, else mark[node] does not exist
159  NodeProperty< NodeId > mark;
160  mark.insert(n2, n2);
161 
162  NodeId current;
163 
164  while (!nodeFIFO.empty()) {
165  current = nodeFIFO.front();
166  nodeFIFO.popFront();
167 
168  // check the parents
169 
170  for (const auto new_one : parents(current)) {
171  if (mark.exists(new_one)) // if this node is already marked, do not
172  continue; // check it again
173 
174  mark.insert(new_one, current);
175 
176  if (new_one == n1) {
177  std::vector< NodeId > v;
178 
179  for (current = n1; current != n2; current = mark[current])
180  v.push_back(current);
181 
182  v.push_back(n2);
183 
184  return v;
185  }
186 
187  nodeFIFO.pushBack(new_one);
188  }
189  }
190 
191  GUM_ERROR(NotFound, "no path found");
192  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::vector< NodeId > gum::ArcGraphPart::directedUnorientedPath ( const NodeId  node1,
const NodeId  node2 
) const
inherited

returns an unoriented (directed) path from node1 to node2 in the arc set

Parameters
node1the id from which the path begins
node2the id to which the path ends
Exceptions
NotFoundexception is raised if no path can be found between the two nodes

Definition at line 195 of file arcGraphPart.cpp.

References gum::ArcGraphPart::children(), gum::List< Val, Alloc >::empty(), gum::HashTable< Key, Val, Alloc >::exists(), gum::List< Val, Alloc >::front(), GUM_ERROR, gum::HashTable< Key, Val, Alloc >::insert(), gum::ArcGraphPart::parents(), gum::List< Val, Alloc >::popFront(), and gum::List< Val, Alloc >::pushBack().

195  {
196  // not recursive version => use a FIFO for simulating the recursion
197  List< NodeId > nodeFIFO;
198  nodeFIFO.pushBack(n2);
199 
200  // mark[node] = successor if visited, else mark[node] does not exist
201  NodeProperty< NodeId > mark;
202  mark.insert(n2, n2);
203 
204  NodeId current;
205 
206  while (!nodeFIFO.empty()) {
207  current = nodeFIFO.front();
208  nodeFIFO.popFront();
209 
210  // check the parents
211  for (const auto new_one : parents(current)) {
212  if (mark.exists(new_one)) // the node has already been visited
213  continue;
214 
215  mark.insert(new_one, current);
216 
217  if (new_one == n1) {
218  std::vector< NodeId > v;
219 
220  for (current = n1; current != n2; current = mark[current])
221  v.push_back(current);
222 
223  v.push_back(n2);
224 
225  return v;
226  }
227 
228  nodeFIFO.pushBack(new_one);
229  }
230 
231  // check the children
232  for (const auto new_one : children(current)) {
233  if (mark.exists(new_one)) // the node has already been visited
234  continue;
235 
236  mark.insert(new_one, current);
237 
238  if (new_one == n1) {
239  std::vector< NodeId > v;
240 
241  for (current = n1; current != n2; current = mark[current])
242  v.push_back(current);
243 
244  v.push_back(n2);
245 
246  return v;
247  }
248 
249  nodeFIFO.pushBack(new_one);
250  }
251  }
252 
253  GUM_ERROR(NotFound, "no path found");
254  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

INLINE EdgeCode & gum::prm::gspan::Pattern::edgeCode ( NodeId  tail,
NodeId  head 
)

Returns the EdgeCode of an edge of this Pattern.

Definition at line 176 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth().

176  {
177  try {
178  return *(__arc_map[Arc(tail, head)].second);
179  } catch (NotFound&) { GUM_ERROR(NotFound, "arc not found in Pattern"); }
180  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the caller graph for this function:

INLINE EdgeCode & gum::prm::gspan::Pattern::edgeCode ( const Arc arc)

Returns the EdgeCode of an edge of this Pattern.

Definition at line 183 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

183  {
184  try {
185  return *(__arc_map[arc].second);
186  } catch (NotFound&) { GUM_ERROR(NotFound, "arc not found in Pattern"); }
187  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE const EdgeCode & gum::prm::gspan::Pattern::edgeCode ( NodeId  tail,
NodeId  head 
) const

Returns the EdgeCode of an edge of this Pattern.

Definition at line 190 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

190  {
191  try {
192  return *(__arc_map[Arc(tail, head)].second);
193  } catch (NotFound&) { GUM_ERROR(NotFound, "arc not found in Pattern"); }
194  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE const EdgeCode & gum::prm::gspan::Pattern::edgeCode ( const Arc arc) const

Returns the EdgeCode of an edge of this Pattern.

Definition at line 197 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

197  {
198  try {
199  return *(__arc_map[arc].second);
200  } catch (NotFound&) { GUM_ERROR(NotFound, "arc not found in Pattern"); }
201  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE bool gum::NodeGraphPart::empty ( ) const
inherited

alias for emptyNodes

Definition at line 300 of file nodeGraphPart_inl.h.

Referenced by remove().

300 { return emptyNodes(); }
bool emptyNodes() const
indicates whether there exists nodes in the NodeGraphPart

+ Here is the caller graph for this function:

INLINE bool gum::ArcGraphPart::emptyArcs ( ) const
inherited

indicates wether the ArcGraphPart contains any arc

Definition at line 32 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__arcs, and gum::Set< Key, Alloc >::empty().

32 { return __arcs.empty(); }
bool empty() const noexcept
Indicates whether the set is the empty set.
Definition: set_tpl.h:707
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
Definition: arcGraphPart.h:266

+ Here is the call graph for this function:

INLINE bool gum::NodeGraphPart::emptyNodes ( ) const
inherited

indicates whether there exists nodes in the NodeGraphPart

Definition at line 298 of file nodeGraphPart_inl.h.

298 { return (sizeNodes() == 0); }
Size sizeNodes() const
returns the number of nodes in the NodeGraphPart
INLINE const NodeGraphPartIterator & gum::NodeGraphPart::end ( ) const
noexceptinherited

the end iterator to parse the set of nodes contained in the NodeGraphPart

Definition at line 333 of file nodeGraphPart_inl.h.

Referenced by gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::toDot().

333  {
334  return __endIteratorSafe;
335  }
NodeGraphPartIteratorSafe __endIteratorSafe
the end iterator (used to speed-up parsings of the NodeGraphPart)

+ Here is the caller graph for this function:

INLINE const NodeGraphPartIteratorSafe & gum::NodeGraphPart::endSafe ( ) const
noexceptinherited

the end iterator to parse the set of nodes contained in the NodeGraphPart

Definition at line 323 of file nodeGraphPart_inl.h.

323  {
324  return __endIteratorSafe;
325  }
NodeGraphPartIteratorSafe __endIteratorSafe
the end iterator (used to speed-up parsings of the NodeGraphPart)
INLINE void gum::ArcGraphPart::eraseArc ( const Arc arc)
virtualinherited

removes an arc from the ArcGraphPart

Parameters
arcthe arc to be removed
Warning
if the arc does not exist, nothing is done. In particular, no exception is thrown. However, the signal onArcDeleted is fired only if a node is effectively removed.

Definition at line 76 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__arcs, gum::ArcGraphPart::__children, gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::erase(), gum::ArcGraphPart::existsArc(), GUM_EMIT2, gum::Arc::head(), gum::ArcGraphPart::onArcDeleted, and gum::Arc::tail().

Referenced by gum::EssentialGraph::__buildEssentialGraph(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::learning::genericBNLearner::__learnDAG(), gum::ArcGraphPart::_eraseSetOfArcs(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::BayesNetFragment< GUM_SCALAR >::_uninstallArc(), gum::ArcGraphPart::_unvirtualizedEraseSetOfArcs(), gum::DAGCycleDetector::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), gum::BayesNet< GUM_SCALAR >::eraseArc(), gum::ArcGraphPart::eraseChildren(), gum::ArcGraphPart::eraseParents(), gum::learning::GreedyHillClimbing::learnStructure(), gum::learning::LocalSearchWithTabuList::learnStructure(), pop_back(), gum::BayesNet< GUM_SCALAR >::reverseArc(), gum::ArcGraphPart::unvirtualizedEraseChildren(), and gum::ArcGraphPart::unvirtualizedEraseParents().

76  {
77  // ASSUMING tail and head exists in __parents anf __children
78  // (if not, it is an error)
79  if (existsArc(arc)) {
80  NodeId tail = arc.tail(), head = arc.head();
81  __parents[head]->erase(tail);
82  __children[tail]->erase(head);
83  __arcs.erase(arc);
84  GUM_EMIT2(onArcDeleted, tail, head);
85  }
86  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
void erase(const Key &k)
Erases an element from the set.
Definition: set_tpl.h:656
#define GUM_EMIT2(signal, arg1, arg2)
Definition: signaler2.h:40
NodeProperty< NodeSet * > __parents
for each arc, the sets of its parents
Definition: arcGraphPart.h:269
bool existsArc(const Arc &arc) const
indicates whether a given arc exists
NodeProperty< NodeSet * > __children
for each arc, the set of its children
Definition: arcGraphPart.h:272
Signaler2< NodeId, NodeId > onArcDeleted
Definition: arcGraphPart.h:81
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
Definition: arcGraphPart.h:266

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::ArcGraphPart::eraseChildren ( const NodeId  id)
inherited

removes all the children of a given node

Parameters
idthe node all the children of which will be removed
Warning
although this method is not virtual, it calls method eraseArc( const Arc& arc ) and, as such, has a "virtual" behaviour. If you do not wish it to have this "virtual" behaviour, call instead method unvirtualizedEraseChildren
if no arc is a parent of id, nothing is done. In particular, no exception is thrown.

Definition at line 107 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__children, gum::Set< Key, Alloc >::beginSafe(), gum::ArcGraphPart::children(), gum::Set< Key, Alloc >::endSafe(), and gum::ArcGraphPart::eraseArc().

107  {
108  if (__children.exists(id)) {
109  NodeSet& children = *(__children[id]);
110 
111  for (auto iter = children.beginSafe(); // safe iterator needed here
112  iter != children.endSafe();
113  ++iter) {
114  // warning: use this erase so that you actually use the vritualized
115  // arc removal function
116  eraseArc(Arc(id, *iter));
117  }
118  }
119  }
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
NodeProperty< NodeSet * > __children
for each arc, the set of its children
Definition: arcGraphPart.h:272

+ Here is the call graph for this function:

INLINE void gum::DiGraph::eraseNode ( const NodeId  id)
virtualinherited

remove a node and its adjacent arcs from the graph

Parameters
idthe id of the node to be removed
Warning
if the node does not exist, nothing is done. In particular, no exception is raised.

Reimplemented from gum::NodeGraphPart.

Reimplemented in gum::MixedGraph.

Definition at line 66 of file diGraph_inl.h.

References gum::NodeGraphPart::eraseNode(), gum::ArcGraphPart::unvirtualizedEraseChildren(), and gum::ArcGraphPart::unvirtualizedEraseParents().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::__checkInterface(), gum::prm::PRMClass< GUM_SCALAR >::__checkRefInterface(), gum::BarrenNodesFinder::barrenNodes(), gum::BayesNet< GUM_SCALAR >::erase(), gum::InfluenceDiagram< GUM_SCALAR >::erase(), pop_back(), remove(), and gum::BayesNetFragment< GUM_SCALAR >::uninstallNode().

66  {
67  // warning: to remove the arcs adjacent to id, use the unvirtualized
68  // versions
69  // of arc removals
72 
74  }
void unvirtualizedEraseChildren(const NodeId id)
same function as eraseChildren but without any virtual call to an erase
void unvirtualizedEraseParents(const NodeId id)
same function as eraseParents but without any virtual call to an erase
virtual void eraseNode(const NodeId id)
erase the node with the given id

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::ArcGraphPart::eraseParents ( const NodeId  id)
inherited

erase all the parents of a given node

Parameters
idthe node all the parents of which will be removed
Warning
although this method is not virtual, it calls method eraseArc( const Arc& arc ) and, as such, has a "virtual" behaviour. If you do not wish it to have this "virtual" behaviour, call instead method unvirtualizedEraseParents
if no arc is a parent of id, nothing is done. In particular, no exception is thrown.

Definition at line 93 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::beginSafe(), gum::Set< Key, Alloc >::endSafe(), gum::ArcGraphPart::eraseArc(), and gum::ArcGraphPart::parents().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::__overloadAttribute().

93  {
94  if (__parents.exists(id)) {
95  NodeSet& parents = *(__parents[id]);
96 
97  for (auto iter = parents.beginSafe(); // safe iterator needed here
98  iter != parents.endSafe();
99  ++iter) {
100  // warning: use this erase so that you actually use the virtualized
101  // arc removal function
102  eraseArc(Arc(*iter, id));
103  }
104  }
105  }
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
NodeProperty< NodeSet * > __parents
for each arc, the sets of its parents
Definition: arcGraphPart.h:269

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE bool gum::prm::gspan::Pattern::exists ( NodeId  id) const

Returns true if id is a node in this Pattern.

Definition at line 136 of file pattern_inl.h.

References gum::NodeGraphPart::exists().

136 { return DiGraph::exists(id); }
bool exists(const NodeId id) const
alias for existsNode

+ Here is the call graph for this function:

INLINE bool gum::prm::gspan::Pattern::exists ( NodeId  tail,
NodeId  head 
) const

Returns true if (tail, head) is an arc in this Pattern.

Definition at line 139 of file pattern_inl.h.

References gum::ArcGraphPart::existsArc().

139  {
140  return DiGraph::existsArc(tail, head);
141  }
bool existsArc(const Arc &arc) const
indicates whether a given arc exists

+ Here is the call graph for this function:

INLINE bool gum::ArcGraphPart::existsArc ( const Arc arc) const
inherited

indicates whether a given arc exists

Parameters
arcthe arc we test whether or not it belongs to the ArcGraphPart

Definition at line 38 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__arcs, and gum::Set< Key, Alloc >::contains().

Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AorR(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AR(), gum::MarkovBlanket::__buildMarkovBlanket(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__connect(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__directedPath(), gum::learning::Miic::__existsDirectedPath(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__jump_multi(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__jump_poly(), __not_rec(), __rec(), gum::learning::Miic::_orientation_3off2(), gum::learning::Miic::_orientation_latents(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_updateProbaTriples(), gum::prm::PRMClass< GUM_SCALAR >::addArc(), gum::DAGCycleDetector::addArc(), gum::ArcGraphPart::eraseArc(), gum::DAGCycleDetector::eraseArc(), gum::InfluenceDiagram< GUM_SCALAR >::eraseArc(), exists(), and gum::BayesNet< GUM_SCALAR >::reverseArc().

38  {
39  return __arcs.contains(arc);
40  }
bool contains(const Key &k) const
Indicates whether a given elements belong to the set.
Definition: set_tpl.h:581
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
Definition: arcGraphPart.h:266

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE bool gum::ArcGraphPart::existsArc ( const NodeId  tail,
const NodeId  head 
) const
inherited

indicates whether a given arc exists

Parameters
tailthe tail of the arc we test the existence in the ArcGraphPart
headthe head of the arc we test the existence in the ArcGraphPart

Definition at line 42 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__parents.

42  {
43  return __parents.exists(head) && __parents[head]->exists(tail);
44  }
NodeProperty< NodeSet * > __parents
for each arc, the sets of its parents
Definition: arcGraphPart.h:269
INLINE bool gum::NodeGraphPart::existsNode ( const NodeId  id) const
inherited
bool gum::prm::gspan::Pattern::isMinimal ( )

Returns the DFSCode of this Pattern.

Definition at line 53 of file pattern.cpp.

References __expandCodeIsMinimal(), gum::ArcGraphPart::children(), code(), gum::prm::gspan::DFSCode::codes, gum::prm::gspan::LabelData::id, label(), nodes(), and gum::ArcGraphPart::parents().

Referenced by gum::prm::gspan::DFSTree< GUM_SCALAR >::__checkGrowth().

53  {
54  for (const auto node : nodes()) {
55  for (const auto next : parents(node)) {
56  Size u = label(node).id;
57  Size v = label(next).id;
58  EdgeCode edge_code(1, 2, u, label(next, node).id, v);
59 
60  if (edge_code < *(code().codes.front())) {
61  return false;
62  } else if (edge_code == (*code().codes.front())) {
63  if (__expandCodeIsMinimal(node, next)) { return false; }
64  }
65  }
66 
67  for (const auto next : children(node)) {
68  Size u = label(node).id;
69  Size v = label(next).id;
70  EdgeCode edge_code(1, 2, u, label(node, next).id, v);
71 
72  if (edge_code < *(code().codes.front())) {
73  return false;
74  } else if (edge_code == (*code().codes.front())) {
75  if (__expandCodeIsMinimal(node, next)) { return false; }
76  }
77  }
78  }
79 
80  return true;
81  }
unsigned long Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:50
DFSCode & code()
Returns the DFSCode of this Pattern.
Definition: pattern_inl.h:170
bool __expandCodeIsMinimal(NodeId u, NodeId v)
Returns true if the expand code by adding and edge betwenne u and v is minimal with respect to __code...
Definition: pattern.cpp:96
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
Definition: DFSCode.h:87
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
Definition: pattern_inl.h:47
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
const NodeGraphPart & nodes() const
Definition: pattern_inl.h:163
Idx id
An unique identifier for this label.
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE LabelData & gum::prm::gspan::Pattern::label ( NodeId  node)

Returns the LabelData assigned to node.

Definition at line 47 of file pattern_inl.h.

References __node_map, and GUM_ERROR.

Referenced by __expandCodeIsMinimal(), __not_rec(), __rec(), gum::prm::gspan::TreeWidthSearch< GUM_SCALAR >::accept_root(), isMinimal(), Pattern(), and toDot().

47  {
48  try {
49  return *(__node_map[node]);
50  } catch (NotFound&) {
51  GUM_ERROR(NotFound, "node not found in this Pattern");
52  }
53  }
NodeProperty< LabelData * > __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Definition: pattern.h:206
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the caller graph for this function:

INLINE const LabelData & gum::prm::gspan::Pattern::label ( NodeId  node) const

Returns the LabelData assigned to node.

Definition at line 56 of file pattern_inl.h.

References __node_map, and GUM_ERROR.

56  {
57  try {
58  return *(__node_map[node]);
59  } catch (NotFound&) {
60  GUM_ERROR(NotFound, "node not found in this Pattern");
61  }
62  }
NodeProperty< LabelData * > __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Definition: pattern.h:206
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE LabelData & gum::prm::gspan::Pattern::label ( NodeId  i,
NodeId  j 
)

Returns the LabelData assigned to arc.

Definition at line 79 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

79  {
80  try {
81  return *(__arc_map[Arc(i, j)].first);
82  } catch (NotFound&) {
83  GUM_ERROR(NotFound, "arc not found in this Pattern");
84  }
85  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE const LabelData & gum::prm::gspan::Pattern::label ( NodeId  i,
NodeId  j 
) const

Returns the LabelData assigned to arc.

Definition at line 88 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

88  {
89  try {
90  return *(__arc_map[Arc(i, j)].first);
91  } catch (NotFound&) {
92  GUM_ERROR(NotFound, "arc not found in this Pattern");
93  }
94  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE LabelData & gum::prm::gspan::Pattern::label ( const Arc arc)

Returns the LabelData assigned to arc.

Definition at line 97 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

97  {
98  try {
99  return *(__arc_map[arc].first);
100  } catch (NotFound&) {
101  GUM_ERROR(NotFound, "arc not found in this Pattern");
102  }
103  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE const LabelData & gum::prm::gspan::Pattern::label ( const Arc arc) const

Returns the LabelData assigned to arc.

Definition at line 106 of file pattern_inl.h.

References __arc_map, and GUM_ERROR.

106  {
107  try {
108  return *(__arc_map[arc].first);
109  } catch (NotFound&) {
110  GUM_ERROR(NotFound, "arc not found in this Pattern");
111  }
112  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE LabelData & gum::prm::gspan::Pattern::lastAdded ( )

Insert a node with the given LabelData.

Returns
The id assigned to the inserted node.

Definition at line 65 of file pattern_inl.h.

References __last, and GUM_ERROR.

65  {
66  if (__last) return *__last;
67 
68  GUM_ERROR(OperationNotAllowed, "there are no LabelData yet");
69  }
LabelData * __last
The last LabelData added to this pattern.
Definition: pattern.h:213
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
INLINE const LabelData & gum::prm::gspan::Pattern::lastAdded ( ) const

Insert a node with the given LabelData.

Returns
The id assigned to the inserted node.

Definition at line 72 of file pattern_inl.h.

References __last, and GUM_ERROR.

72  {
73  if (__last) return *__last;
74 
75  GUM_ERROR(OperationNotAllowed, "there are no LabelData yet");
76  }
LabelData * __last
The last LabelData added to this pattern.
Definition: pattern.h:213
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66
template<typename VAL >
List< VAL > gum::ArcGraphPart::listMapArcs ( VAL(*)(const Arc &)  f) const
inherited

a method to create a list of VAL from a set of arcs (using for every arc, say x, the VAL f(x))

Parameters
fa function assigning a VAL to any arc
template<typename VAL >
List< VAL > gum::NodeGraphPart::listMapNodes ( VAL(*)(const NodeId &)  f) const
inherited

a method to create a list of VAL from a set of nodes (using for every nodee, say x, the VAL f(x))

Parameters
fa function assigning a VAL to any node
INLINE NodeId gum::NodeGraphPart::nextNodeId ( ) const
inherited

returns a new node id, not yet used by any node

Warning
a code like
id=nextNodeId();addNode(id);
is basically not thread safe !!
Returns
a node id not yet used by any node within the NodeGraphPart

Definition at line 223 of file nodeGraphPart_inl.h.

Referenced by gum::InfluenceDiagram< GUM_SCALAR >::_addNode(), and gum::BayesNet< GUM_SCALAR >::add().

223  {
224  NodeId next = 0;
225 
226  // return the first hole if holes exist
227  if (__holes && (!__holes->empty()))
228  next = *(__holes->begin());
229  else // in other case
230  next = __boundVal;
231 
232  return next;
233  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
bool empty() const noexcept
Indicates whether the set is the empty set.
Definition: set_tpl.h:707
NodeSet * __holes
the set of nodes not contained in the NodeGraphPart in the interval 1..__max
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart
iterator begin() const
The usual unsafe begin iterator to parse the set.
Definition: set_tpl.h:517

+ Here is the caller graph for this function:

INLINE const NodeGraphPart & gum::prm::gspan::Pattern::nodes ( ) const

Definition at line 163 of file pattern_inl.h.

References gum::NodeGraphPart::nodes().

Referenced by gum::prm::gspan::TreeWidthSearch< GUM_SCALAR >::accept_root(), and isMinimal().

163  {
164  return DiGraph::nodes();
165  }
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename VAL >
NodeProperty< VAL > gum::NodeGraphPart::nodesProperty ( VAL(*)(const NodeId &)  f,
Size  size = 0 
) const
inherited

a method to create a HashTable with key:NodeId and value:VAL

VAL are computed from the nodes using for all node x, VAL f(x). This method is a wrapper of the same method in HashTable.

See also
HashTable::map.
Parameters
fa function assigning a VAL to any node
sizean optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of nodes. If you do not specify this parameter, the method will assign it for you.

Referenced by gum::InfluenceDiagram< GUM_SCALAR >::_getChildrenDecision(), gum::BarrenNodesFinder::barrenNodes(), gum::BinaryJoinTreeConverterDefault::convert(), gum::InfluenceDiagram< GUM_SCALAR >::existsPathBetween(), and gum::UndiGraph::hasUndirectedCycle().

+ Here is the caller graph for this function:

template<typename VAL >
NodeProperty< VAL > gum::NodeGraphPart::nodesProperty ( const VAL &  a,
Size  size = 0 
) const
inherited

a method to create a hashMap with key:NodeId and value:VAL

for all nodes, the value stored is a. This method is a wrapper of the same method in HashTable.

See also
HashTable::map.
Parameters
athe default value assigned to each edge in the returned Property
sizean optional parameter enabling to fine-tune the returned Property. Roughly speaking, it is a good practice to have a size equal to half the number of nodes. If you do not specify this parameter, the method will assign it for you.
INLINE bool gum::ArcGraphPart::operator!= ( const ArcGraphPart p) const
inherited

tests whether two ArcGraphParts contain different arcs

Parameters
pthe ArcGraphPart that we compare with this

Definition at line 154 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__arcs.

154  {
155  return __arcs != p.__arcs;
156  }
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
Definition: arcGraphPart.h:266
INLINE bool gum::DiGraph::operator!= ( const DiGraph g) const
inherited

tests whether two DiGraphs are different

Parameters
gthe DiGraph with which "this" is compared

Definition at line 80 of file diGraph_inl.h.

References gum::DiGraph::operator==().

80  {
81  return !operator==(p);
82  }
bool operator==(const DiGraph &g) const
tests whether two DiGraphs are identical (same nodes, same arcs)
Definition: diGraph_inl.h:76

+ Here is the call graph for this function:

INLINE bool gum::NodeGraphPart::operator!= ( const NodeGraphPart p) const
inherited

check whether two NodeGraphParts contain different nodes

Parameters
pthe NodeGraphPart to be compared with "this"

Definition at line 351 of file nodeGraphPart_inl.h.

References gum::NodeGraphPartIterator::operator==().

351  {
352  return !operator==(p);
353  }
bool operator==(const NodeGraphPart &p) const
check whether two NodeGraphParts contain the same nodes

+ Here is the call graph for this function:

INLINE bool gum::ArcGraphPart::operator== ( const ArcGraphPart p) const
inherited

tests whether two ArcGraphParts contain the same arcs

Parameters
pthe ArcGraphPart that we compare with this

Definition at line 150 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__arcs.

Referenced by gum::DiGraph::operator==(), and gum::MixedGraph::operator==().

150  {
151  return __arcs == p.__arcs;
152  }
Set< Arc > __arcs
the set of all the arcs contained within the ArcGraphPart
Definition: arcGraphPart.h:266

+ Here is the caller graph for this function:

INLINE bool gum::DiGraph::operator== ( const DiGraph g) const
inherited

tests whether two DiGraphs are identical (same nodes, same arcs)

Parameters
gthe DiGraph with which "this" is compared

Definition at line 76 of file diGraph_inl.h.

References gum::ArcGraphPart::operator==(), and gum::NodeGraphPart::operator==().

Referenced by gum::DiGraph::operator!=().

76  {
78  }
bool operator==(const NodeGraphPart &p) const
check whether two NodeGraphParts contain the same nodes
bool operator==(const ArcGraphPart &p) const
tests whether two ArcGraphParts contain the same arcs

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE bool gum::NodeGraphPart::operator== ( const NodeGraphPart p) const
inherited

check whether two NodeGraphParts contain the same nodes

Parameters
pthe NodeGraphPart to be compared with "this"

Definition at line 337 of file nodeGraphPart_inl.h.

References gum::NodeGraphPart::__boundVal, and gum::NodeGraphPart::__holes.

Referenced by gum::UndiGraph::operator==(), gum::DiGraph::operator==(), and gum::MixedGraph::operator==().

337  {
338  if (__boundVal != p.__boundVal) return false;
339 
340  if (__holes)
341  if (p.__holes)
342  return (*__holes == *p.__holes);
343  else
344  return false;
345  else if (p.__holes)
346  return false;
347 
348  return true;
349  }
NodeSet * __holes
the set of nodes not contained in the NodeGraphPart in the interval 1..__max
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart

+ Here is the caller graph for this function:

INLINE const NodeSet & gum::ArcGraphPart::parents ( const NodeId  id) const
inherited

returns the set of nodes with arc ingoing to a given node

Note that the set of arcs returned may be empty if no arc within the ArcGraphPart is ingoing into the given node.

Parameters
idthe node toward which the arcs returned are pointing

Definition at line 54 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__checkParents(), and gum::ArcGraphPart::__parents.

Referenced by gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__AR(), gum::MCBayesNetGenerator< GUM_SCALAR, ICPTGenerator, ICPTDisturber >::__connect(), gum::learning::Miic::__existsDirectedPath(), __expandCodeIsMinimal(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClass(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateClassDag(), gum::prm::LayerGenerator< GUM_SCALAR >::__generateClasses(), gum::prm::ClusteredLayerGenerator< GUM_SCALAR >::__generateCluster(), gum::IBayesNet< GUM_SCALAR >::__minimalCondSetVisitDn(), gum::IBayesNet< GUM_SCALAR >::__minimalCondSetVisitUp(), __not_rec(), __rec(), gum::EssentialGraph::__strongly_protected(), gum::InfluenceDiagram< GUM_SCALAR >::_copyTables(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_initialize(), gum::credal::CNLoopyPropagation< GUM_SCALAR >::_makeInferenceNodeToNeighbours(), gum::InfluenceDiagram< GUM_SCALAR >::_moralGraph(), gum::learning::Miic::_orientation_miic(), gum::learning::Miic::_propagatesHead(), gum::BarrenNodesFinder::barrenNodes(), gum::ArcGraphPart::directedPath(), gum::ArcGraphPart::directedUnorientedPath(), gum::learning::BNDatabaseGenerator< GUM_SCALAR >::drawSamples(), gum::ArcGraphPart::eraseParents(), gum::InfluenceDiagram< GUM_SCALAR >::getPartialTemporalOrder(), isMinimal(), gum::learning::Miic::learnStructure(), gum::IBayesNet< GUM_SCALAR >::minimalCondSet(), gum::MixedGraph::mixedOrientedPath(), gum::MixedGraph::mixedUnorientedPath(), gum::prm::gspan::DFSTree< GUM_SCALAR >::parent(), gum::MarkovBlanket::parents(), gum::EssentialGraph::parents(), gum::DAGmodel::parents(), gum::BayesBall::relevantPotentials(), gum::dSeparation::relevantPotentials(), remove(), gum::BayesBall::requisiteNodes(), gum::dSeparation::requisiteNodes(), rightmostPath(), and gum::ArcGraphPart::unvirtualizedEraseParents().

54  {
55  __checkParents(id);
56  return *(__parents[id]);
57  }
NodeProperty< NodeSet * > __parents
for each arc, the sets of its parents
Definition: arcGraphPart.h:269
void __checkParents(const NodeId id) const
when the ArcGraphPart contains no arc ingoing into a given node, this function adds an empty set entr...

+ Here is the call graph for this function:

INLINE void gum::prm::gspan::Pattern::pop_back ( )

Remove the last EdgeCode of this pattern.

Definition at line 204 of file pattern_inl.h.

References __arc_map, __code, __node_map, gum::prm::gspan::DFSCode::codes, gum::ArcGraphPart::eraseArc(), gum::DiGraph::eraseNode(), gum::prm::gspan::EdgeCode::i, gum::prm::gspan::EdgeCode::isForward(), and gum::prm::gspan::EdgeCode::j.

Referenced by __not_rec(), and __rec().

204  {
205  EdgeCode* edge = __code.codes.back();
206  __code.codes.pop_back();
207 
208  if (edge->isForward()) {
209  __node_map.erase(edge->j);
210  __arc_map.erase(Arc(edge->i, edge->j));
211  DiGraph::eraseArc(Arc(edge->i, edge->j));
212  DiGraph::eraseNode(edge->j);
213  } else {
214  __arc_map.erase(Arc(edge->i, edge->j));
215  DiGraph::eraseArc(Arc(edge->i, edge->j));
216  }
217 
218  delete edge;
219  }
ArcProperty< std::pair< LabelData *, EdgeCode * > > __arc_map
Mapping between edges in this Pattern and their respective LabelData.
Definition: pattern.h:210
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
std::vector< EdgeCode * > codes
The vector containing the EdgeCode composing this DFSCode.
Definition: DFSCode.h:87
NodeProperty< LabelData * > __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Definition: pattern.h:206
DFSCode __code
The DFSCode of this Pattern.
Definition: pattern.h:202
virtual void eraseNode(const NodeId id)
remove a node and its adjacent arcs from the graph
Definition: diGraph_inl.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void gum::NodeGraphPart::populateNodes ( const NodeGraphPart s)
inherited

populateNodes clears *this and fills it with the same nodes as "s"

populateNodes should basically be the preferred way to insert nodes with IDs not selected by the internal idFactory.

Parameters
sthe NodeGraphPart to be copied

Definition at line 61 of file nodeGraphPart.cpp.

References gum::NodeGraphPart::__boundVal, gum::NodeGraphPart::__holes, gum::NodeGraphPart::__holes_resize_policy, gum::NodeGraphPart::__holes_size, gum::NodeGraphPart::__updateEndIteratorSafe(), and gum::NodeGraphPart::clear().

Referenced by gum::DAGmodel::__moralGraph().

61  {
62  clear(); // "virtual" flush of the nodes set
63  __holes_size = s.__holes_size;
64  __holes_resize_policy = s.__holes_resize_policy;
65 
66  if (s.__holes) __holes = new NodeSet(*s.__holes);
67 
68  __boundVal = s.__boundVal;
69 
71  }
NodeSet * __holes
the set of nodes not contained in the NodeGraphPart in the interval 1..__max
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
bool __holes_resize_policy
value for __holes configuration
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart
Size __holes_size
value for __holes configuration
void __updateEndIteratorSafe()
updating endIterator (always at __max+1)
virtual void clear()
alias for clearNodes

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename T >
void gum::NodeGraphPart::populateNodesFromProperty ( const NodeProperty< T > &  h)
inherited

populateNodesFromProperty clears *this and fills it with the keys of "h"

populateNodes should basically be the preferred way to insert nodes with IDs not selected by the internal idFactory.

INLINE void gum::prm::gspan::Pattern::remove ( NodeId  node)

Remove a node if it has no neighbors, raise an OperationNotAllowed otherwise.

Definition at line 222 of file pattern_inl.h.

References __node_map, gum::ArcGraphPart::children(), gum::NodeGraphPart::empty(), gum::DiGraph::eraseNode(), GUM_ERROR, and gum::ArcGraphPart::parents().

Referenced by __not_rec(), and __rec().

222  {
223  if (DiGraph::parents(node).empty() && DiGraph::children(node).empty()) {
224  DiGraph::eraseNode(node);
225  __node_map.erase(node);
226  } else {
227  GUM_ERROR(OperationNotAllowed, "the given node has neighbors");
228  }
229  }
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
bool empty() const
alias for emptyNodes
NodeProperty< LabelData * > __node_map
Mapping between nodes in this Pattern and their respective LabelData.
Definition: pattern.h:206
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
virtual void eraseNode(const NodeId id)
remove a node and its adjacent arcs from the graph
Definition: diGraph_inl.h:66
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::prm::gspan::Pattern::rightmostPath ( std::list< NodeId > &  r_path) const

Fill r_path with the rightmost path of this Pattern. The list is supposed empty.

Definition at line 150 of file pattern_inl.h.

References gum::ArcGraphPart::parents(), and size().

Referenced by __not_rec(), __rec(), and gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining().

150  {
151  r_path.push_back(NodeId(size()));
152 
153  while (r_path.front() != 1) {
154  for (const auto par : parents(r_path.front())) {
155  if (par < r_path.front()) {
156  r_path.push_front(par);
157  break;
158  }
159  }
160  }
161  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
Size size() const
Returns the number of nodes in this Pattern.
Definition: pattern_inl.h:144

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE Size gum::prm::gspan::Pattern::size ( ) const

Returns the number of nodes in this Pattern.

Definition at line 144 of file pattern_inl.h.

References gum::NodeGraphPart::size().

Referenced by addNodeWithLabel(), Pattern(), and rightmostPath().

144 { return DiGraph::size(); }
Size size() const
alias for sizeNodes

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE Size gum::prm::gspan::Pattern::sizeArcs ( ) const

Returns the number of arcs in this Pattern.

Definition at line 147 of file pattern_inl.h.

References gum::ArcGraphPart::sizeArcs().

147 { return DiGraph::sizeArcs(); }
Size sizeArcs() const
indicates the number of arcs stored within the ArcGraphPart

+ Here is the call graph for this function:

INLINE Size gum::NodeGraphPart::sizeNodes ( ) const
inherited

returns the number of nodes in the NodeGraphPart

Definition at line 274 of file nodeGraphPart_inl.h.

Referenced by gum::BinaryJoinTreeConverterDefault::__markConnectedComponent(), gum::BarrenNodesFinder::barrenNodes(), gum::BinaryJoinTreeConverterDefault::convert(), gum::EliminationSequenceStrategy::setGraph(), gum::MarkovBlanket::sizeNodes(), and gum::EssentialGraph::sizeNodes().

274  {
275  return (__holes) ? (__boundVal - __holes->size()) : __boundVal;
276  }
NodeSet * __holes
the set of nodes not contained in the NodeGraphPart in the interval 1..__max
NodeId __boundVal
the id below which NodeIds may belong to the NodeGraphPart
Size size() const noexcept
Returns the number of elements in the set.
Definition: set_tpl.h:701

+ Here is the caller graph for this function:

std::string gum::prm::gspan::Pattern::toDot ( size_t  name) const

Print the pattern in the DOT syntax.

Definition at line 83 of file pattern.cpp.

References arcs(), and label().

83  {
84  std::stringstream sBuff;
85  sBuff << "digraph " << name << " {\n";
86 
87  for (const auto arc : arcs()) {
88  sBuff << label(arc.tail()).id << " -> ";
89  sBuff << label(arc.head()).id << ";\n";
90  }
91 
92  sBuff << "}\n";
93  return sBuff.str();
94  }
LabelData & label(NodeId node)
Returns the LabelData assigned to node.
Definition: pattern_inl.h:47
const ArcSet & arcs() const
Definition: pattern_inl.h:167

+ Here is the call graph for this function:

const std::string gum::DiGraph::toDot ( ) const
virtualinherited

to friendly display the content of the graph in the DOT syntax

Parameters
nameThe graph name in the dot syntax. Default is G.
Returns
Returns a string describing the graph in the dot syntax

Reimplemented in gum::MixedGraph.

Definition at line 65 of file diGraph.cpp.

References gum::ArcGraphPart::arcs(), and gum::NodeGraphPart::nodes().

65  {
66  std::stringstream strBuff;
67  std::string tab = " ";
68  strBuff << "digraph {" << std::endl;
69 
70  for (const auto node : nodes())
71  strBuff << tab << node << ";" << std::endl;
72 
73  strBuff << std::endl;
74 
75  for (const auto& arc : arcs())
76  strBuff << tab << arc.tail() << " -> " << arc.head() << ";" << std::endl;
77 
78  strBuff << "}" << std::endl << std::endl;
79  return strBuff.str();
80  }
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart

+ Here is the call graph for this function:

const Sequence< NodeId > & gum::DiGraph::topologicalOrder ( bool  clear = true) const
inherited

The topological order stays the same as long as no variable or arcs are added or erased src the topology.

Parameters
clearIf false returns the previously created topology.
Exceptions
InvalidDirectedCycleRaised if this DiGraph contains cycles.

Definition at line 88 of file diGraph.cpp.

References gum::DiGraph::__mutableTopologicalOrder, gum::DiGraph::__topologicalOrder(), and gum::SequenceImplementation< Key, Alloc, Gen >::clear().

Referenced by gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::__setO3ClassCreationOrder(), gum::prm::o3prm::O3InterfaceFactory< GUM_SCALAR >::__setO3InterfaceCreationOrder(), gum::prm::o3prm::O3TypeFactory< GUM_SCALAR >::__setO3TypeCreationOrder(), gum::learning::Miic::learnStructure(), and gum::DAGmodel::topologicalOrder().

88  {
89  if (clear
91  == nullptr)) { // we have to call _topologicalOrder
92  if (__mutableTopologicalOrder == nullptr) {
94  } else {
95  // clear is True
97  }
98 
100  }
101 
103  }
void __topologicalOrder() const
Returns a topological order of this DAGModel.
Definition: diGraph.cpp:105
void clear()
Clear the sequence.
Definition: sequence_tpl.h:268
Sequence< NodeId > * __mutableTopologicalOrder
The topology sequence of this Directed Graphical Model.
Definition: diGraph.h:198

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const std::string gum::DiGraph::toString ( ) const
virtualinherited

to friendly display the content of the graph

Reimplemented in gum::MixedGraph.

Definition at line 58 of file diGraph.cpp.

References gum::ArcGraphPart::toString(), and gum::NodeGraphPart::toString().

Referenced by gum::operator<<().

58  {
59  std::string s = NodeGraphPart::toString();
60  s += " , ";
62  return s;
63  }
std::string toString() const
a function to display the set of nodes
const std::string toString() const
to friendly display the content of the ArcGraphPart

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::ArcGraphPart::unvirtualizedEraseChildren ( const NodeId  id)
inherited

same function as eraseChildren but without any virtual call to an erase

Parameters
idthe node whose outgoing arcs will be removed

Definition at line 138 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__children, gum::Set< Key, Alloc >::beginSafe(), gum::ArcGraphPart::children(), gum::Set< Key, Alloc >::endSafe(), and gum::ArcGraphPart::eraseArc().

Referenced by gum::DiGraph::eraseNode(), and gum::MixedGraph::eraseNode().

138  {
139  if (__children.exists(id)) {
140  NodeSet& children = *(__children[id]);
141 
142  for (auto iter = children.beginSafe(); // safe iterator needed here
143  iter != children.endSafe();
144  ++iter) {
145  ArcGraphPart::eraseArc(Arc(id, *iter));
146  }
147  }
148  }
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
const NodeSet & children(const NodeId id) const
returns the set of nodes with arc outgoing from a given node
NodeProperty< NodeSet * > __children
for each arc, the set of its children
Definition: arcGraphPart.h:272

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

INLINE void gum::ArcGraphPart::unvirtualizedEraseParents ( const NodeId  id)
inherited

same function as eraseParents but without any virtual call to an erase

Parameters
idthe node whose ingoing arcs will be removed

Definition at line 126 of file arcGraphPart_inl.h.

References gum::ArcGraphPart::__parents, gum::Set< Key, Alloc >::beginSafe(), gum::Set< Key, Alloc >::endSafe(), gum::ArcGraphPart::eraseArc(), and gum::ArcGraphPart::parents().

Referenced by gum::DiGraph::eraseNode(), and gum::MixedGraph::eraseNode().

126  {
127  if (__parents.exists(id)) {
128  NodeSet& parents = *(__parents[id]);
129 
130  for (auto iter = parents.beginSafe(); // safe iterator needed here
131  iter != parents.endSafe();
132  ++iter) {
133  ArcGraphPart::eraseArc(Arc(*iter, id));
134  }
135  }
136  }
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
virtual void eraseArc(const Arc &arc)
removes an arc from the ArcGraphPart
const NodeSet & parents(const NodeId id) const
returns the set of nodes with arc ingoing to a given node
NodeProperty< NodeSet * > __parents
for each arc, the sets of its parents
Definition: arcGraphPart.h:269

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

ArcProperty< std::pair< LabelData*, EdgeCode* > > gum::prm::gspan::Pattern::__arc_map
private

Mapping between edges in this Pattern and their respective LabelData.

Definition at line 210 of file pattern.h.

Referenced by addArc(), edgeCode(), label(), and pop_back().

DFSCode gum::prm::gspan::Pattern::__code
private

The DFSCode of this Pattern.

Definition at line 202 of file pattern.h.

Referenced by code(), and pop_back().

LabelData* gum::prm::gspan::Pattern::__last
private

The last LabelData added to this pattern.

Definition at line 213 of file pattern.h.

Referenced by addNodeWithLabel(), and lastAdded().

NodeProperty< LabelData* > gum::prm::gspan::Pattern::__node_map
private

Mapping between nodes in this Pattern and their respective LabelData.

Definition at line 206 of file pattern.h.

Referenced by addArc(), addNodeWithLabel(), label(), pop_back(), and remove().

Signaler2< NodeId, NodeId > gum::ArcGraphPart::onArcAdded
inherited
Signaler2< NodeId, NodeId > gum::ArcGraphPart::onArcDeleted
inherited

Definition at line 81 of file arcGraphPart.h.

Referenced by gum::ArcGraphPart::clearArcs(), and gum::ArcGraphPart::eraseArc().

Signaler1< NodeId > gum::NodeGraphPart::onNodeAdded
inherited

Definition at line 271 of file nodeGraphPart.h.

Referenced by gum::NodeGraphPart::addNodeWithId().

Signaler1< NodeId > gum::NodeGraphPart::onNodeDeleted
inherited

Definition at line 272 of file nodeGraphPart.h.

Referenced by gum::NodeGraphPart::__clearNodes().


The documentation for this class was generated from the following files: