aGrUM  0.13.2
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 >:

Public Attributes

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

Public Member Functions

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

Friends

class DFSTree< GUM_SCALAR >
 

Detailed Description

template<typename 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 60 of file edgeGrowth.h.

Constructor & Destructor Documentation

template<typename GUM_SCALAR >
INLINE 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 34 of file edgeGrowth_tpl.h.

37  :
38  u(a_u),
39  edge(an_edge), l_v(a_l_v), v(a_v),
40  degree_list(new std::vector< NodeId >()) {
41  GUM_CONSTRUCTOR(EdgeGrowth);
42  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:77
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:75
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:95
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:73
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:80
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
template<typename GUM_SCALAR >
INLINE gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::EdgeGrowth ( const EdgeGrowth< GUM_SCALAR > &  from)

Copy constructor.

Definition at line 45 of file edgeGrowth_tpl.h.

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list.

46  :
47  u(from.u),
48  edge(from.edge), v(from.v), matches(from.matches),
49  iso_graph(from.iso_graph), degree_list(0),
50  max_indep_set(from.max_indep_set) {
51  GUM_CONS_CPY(EdgeGrowth);
52 
53  if (from.degree_list != 0) {
54  degree_list = new std::vector< NodeId >(*(from.degree_list));
55  }
56  }
Set< NodeId > max_indep_set
The max indep set of matches.
Definition: edgeGrowth.h:97
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:87
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:75
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:95
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:73
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:80
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:93
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
template<typename GUM_SCALAR >
INLINE gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::~EdgeGrowth ( )

Destructor.

Definition at line 59 of file edgeGrowth_tpl.h.

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list.

59  {
60  GUM_DESTRUCTOR(EdgeGrowth);
61 
62  if (degree_list != 0) { delete degree_list; }
63  }
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:95
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.

Member Function Documentation

template<typename 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 73 of file edgeGrowth_tpl.h.

References gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNode(), gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::iso_graph, and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::matches.

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

74  {
75  NodeId id = iso_graph.addNode();
76  degree_list->push_back(id);
77 
78  for (const auto& elt : matches) {
79  if ((elt.second.first == u) || (elt.second.second == u)
80  || (elt.second.first == v) || (elt.second.second == v)) {
81  iso_graph.addEdge(elt.first, id);
82  }
83  }
84 
85  // The order between u and v is important ! DO NOT INVERSE IT !
86  matches.insert(id, std::make_pair(u, v));
87  }
unsigned int NodeId
Type for node ids.
Definition: graphElements.h:97
virtual void addEdge(const NodeId first, const NodeId second)
insert a new edge into the undirected graph
Definition: undiGraph_inl.h:32
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:87
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:95
virtual NodeId addNode()
insert a new node and return its id
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:73
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:80
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:93

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Return a string representation of this.

Definition at line 66 of file edgeGrowth_tpl.h.

References gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::edge, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::l_v, gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::u, and gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::v.

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

66  {
67  std::stringstream str;
68  str << u << "-" << edge << "-" << l_v << "-" << v;
69  return str.str();
70  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:77
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:75
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:73
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:80

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<typename GUM_SCALAR>
friend class DFSTree< GUM_SCALAR >
friend

Definition at line 62 of file edgeGrowth.h.

Member Data Documentation

template<typename GUM_SCALAR>
std::vector< NodeId >* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::degree_list
private
template<typename GUM_SCALAR>
LabelData* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::edge
template<typename 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 93 of file edgeGrowth.h.

Referenced by gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::insert().

template<typename GUM_SCALAR>
LabelData* gum::prm::gspan::EdgeGrowth< GUM_SCALAR >::l_v
template<typename 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 87 of file edgeGrowth.h.

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

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

The max indep set of matches.

Definition at line 97 of file edgeGrowth.h.

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

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

Definition at line 73 of file edgeGrowth.h.

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

template<typename 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 80 of file edgeGrowth.h.

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


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