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

This class is used to define an edge growth of a pattern in this DFSTree. More...

#include <agrum/PRM/DFSTree.h>

Collaboration diagram for gum::prm::gspan::EdgeGrowth< GUM_SCALAR >:
[legend]

Public Member Functions

 EdgeGrowth (NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
 Constructor.
 EdgeGrowth (const EdgeGrowth &from)
 Copy constructor.
 ~EdgeGrowth ()
 Destructor.
void insert (PRMInstance< GUM_SCALAR > *u, PRMInstance< GUM_SCALAR > *v)
 Add the pair (u,v) as a match for the current growth.
std::string toString ()
 Return a string representation of this.

Public Attributes

NodeId u
 The id of the node from which we grow an edge.
LabelData * edge
 The LabelData over the edge of this edge growth.
LabelData * l_v
 The LabelData over the node of this edge growth.
NodeId v
 If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that subscripts start from 1).
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > * > > matches
 The mapping between the u and v for each match in the interface graph.

Private Attributes

UndiGraph iso_graph
 The iso graph for computing the maximum independent set of matches.
std::vector< NodeId > * degree_list
 Vector used for computation.
Set< NodeId > max_indep_set
 The max indep set of matches.

Friends

class DFSTree< GUM_SCALAR >

Detailed Description

template<GUM_Numeric GUM_SCALAR>
class gum::prm::gspan::EdgeGrowth< GUM_SCALAR >

This class is used to define an edge growth of a pattern in this DFSTree.

Definition at line 73 of file edgeGrowth.h.

Constructor & Destructor Documentation

◆ EdgeGrowth() [1/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::EdgeGrowth ( NodeId a_u,
LabelData * an_edge,
LabelData * a_l_v,
NodeId a_v = 0 )

Constructor.

Definition at line 58 of file edgeGrowth_tpl.h.

61 :
64 }
This class is used to define an edge growth of a pattern in this DFSTree.
Definition edgeGrowth.h:73
NodeId u
The id of the node from which we grow an edge.
Definition edgeGrowth.h:83
std::vector< NodeId > * degree_list
Vector used for computation.
Definition edgeGrowth.h:103
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition edgeGrowth.h:90
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
LabelData * edge
The LabelData over the edge of this edge growth.
Definition edgeGrowth.h:85
LabelData * l_v
The LabelData over the node of this edge growth.
Definition edgeGrowth.h:87

References EdgeGrowth(), degree_list, edge, l_v, u, and v.

Referenced by EdgeGrowth(), EdgeGrowth(), ~EdgeGrowth(), and DFSTree< GUM_SCALAR >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EdgeGrowth() [2/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::EdgeGrowth ( const EdgeGrowth< GUM_SCALAR > & from)

Copy constructor.

Definition at line 67 of file edgeGrowth_tpl.h.

67 :
71
73 }
NodeProperty< std::pair< PRMInstance< GUM_SCALAR > *, PRMInstance< GUM_SCALAR > * > > matches
The mapping between the u and v for each match in the interface graph.
Definition edgeGrowth.h:95
Set< NodeId > max_indep_set
The max indep set of matches.
Definition edgeGrowth.h:105
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition edgeGrowth.h:101

References EdgeGrowth(), degree_list, edge, iso_graph, matches, max_indep_set, u, and v.

Here is the call graph for this function:

◆ ~EdgeGrowth()

template<GUM_Numeric GUM_SCALAR>
gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::~EdgeGrowth ( )

Destructor.

Definition at line 76 of file edgeGrowth_tpl.h.

76 {
78
79 if (degree_list != 0) { delete degree_list; }
80 }

References EdgeGrowth(), and degree_list.

Here is the call graph for this function:

Member Function Documentation

◆ insert()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert ( PRMInstance< GUM_SCALAR > * u,
PRMInstance< GUM_SCALAR > * v )

Add the pair (u,v) as a match for the current growth.

Definition at line 90 of file edgeGrowth_tpl.h.

91 {
92 NodeId id = iso_graph.addNode();
93 degree_list->push_back(id);
94
95 for (const auto& elt: matches) {
96 if ((elt.second.first == u) || (elt.second.second == u) || (elt.second.first == v)
97 || (elt.second.second == v)) {
98 iso_graph.addEdge(elt.first, id);
99 }
100 }
101
102 // The order between u and v is important ! DO NOT INVERSE IT !
104 }
void insert(PRMInstance< GUM_SCALAR > *u, PRMInstance< GUM_SCALAR > *v)
Add the pair (u,v) as a match for the current growth.

References degree_list, iso_graph, matches, u, and v.

Referenced by gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_().

Here is the caller graph for this function:

◆ toString()

template<GUM_Numeric GUM_SCALAR>
std::string gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::toString ( )

Return a string representation of this.

Definition at line 83 of file edgeGrowth_tpl.h.

83 {
85 str << u << "-" << edge << "-" << l_v << "-" << v;
86 return str.str();
87 }

References edge, l_v, u, and v.

Referenced by gum::prm::GSpan< GUM_SCALAR >::_subgraph_mining_().

Here is the caller graph for this function:

◆ DFSTree< GUM_SCALAR >

template<GUM_Numeric GUM_SCALAR>
friend class DFSTree< GUM_SCALAR >
friend

Definition at line 113 of file edgeGrowth.h.

References EdgeGrowth().

Member Data Documentation

◆ degree_list

template<GUM_Numeric GUM_SCALAR>
std::vector< NodeId >* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list
private

Vector used for computation.

Definition at line 103 of file edgeGrowth.h.

Referenced by EdgeGrowth(), EdgeGrowth(), ~EdgeGrowth(), and insert().

◆ edge

template<GUM_Numeric GUM_SCALAR>
LabelData* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::edge

The LabelData over the edge of this edge growth.

Definition at line 85 of file edgeGrowth.h.

Referenced by EdgeGrowth(), EdgeGrowth(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_checkGrowth_(), gum::prm::gspan::operator<<(), and toString().

◆ iso_graph

template<GUM_Numeric GUM_SCALAR>
UndiGraph gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::iso_graph
private

The iso graph for computing the maximum independent set of matches.

Definition at line 101 of file edgeGrowth.h.

Referenced by EdgeGrowth(), and insert().

◆ l_v

template<GUM_Numeric GUM_SCALAR>
LabelData* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::l_v

The LabelData over the node of this edge growth.

Definition at line 87 of file edgeGrowth.h.

Referenced by EdgeGrowth(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_checkGrowth_(), gum::prm::gspan::operator<<(), and toString().

◆ matches

template<GUM_Numeric GUM_SCALAR>
NodeProperty< std::pair< PRMInstance< GUM_SCALAR >*, PRMInstance< GUM_SCALAR >* > > gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::matches

The mapping between the u and v for each match in the interface graph.

Definition at line 95 of file edgeGrowth.h.

Referenced by EdgeGrowth(), gum::prm::gspan::DFSTree< GUM_SCALAR >::growPattern(), and insert().

◆ max_indep_set

template<GUM_Numeric GUM_SCALAR>
Set< NodeId > gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::max_indep_set
private

The max indep set of matches.

Definition at line 105 of file edgeGrowth.h.

Referenced by EdgeGrowth().

◆ u

template<GUM_Numeric GUM_SCALAR>
NodeId gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::u

The id of the node from which we grow an edge.

Definition at line 83 of file edgeGrowth.h.

Referenced by EdgeGrowth(), EdgeGrowth(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_checkGrowth_(), insert(), gum::prm::gspan::operator<<(), and toString().

◆ v

template<GUM_Numeric GUM_SCALAR>
NodeId gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::v

If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that subscripts start from 1).

Definition at line 90 of file edgeGrowth.h.

Referenced by EdgeGrowth(), EdgeGrowth(), gum::prm::gspan::DFSTree< GUM_SCALAR >::_checkGrowth_(), insert(), gum::prm::gspan::operator<<(), and toString().


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