![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
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. | |
| InterfaceGraph (const InterfaceGraph &source) | |
| Copy constructor, proceeds with a shallow copy so for friends only. | |
| InterfaceGraph & | operator= (const InterfaceGraph &source) |
| Copy operator. | |
| ~InterfaceGraph () | |
| Destructor. | |
| UndiGraph & | graph () |
| Returns the graph of this interface graph. | |
| const UndiGraph & | graph () const |
| Returns the graph of this interface graph. | |
| Bijection< Idx, LabelData * > & | labels () |
| Returns the bijection between LabelData and their string representation. | |
| const Bijection< Idx, LabelData * > & | labels () const |
| Returns the bijection between LabelData and their string representation. | |
| Size | size (const LabelData *l) const |
| Returns the number of node or edges labelled by l. | |
| Set< NodeData< GUM_SCALAR > * > & | nodes (const LabelData *l) |
| Returns the set of nodes labelled by l. | |
| const Set< NodeData< GUM_SCALAR > * > & | nodes (const LabelData *l) const |
| Returns the set of nodes labelled by l. | |
| Set< EdgeData< GUM_SCALAR > * > & | edges (const LabelData *l) |
| Returns the set of nodes labelled by l. | |
| const Set< EdgeData< GUM_SCALAR > * > & | edges (const LabelData *l) const |
| Returns the set of nodes labelled by l. | |
| LabelData * | label (Idx id) |
| Returns a label given its id. | |
| NodeId | id (const PRMInstance< GUM_SCALAR > &i) const |
| Returns the id of i in this interface graph. | |
| NodeId | id (const PRMInstance< GUM_SCALAR > *i) const |
| Returns the id of i in this interface graph. | |
| NodeData< GUM_SCALAR > & | node (const PRMInstance< GUM_SCALAR > *i) |
| Returns data about a node. | |
| const NodeData< GUM_SCALAR > & | node (const PRMInstance< GUM_SCALAR > *i) const |
| Returns data about a node. | |
| NodeData< GUM_SCALAR > & | node (NodeId id) |
| Returns data about a node. | |
| const NodeData< GUM_SCALAR > & | node (NodeId id) const |
| Returns data about a node. | |
| EdgeData< GUM_SCALAR > & | edge (NodeId u, NodeId v) |
| Returns data about an edge. | |
| const EdgeData< GUM_SCALAR > & | edge (NodeId u, NodeId v) const |
| Returns data about an edge. | |
Private Member Functions | |
| 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 correct label's id. | |
| void | _label_ (EdgeData< GUM_SCALAR > *edge, HashTable< std::string, LabelData * > &label_map) |
| Compute the label of edge and add it to labels if it does not exists yet. Update edge with the correct label's id. | |
Private Attributes | |
| const PRMSystem< GUM_SCALAR > * | _sys_ |
| The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph. | |
| UndiGraph | _graph_ |
| The interface graph. | |
| NodeProperty< NodeData< GUM_SCALAR > * > | _nodes_ |
| Data associated with a node in graph. | |
| 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. | |
| 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. | |
| Idx | _counter_ |
| A counter used of assigning ids to labels. | |
| bool | _erase_flag_ |
| For shallow copies. | |
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 182 of file interfaceGraph.h.
|
explicit |
Default constructor.
Definition at line 114 of file interfaceGraph_tpl.h.
References InterfaceGraph(), _counter_, _edges_, _erase_flag_, _graph_, _idMap_, _label_(), _labels_, _nodes_, _sys_, gum::prm::PRMSystem< GUM_SCALAR >::begin(), edge(), gum::prm::PRMSystem< GUM_SCALAR >::end(), gum::prm::gspan::NodeData< GUM_SCALAR >::l, gum::prm::gspan::NodeData< GUM_SCALAR >::n, and node().
Referenced by InterfaceGraph(), InterfaceGraph(), ~InterfaceGraph(), and operator=().
| 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 157 of file interfaceGraph_tpl.h.
References InterfaceGraph(), _counter_, _edgeMap_, _edges_, _erase_flag_, _graph_, _idMap_, _labels_, _nodeMap_, _nodes_, and _sys_.
| gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::~InterfaceGraph | ( | ) |
Destructor.
Definition at line 167 of file interfaceGraph_tpl.h.
References InterfaceGraph(), _edgeMap_, _edges_, _erase_flag_, _labels_, _nodeMap_, and _nodes_.
|
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 244 of file interfaceGraph_tpl.h.
References _counter_, _edgeMap_, _labels_, edge(), gum::HashTable< Key, Val >::exists(), gum::HashTable< Key, Val >::insert(), label(), and size().
|
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 198 of file interfaceGraph_tpl.h.
References _counter_, _labels_, _nodeMap_, gum::HashTable< Key, Val >::exists(), gum::HashTable< Key, Val >::insert(), label(), node(), and size().
Referenced by InterfaceGraph().
| INLINE EdgeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge | ( | NodeId | u, |
| NodeId | v ) |
Returns data about an edge.
| NotFound |
Definition at line 369 of file interfaceGraph_tpl.h.
References _edges_.
Referenced by InterfaceGraph(), _label_(), and gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_().
| INLINE const EdgeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edge | ( | NodeId | u, |
| NodeId | v ) const |
| INLINE Set< EdgeData< GUM_SCALAR > * > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edges | ( | const LabelData * | l | ) |
| INLINE const Set< EdgeData< GUM_SCALAR > * > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::edges | ( | const LabelData * | l | ) | const |
| INLINE UndiGraph & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::graph | ( | ) |
Returns the graph of this interface graph.
Definition at line 281 of file interfaceGraph_tpl.h.
References _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 286 of file interfaceGraph_tpl.h.
References _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 337 of file interfaceGraph_tpl.h.
References _idMap_.
Referenced by gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_(), gum::prm::GSpan< GUM_SCALAR >::discoverPatterns(), node(), and 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 342 of file interfaceGraph_tpl.h.
References _idMap_.
| INLINE LabelData * gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::label | ( | Idx | id | ) |
| INLINE Bijection< Idx, LabelData * > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::labels | ( | ) |
Returns the bijection between LabelData and their string representation.
Definition at line 291 of file interfaceGraph_tpl.h.
References _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 296 of file interfaceGraph_tpl.h.
References _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.
References node().
Referenced by InterfaceGraph(), _label_(), gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_(), node(), and node().
| INLINE const NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | const PRMInstance< GUM_SCALAR > * | i | ) | const |
| INLINE NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | NodeId | id | ) |
| INLINE const NodeData< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::node | ( | NodeId | id | ) | const |
| INLINE Set< NodeData< GUM_SCALAR > * > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodes | ( | const LabelData * | l | ) |
| INLINE const Set< NodeData< GUM_SCALAR > * > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::nodes | ( | const LabelData * | l | ) | const |
| InterfaceGraph< GUM_SCALAR > & gum::prm::gspan::InterfaceGraph< GUM_SCALAR >::operator= | ( | const InterfaceGraph< GUM_SCALAR > & | source | ) |
Copy operator.
Definition at line 193 of file interfaceGraph_tpl.h.
References InterfaceGraph(), and GUM_ERROR.
| 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 301 of file interfaceGraph_tpl.h.
References _edgeMap_, _nodeMap_, and size().
Referenced by _label_(), _label_(), and size().
|
friend |
Definition at line 153 of file interfaceGraph.h.
|
private |
A counter used of assigning ids to labels.
Definition at line 291 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), _label_(), and _label_().
|
private |
Mapping between a LabelData and the set of EdgeData<GUM_SCALAR> with that label.
Definition at line 288 of file interfaceGraph.h.
Referenced by InterfaceGraph(), ~InterfaceGraph(), _label_(), edges(), edges(), and size().
|
private |
Data associated with edges in graph.
Definition at line 275 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), ~InterfaceGraph(), edge(), and edge().
|
private |
For shallow copies.
Definition at line 294 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), and ~InterfaceGraph().
|
private |
The interface graph.
Definition at line 266 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), graph(), and graph().
|
private |
Mapping between PRMInstance<GUM_SCALAR> dans their id in graph.
Definition at line 272 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), id(), and id().
|
private |
Bijection between labels and their ids.
Definition at line 278 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), ~InterfaceGraph(), _label_(), _label_(), label(), labels(), and labels().
|
private |
Mapping between a LabelData and the set of NodeData<GUM_SCALAR> with that label.
Definition at line 283 of file interfaceGraph.h.
Referenced by InterfaceGraph(), ~InterfaceGraph(), _label_(), nodes(), nodes(), and size().
|
private |
Data associated with a node in graph.
Definition at line 269 of file interfaceGraph.h.
Referenced by InterfaceGraph(), InterfaceGraph(), ~InterfaceGraph(), node(), and node().
|
private |
The gum::prm::PRMSystem<GUM_SCALAR> represented by this interface graph.
Definition at line 263 of file interfaceGraph.h.
Referenced by InterfaceGraph(), and InterfaceGraph().