aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
gum::prm::gspan::InterfaceGraph< GUM_SCALAR > Class Template Reference

This class represent the interface graph of a given gum::prm::PRMSystem<GUM_SCALAR>. More...

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

+ Collaboration diagram for gum::prm::gspan::InterfaceGraph< GUM_SCALAR >:

Public Member Functions

 InterfaceGraph (const PRMSystem< GUM_SCALAR > &sys)
 Default constructor. More...
 
 InterfaceGraph (const InterfaceGraph &source)
 Copy constructor, proceeds with a shallow copy so for friends only. More...
 
InterfaceGraphoperator= (const InterfaceGraph &source)
 Copy operator. More...
 
 ~InterfaceGraph ()
 Destructor. More...
 
UndiGraphgraph ()
 Returns the graph of this interface graph. More...
 
const UndiGraphgraph () const
 Returns the graph of this interface graph. More...
 
Bijection< Idx, LabelData *> & labels ()
 Returns the bijection between LabelData and their string representation. More...
 
const Bijection< Idx, LabelData *> & labels () const
 Returns the bijection between LabelData and their string representation. More...
 
Size size (const LabelData *l) const
 Returns the number of node or edges labelled by l. More...
 
Set< NodeData< GUM_SCALAR > *> & nodes (const LabelData *l)
 Returns the set of nodes labelled by l. More...
 
const Set< NodeData< GUM_SCALAR > *> & nodes (const LabelData *l) const
 Returns the set of nodes labelled by l. More...
 
Set< EdgeData< GUM_SCALAR > *> & edges (const LabelData *l)
 Returns the set of nodes labelled by l. More...
 
const Set< EdgeData< GUM_SCALAR > *> & edges (const LabelData *l) const
 Returns the set of nodes labelled by l. More...
 
LabelDatalabel (Idx id)
 Returns a label given its id. More...
 
NodeId id (const PRMInstance< GUM_SCALAR > &i) const
 Returns the id of i in this interface graph. More...
 
NodeId id (const PRMInstance< GUM_SCALAR > *i) const
 Returns the id of i in this interface graph. More...
 
NodeData< GUM_SCALAR > & node (const PRMInstance< GUM_SCALAR > *i)
 Returns data about a node. More...
 
const NodeData< GUM_SCALAR > & node (const PRMInstance< GUM_SCALAR > *i) const
 Returns data about a node. More...
 
NodeData< GUM_SCALAR > & node (NodeId id)
 Returns data about a node. More...
 
const NodeData< GUM_SCALAR > & node (NodeId id) const
 Returns data about a node. More...
 
EdgeData< GUM_SCALAR > & edge (NodeId u, NodeId v)
 Returns data about an edge. More...
 
const EdgeData< GUM_SCALAR > & edge (NodeId u, NodeId v) const
 Returns data about an edge. More...
 

Friends

class gum::prm::GSpan< GUM_SCALAR >
 

Detailed Description

template<typename GUM_SCALAR>
class gum::prm::gspan::InterfaceGraph< GUM_SCALAR >

This class represent the interface graph of a given gum::prm::PRMSystem<GUM_SCALAR>.

An interface graph is a labelled graph over the instances of a gum::prm::PRMSystem<GUM_SCALAR>, where there exists an edge between two instance i and j if and only if their shared interface is nonempty.

Labels assigned to edges and nodes in the interface graph are technically strings, however since we need a linear oder each label is assigned a unique id.

Definition at line 166 of file interfaceGraph.h.

Constructor & Destructor Documentation

◆ InterfaceGraph() [1/2]

template<typename GUM_SCALAR >
gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph ( const PRMSystem< GUM_SCALAR > &  sys)
explicit

Default constructor.

Definition at line 98 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

99  :
100  sys__(&sys),
101  labels__(new Bijection< Idx, LabelData* >()), counter__(0),
102  erase_flag__(true) {
103  GUM_CONSTRUCTOR(InterfaceGraph);
104  HashTable< std::string, LabelData* > label_map;
105 
106  // We need to add each instance in graph__
107  for (auto iter = sys.begin(); iter != sys.end(); ++iter) {
108  NodeData< GUM_SCALAR >* node = new NodeData< GUM_SCALAR >();
109  node->n = iter.val();
110  label__(node, label_map);
111  graph__.addNodeWithId(iter.key());
112  idMap__.insert(node->n, iter.key());
113  nodes__.insert(iter.key(), node);
114  }
115 
116  NodeData< GUM_SCALAR >* u = nullptr;
117  NodeData< GUM_SCALAR >* v = nullptr;
118 
119  for (const auto& elt: nodes__) {
120  NodeData< GUM_SCALAR >* data = elt.second;
121 
122  for (const auto chain: data->n->type().slotChains()) {
123  for (const auto inst: data->n->getInstances(chain->id())) {
124  u = (nodes__[idMap__[inst]]->l < data->l) ? nodes__[idMap__[inst]]
125  : data;
126  v = (u != data) ? data : nodes__[idMap__[inst]];
127 
128  if (!graph__.existsEdge(idMap__[u->n], idMap__[v->n])) {
129  EdgeData< GUM_SCALAR >* edge = new EdgeData< GUM_SCALAR >();
130  edge->u = u->n;
131  edge->l_u = u->l;
132  edge->v = v->n;
133  edge->l_v = v->l;
134  label__(edge, label_map);
135  graph__.addEdge(idMap__[u->n], idMap__[v->n]);
136  edges__.insert(Edge(idMap__[u->n], idMap__[v->n]), edge);
137  }
138  }
139  }
140  }
141  }
const PRMSystem< GUM_SCALAR > * sys__
The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph.
virtual void addNodeWithId(const NodeId id)
try to insert a node with the given id
NodeProperty< NodeData< GUM_SCALAR > *> nodes__
Data associated with a node in graph__.
UndiGraph graph__
The interface graph.
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
NodeData< GUM_SCALAR > & node(const PRMInstance< GUM_SCALAR > *i)
Returns data about a node.
void label__(NodeData< GUM_SCALAR > *node, HashTable< std::string, LabelData * > &label_map)
Compute the label of node and add it to labels__ if it does not exists yet. Update node with the corr...
bool existsEdge(const Edge &edge) const
indicates whether a given edge exists
InterfaceGraph(const PRMSystem< GUM_SCALAR > &sys)
Default constructor.
HashTable< PRMInstance< GUM_SCALAR > *, NodeId > idMap__
Mapping between PRMInstance<GUM_SCALAR> dans their id in graph__.
EdgeProperty< EdgeData< GUM_SCALAR > *> edges__
Data associated with edges in graph__.
EdgeData< GUM_SCALAR > & edge(NodeId u, NodeId v)
Returns data about an edge.
void addEdge(NodeId first, NodeId second) override
insert a new edge into the undirected graph
Definition: undiGraph_inl.h:34
Idx counter__
A counter used of assigning ids to labels.
bool erase_flag__
For shallow copies.
+ Here is the call graph for this function:

◆ InterfaceGraph() [2/2]

template<typename GUM_SCALAR >
gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph ( const InterfaceGraph< GUM_SCALAR > &  source)

Copy constructor, proceeds with a shallow copy so for friends only.

Definition at line 144 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

145  :
146  sys__(source.sys__),
147  graph__(source.graph__), nodes__(source.nodes__),
148  idMap__(source.idMap__), edges__(source.edges__),
149  labels__(new Bijection< Idx, LabelData* >(*(source.labels__))),
150  nodeMap__(source.nodeMap__), edgeMap__(source.edgeMap__),
151  counter__(source.counter__), erase_flag__(false) {
152  GUM_CONS_CPY(InterfaceGraph);
153  }
const PRMSystem< GUM_SCALAR > * sys__
The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph.
NodeProperty< NodeData< GUM_SCALAR > *> nodes__
Data associated with a node in graph__.
UndiGraph graph__
The interface graph.
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > *> *> nodeMap__
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > *> *> edgeMap__
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
InterfaceGraph(const PRMSystem< GUM_SCALAR > &sys)
Default constructor.
HashTable< PRMInstance< GUM_SCALAR > *, NodeId > idMap__
Mapping between PRMInstance<GUM_SCALAR> dans their id in graph__.
EdgeProperty< EdgeData< GUM_SCALAR > *> edges__
Data associated with edges in graph__.
Idx counter__
A counter used of assigning ids to labels.
bool erase_flag__
For shallow copies.
+ Here is the call graph for this function:

◆ ~InterfaceGraph()

template<typename GUM_SCALAR >
gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph ( )

Destructor.

Definition at line 156 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

156  {
157  GUM_DESTRUCTOR(InterfaceGraph);
158 
159  if (erase_flag__) {
160  for (const auto& elt: nodes__)
161  delete elt.second;
162 
163  for (const auto& elt: edges__)
164  delete elt.second;
165 
166  for (const auto& elt: nodeMap__) {
167  delete elt.first;
168  delete elt.second;
169  }
170 
171  for (const auto& elt: edgeMap__) {
172  delete elt.first;
173  delete elt.second;
174  }
175  }
176 
177  delete labels__;
178  }
NodeProperty< NodeData< GUM_SCALAR > *> nodes__
Data associated with a node in graph__.
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > *> *> nodeMap__
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > *> *> edgeMap__
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
InterfaceGraph(const PRMSystem< GUM_SCALAR > &sys)
Default constructor.
EdgeProperty< EdgeData< GUM_SCALAR > *> edges__
Data associated with edges in graph__.
bool erase_flag__
For shallow copies.
+ Here is the call graph for this function:

Member Function Documentation

◆ edge() [1/2]

template<typename GUM_SCALAR >
INLINE EdgeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge ( NodeId  u,
NodeId  v 
)

Returns data about an edge.

Exceptions
NotFound

Definition at line 370 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

371  {
372  try {
373  return *(edges__[Edge(u, v)]);
374  } catch (NotFound&) { return *(edges__[Edge(v, u)]); }
375  }
EdgeProperty< EdgeData< GUM_SCALAR > *> edges__
Data associated with edges in graph__.
+ Here is the call graph for this function:

◆ edge() [2/2]

template<typename GUM_SCALAR >
INLINE const EdgeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge ( NodeId  u,
NodeId  v 
) const

Returns data about an edge.

Exceptions
NotFound

Definition at line 379 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

379  {
380  try {
381  return *(edges__[Edge(u, v)]);
382  } catch (NotFound&) { return *(edges__[Edge(v, u)]); }
383  }
EdgeProperty< EdgeData< GUM_SCALAR > *> edges__
Data associated with edges in graph__.
+ Here is the call graph for this function:

◆ edges() [1/2]

template<typename GUM_SCALAR >
INLINE Set< EdgeData< GUM_SCALAR > *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edges ( const LabelData l)

Returns the set of nodes labelled by l.

Definition at line 318 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

318  {
319  return *(edgeMap__[const_cast< LabelData* >(l)]);
320  }
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > *> *> edgeMap__
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
+ Here is the call graph for this function:

◆ edges() [2/2]

template<typename GUM_SCALAR >
INLINE const Set< EdgeData< GUM_SCALAR > *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edges ( const LabelData l) const

Returns the set of nodes labelled by l.

Definition at line 324 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

324  {
325  return *(edgeMap__[const_cast< LabelData* >(l)]);
326  }
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > *> *> edgeMap__
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
+ Here is the call graph for this function:

◆ graph() [1/2]

template<typename GUM_SCALAR >
INLINE UndiGraph & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph ( )

Returns the graph of this interface graph.

Definition at line 275 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

275  {
276  return graph__;
277  }
UndiGraph graph__
The interface graph.
+ Here is the call graph for this function:

◆ graph() [2/2]

template<typename GUM_SCALAR >
INLINE const UndiGraph & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph ( ) const

Returns the graph of this interface graph.

Definition at line 280 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

280  {
281  return graph__;
282  }
UndiGraph graph__
The interface graph.
+ Here is the call graph for this function:

◆ id() [1/2]

template<typename GUM_SCALAR >
INLINE NodeId gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::id ( const PRMInstance< GUM_SCALAR > &  i) const

Returns the id of i in this interface graph.

Definition at line 334 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

335  {
336  return idMap__[const_cast< PRMInstance< GUM_SCALAR >* >(&i)];
337  }
HashTable< PRMInstance< GUM_SCALAR > *, NodeId > idMap__
Mapping between PRMInstance<GUM_SCALAR> dans their id in graph__.
+ Here is the call graph for this function:

◆ id() [2/2]

template<typename GUM_SCALAR >
INLINE NodeId gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::id ( const PRMInstance< GUM_SCALAR > *  i) const

Returns the id of i in this interface graph.

Definition at line 340 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

341  {
342  return idMap__[const_cast< PRMInstance< GUM_SCALAR >* >(i)];
343  }
HashTable< PRMInstance< GUM_SCALAR > *, NodeId > idMap__
Mapping between PRMInstance<GUM_SCALAR> dans their id in graph__.
+ Here is the call graph for this function:

◆ label()

template<typename GUM_SCALAR >
INLINE LabelData * gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label ( Idx  id)

Returns a label given its id.

Definition at line 329 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

329  {
330  return labels__->second(id);
331  }
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
+ Here is the call graph for this function:

◆ label__() [1/2]

template<typename GUM_SCALAR >
void gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label__ ( NodeData< GUM_SCALAR > *  node,
HashTable< std::string, LabelData * > &  label_map 
)
private

Compute the label of node and add it to labels__ if it does not exists yet. Update node with the correct label's id.

Definition at line 187 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

189  {
190  Size size = Size(1);
191  std::stringstream sBuff;
192  sBuff << node->n->type().name();
193 
194  // First we search for multiple inputs
195  for (const auto chain: node->n->type().slotChains()) {
196  if (chain->isMultiple()) {
197  sBuff << "-" << node->n->getInstances(chain->id()).size();
198  sBuff << chain->name();
199  size *= node->n->getInstances(chain->id()).size()
200  * chain->lastElt().type().variable().domainSize();
201  } else {
202  size *= chain->lastElt().type().variable().domainSize();
203  }
204  }
205 
206  // Second we search for active outputs
207  for (const auto nn: node->n->type().containerDag().nodes()) {
208  if (node->n->type().isOutputNode(node->n->type().get(nn))) {
209  try {
210  sBuff << "-" << node->n->getRefAttr(nn).size()
211  << node->n->get(nn).name();
212  size *= node->n->get(nn).type().variable().domainSize();
213  } catch (NotFound&) {
214  // (nn) is an inactive output node
215  }
216  }
217  }
218 
219  // Label is ready
220  if (!label_map.exists(sBuff.str())) {
221  LabelData* label = new LabelData();
222  label_map.insert(sBuff.str(), label);
223  label->id = ++counter__;
224  label->tree_width = size;
225  label->l = sBuff.str();
226  labels__->insert(label->id, label);
227  nodeMap__.insert(label, new Set< NodeData< GUM_SCALAR >* >());
228  }
229 
230  node->l = label_map[sBuff.str()];
231  nodeMap__[node->l]->insert(node);
232  }
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
NodeData< GUM_SCALAR > & node(const PRMInstance< GUM_SCALAR > *i)
Returns data about a node.
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > *> *> nodeMap__
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
LabelData * label(Idx id)
Returns a label given its id.
Size size(const LabelData *l) const
Returns the number of node or edges labelled by l.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
Idx counter__
A counter used of assigning ids to labels.
+ Here is the call graph for this function:

◆ label__() [2/2]

template<typename GUM_SCALAR >
void gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label__ ( EdgeData< GUM_SCALAR > *  edge,
HashTable< std::string, LabelData * > &  label_map 
)
private

Compute the label of edge and add it to labels__ if it does not exists yet. Update edge with the correct label's id.

Definition at line 235 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

237  {
238  Size size = Size(1);
239  std::stringstream sBuff;
240  sBuff << edge->u->type().name() << "-" << edge->v->type().name();
241 
242  // First looking for edge->u output nodes in v
243  for (const auto chain: edge->u->type().slotChains()) {
244  if (edge->u->getInstances(chain->id()).exists(edge->v)) {
245  sBuff << "-" << edge->v->type().name() << "."
246  << chain->lastElt().name();
247  size *= chain->lastElt().type().variable().domainSize();
248  }
249  }
250 
251  // Second looking for edge->v output nodes in u
252  for (const auto chain: edge->v->type().slotChains())
253  if (edge->v->getInstances(chain->id()).exists(edge->u)) {
254  sBuff << "-" << edge->u->type().name() << "."
255  << chain->lastElt().name();
256  size *= chain->lastElt().type().variable().domainSize();
257  }
258 
259  // Label is ready
260  if (!label_map.exists(sBuff.str())) {
261  LabelData* label = new LabelData();
262  label_map.insert(sBuff.str(), label);
263  label->id = ++counter__;
264  label->l = sBuff.str();
265  label->tree_width = size;
266  labels__->insert(label->id, label);
267  edgeMap__.insert(label, new Set< EdgeData< GUM_SCALAR >* >());
268  }
269 
270  edge->l = label_map[sBuff.str()];
271  edgeMap__[edge->l]->insert(edge);
272  }
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > *> *> edgeMap__
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
LabelData * label(Idx id)
Returns a label given its id.
Size size(const LabelData *l) const
Returns the number of node or edges labelled by l.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:47
EdgeData< GUM_SCALAR > & edge(NodeId u, NodeId v)
Returns data about an edge.
Idx counter__
A counter used of assigning ids to labels.
+ Here is the call graph for this function:

◆ labels() [1/2]

template<typename GUM_SCALAR >
INLINE Bijection< Idx, LabelData *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::labels ( )

Returns the bijection between LabelData and their string representation.

Definition at line 285 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

285  {
286  return *labels__;
287  }
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
+ Here is the call graph for this function:

◆ labels() [2/2]

template<typename GUM_SCALAR >
INLINE const Bijection< Idx, LabelData *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::labels ( ) const

Returns the bijection between LabelData and their string representation.

Definition at line 291 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

291  {
292  return *labels__;
293  }
Bijection< Idx, LabelData *> * labels__
Bijection between labels and their ids.
+ Here is the call graph for this function:

◆ node() [1/4]

template<typename GUM_SCALAR >
INLINE NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node ( const PRMInstance< GUM_SCALAR > *  i)

Returns data about a node.

Exceptions
NotFound

Definition at line 347 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

347  {
348  return node(id(i));
349  }
NodeData< GUM_SCALAR > & node(const PRMInstance< GUM_SCALAR > *i)
Returns data about a node.
+ Here is the call graph for this function:

◆ node() [2/4]

template<typename GUM_SCALAR >
INLINE const NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node ( const PRMInstance< GUM_SCALAR > *  i) const

Returns data about a node.

Exceptions
NotFound

Definition at line 352 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

353  {
354  return node(id(i));
355  }
NodeData< GUM_SCALAR > & node(const PRMInstance< GUM_SCALAR > *i)
Returns data about a node.
+ Here is the call graph for this function:

◆ node() [3/4]

template<typename GUM_SCALAR >
INLINE NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node ( NodeId  id)

Returns data about a node.

Exceptions
NotFound

Definition at line 359 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

359  {
360  return *(nodes__[id]);
361  }
NodeProperty< NodeData< GUM_SCALAR > *> nodes__
Data associated with a node in graph__.
NodeId id(const PRMInstance< GUM_SCALAR > &i) const
Returns the id of i in this interface graph.
+ Here is the call graph for this function:

◆ node() [4/4]

template<typename GUM_SCALAR >
INLINE const NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node ( NodeId  id) const

Returns data about a node.

Exceptions
NotFound

Definition at line 365 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

365  {
366  return *(nodes__[id]);
367  }
NodeProperty< NodeData< GUM_SCALAR > *> nodes__
Data associated with a node in graph__.
NodeId id(const PRMInstance< GUM_SCALAR > &i) const
Returns the id of i in this interface graph.
+ Here is the call graph for this function:

◆ nodes() [1/2]

template<typename GUM_SCALAR >
INLINE Set< NodeData< GUM_SCALAR > *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodes ( const LabelData l)

Returns the set of nodes labelled by l.

Definition at line 306 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

306  {
307  return *(nodeMap__[const_cast< LabelData* >(l)]);
308  }
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > *> *> nodeMap__
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
+ Here is the call graph for this function:

◆ nodes() [2/2]

template<typename GUM_SCALAR >
INLINE const Set< NodeData< GUM_SCALAR > *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodes ( const LabelData l) const

Returns the set of nodes labelled by l.

Definition at line 312 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

312  {
313  return *(nodeMap__[const_cast< LabelData* >(l)]);
314  }
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > *> *> nodeMap__
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
+ Here is the call graph for this function:

◆ operator=()

template<typename GUM_SCALAR >
InterfaceGraph< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::operator= ( const InterfaceGraph< GUM_SCALAR > &  source)

Copy operator.

Definition at line 181 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

182  {
183  GUM_ERROR(FatalError, "not implemented");
184  }
#define GUM_ERROR(type, msg)
Definition: exceptions.h:54
+ Here is the call graph for this function:

◆ size()

template<typename GUM_SCALAR >
INLINE Size gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::size ( const LabelData l) const

Returns the number of node or edges labelled by l.

Definition at line 296 of file interfaceGraph_tpl.h.

References gum::prm::gspan::operator<<().

296  {
297  try {
298  return nodeMap__[const_cast< LabelData* >(l)]->size();
299  } catch (NotFound&) {
300  return edgeMap__[const_cast< LabelData* >(l)]->size();
301  }
302  }
HashTable< LabelData *, Set< NodeData< GUM_SCALAR > *> *> nodeMap__
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
HashTable< LabelData *, Set< EdgeData< GUM_SCALAR > *> *> edgeMap__
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
Size size(const LabelData *l) const
Returns the number of node or edges labelled by l.
+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ gum::prm::GSpan< GUM_SCALAR >

template<typename GUM_SCALAR >
friend class gum::prm::GSpan< GUM_SCALAR >
friend

Definition at line 167 of file interfaceGraph.h.

Member Data Documentation

◆ counter__

template<typename GUM_SCALAR >
Idx gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::counter__
private

A counter used of assigning ids to labels.

Definition at line 276 of file interfaceGraph.h.

◆ edgeMap__

template<typename GUM_SCALAR >
HashTable< LabelData*, Set< EdgeData< GUM_SCALAR >* >* > gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edgeMap__
private

Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.

Definition at line 273 of file interfaceGraph.h.

◆ edges__

template<typename GUM_SCALAR >
EdgeProperty< EdgeData< GUM_SCALAR >* > gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edges__
private

Data associated with edges in graph__.

Definition at line 260 of file interfaceGraph.h.

◆ erase_flag__

template<typename GUM_SCALAR >
bool gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::erase_flag__
private

For shallow copies.

Definition at line 279 of file interfaceGraph.h.

◆ graph__

template<typename GUM_SCALAR >
UndiGraph gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph__
private

The interface graph.

Definition at line 251 of file interfaceGraph.h.

◆ idMap__

template<typename GUM_SCALAR >
HashTable< PRMInstance< GUM_SCALAR >*, NodeId > gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::idMap__
private

Mapping between PRMInstance<GUM_SCALAR> dans their id in graph__.

Definition at line 257 of file interfaceGraph.h.

◆ labels__

template<typename GUM_SCALAR >
Bijection< Idx, LabelData* >* gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::labels__
private

Bijection between labels and their ids.

Definition at line 263 of file interfaceGraph.h.

◆ nodeMap__

template<typename GUM_SCALAR >
HashTable< LabelData*, Set< NodeData< GUM_SCALAR >* >* > gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodeMap__
private

Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.

Definition at line 268 of file interfaceGraph.h.

◆ nodes__

template<typename GUM_SCALAR >
NodeProperty< NodeData< GUM_SCALAR >* > gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodes__
private

Data associated with a node in graph__.

Definition at line 254 of file interfaceGraph.h.

◆ sys__

template<typename GUM_SCALAR >
const PRMSystem< GUM_SCALAR >* gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::sys__
private

The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph.

Definition at line 248 of file interfaceGraph.h.


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