![]() |
aGrUM
0.16.0
|
This class represent the interface graph of a given gum::prm::PRMSystem<GUM_SCALAR>. More...
#include <agrum/PRM/gspan/interfaceGraph.h>
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... | |
InterfaceGraph & | operator= (const InterfaceGraph &source) |
Copy operator. More... | |
~InterfaceGraph () | |
Destructor. More... | |
UndiGraph & | graph () |
Returns the graph of this interface graph. More... | |
const UndiGraph & | graph () 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... | |
LabelData * | label (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 > |
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 167 of file interfaceGraph.h.
|
explicit |
Default constructor.
Definition at line 99 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edges, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__graph, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__idMap, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodes, gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNodeWithId(), gum::prm::PRMSystem< GUM_SCALAR >::begin(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge(), gum::prm::PRMSystem< GUM_SCALAR >::end(), gum::EdgeGraphPart::existsEdge(), gum::prm::gspan::NodeData< GUM_SCALAR >::l, gum::prm::gspan::EdgeData< GUM_SCALAR >::l_u, gum::prm::gspan::EdgeData< GUM_SCALAR >::l_v, gum::prm::gspan::NodeData< GUM_SCALAR >::n, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node(), gum::prm::gspan::EdgeData< GUM_SCALAR >::u, and gum::prm::gspan::EdgeData< GUM_SCALAR >::v.
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 145 of file interfaceGraph_tpl.h.
gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph | ( | ) |
Destructor.
Definition at line 157 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edgeMap, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edges, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__erase_flag, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__labels, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodeMap, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodes, and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::operator=().
|
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 188 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__counter, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__labels, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodeMap, gum::HashTable< Key, Val, Alloc >::exists(), gum::prm::gspan::LabelData::id, gum::HashTable< Key, Val, Alloc >::insert(), gum::prm::gspan::LabelData::l, gum::prm::gspan::NodeData< GUM_SCALAR >::l, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label(), gum::prm::gspan::NodeData< GUM_SCALAR >::n, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::size(), and gum::prm::gspan::LabelData::tree_width.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph().
|
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 236 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__counter, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edgeMap, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__labels, gum::HashTable< Key, Val, Alloc >::exists(), gum::prm::gspan::LabelData::id, gum::HashTable< Key, Val, Alloc >::insert(), gum::prm::gspan::LabelData::l, gum::prm::gspan::EdgeData< GUM_SCALAR >::l, gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::size(), gum::prm::gspan::LabelData::tree_width, gum::prm::gspan::EdgeData< GUM_SCALAR >::u, and gum::prm::gspan::EdgeData< GUM_SCALAR >::v.
INLINE EdgeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge | ( | NodeId | u, |
NodeId | v | ||
) |
Returns data about an edge.
NotFound |
Definition at line 371 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edges.
Referenced by gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph().
INLINE const EdgeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge | ( | NodeId | u, |
NodeId | v | ||
) | const |
Returns data about an edge.
NotFound |
Definition at line 380 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edges.
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 319 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edgeMap.
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 325 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edgeMap.
INLINE UndiGraph & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph | ( | ) |
Returns the graph of this interface graph.
Definition at line 276 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__graph.
Referenced by gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining(), and gum::prm::GSpan< GUM_SCALAR >::discoverPatterns().
INLINE const UndiGraph & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph | ( | ) | const |
Returns the graph of this interface graph.
Definition at line 281 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__graph.
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 335 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__idMap.
Referenced by gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining(), gum::prm::GSpan< GUM_SCALAR >::discoverPatterns(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node().
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 341 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__idMap.
INLINE LabelData * gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label | ( | Idx | id | ) |
Returns a label given its id.
Definition at line 330 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__labels.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label().
INLINE Bijection< Idx, LabelData *> & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::labels | ( | ) |
Returns the bijection between LabelData and their string representation.
Definition at line 286 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__labels.
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 292 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__labels.
INLINE NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | const PRMInstance< GUM_SCALAR > * | i | ) |
Returns data about a node.
NotFound |
Definition at line 348 of file interfaceGraph_tpl.h.
Referenced by gum::prm::GSpan< GUM_SCALAR >::__subgraph_mining(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node().
INLINE const NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | const PRMInstance< GUM_SCALAR > * | i | ) | const |
Returns data about a node.
NotFound |
Definition at line 353 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node().
INLINE NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | NodeId | id | ) |
Returns data about a node.
NotFound |
Definition at line 360 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodes, and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::id().
INLINE const NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | NodeId | id | ) | const |
Returns data about a node.
NotFound |
Definition at line 366 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodes, and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::id().
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 307 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodeMap.
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 313 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodeMap.
InterfaceGraph< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::operator= | ( | const InterfaceGraph< GUM_SCALAR > & | source | ) |
Copy operator.
Definition at line 183 of file interfaceGraph_tpl.h.
References GUM_ERROR.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
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 297 of file interfaceGraph_tpl.h.
References gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__edgeMap, and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__nodeMap.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label().
|
friend |
Definition at line 168 of file interfaceGraph.h.
|
private |
A counter used of assigning ids to labels.
Definition at line 277 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label().
|
private |
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
Definition at line 274 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edges(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::size(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
|
private |
Data associated with edges in __graph.
Definition at line 261 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
|
private |
For shallow copies.
Definition at line 280 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
|
private |
The interface graph.
Definition at line 252 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph().
|
private |
Mapping between PRMInstance<GUM_SCALAR> dans their id in __graph.
Definition at line 258 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::id(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph().
|
private |
Bijection between labels and their ids.
Definition at line 264 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::labels(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
|
private |
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
Definition at line 269 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::__label(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodes(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::size(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
|
private |
Data associated with a node in __graph.
Definition at line 255 of file interfaceGraph.h.
Referenced by gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::InterfaceGraph(), gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node(), and gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph().
|
private |
The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph.
Definition at line 249 of file interfaceGraph.h.