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

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 62 of file edgeGrowth.h.

Constructor & Destructor Documentation

◆ EdgeGrowth() [1/2]

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 36 of file edgeGrowth_tpl.h.

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

39  :
40  u(a_u),
41  edge(an_edge), l_v(a_l_v), v(a_v), degree_list(new std::vector< NodeId >()) {
42  GUM_CONSTRUCTOR(EdgeGrowth);
43  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:76
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:74
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:92
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:72
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:79
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
+ Here is the call graph for this function:

◆ EdgeGrowth() [2/2]

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

Copy constructor.

Definition at line 46 of file edgeGrowth_tpl.h.

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

46  :
47  u(from.u), edge(from.edge), v(from.v), matches(from.matches), iso_graph(from.iso_graph),
48  degree_list(0), max_indep_set(from.max_indep_set) {
49  GUM_CONS_CPY(EdgeGrowth);
50 
51  if (from.degree_list != 0) { degree_list = new std::vector< NodeId >(*(from.degree_list)); }
52  }
Set< NodeId > max_indep_set
The max indep set of matches.
Definition: edgeGrowth.h:94
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:84
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:74
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:92
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:72
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:79
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:90
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
+ Here is the call graph for this function:

◆ ~EdgeGrowth()

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

Destructor.

Definition at line 55 of file edgeGrowth_tpl.h.

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

55  {
56  GUM_DESTRUCTOR(EdgeGrowth);
57 
58  if (degree_list != 0) { delete degree_list; }
59  }
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:92
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.
+ Here is the call graph for this function:

Member Function Documentation

◆ insert()

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 69 of file edgeGrowth_tpl.h.

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

70  {
71  NodeId id = iso_graph.addNode();
72  degree_list->push_back(id);
73 
74  for (const auto& elt: matches) {
75  if ((elt.second.first == u) || (elt.second.second == u) || (elt.second.first == v)
76  || (elt.second.second == v)) {
77  iso_graph.addEdge(elt.first, id);
78  }
79  }
80 
81  // The order between u and v is important ! DO NOT INVERSE IT !
82  matches.insert(id, std::make_pair(u, v));
83  }
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:84
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:92
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:72
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:79
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:90
void addEdge(NodeId first, NodeId second) override
insert a new edge into the undirected graph
Definition: undiGraph_inl.h:34
Size NodeId
Type for node ids.
Definition: graphElements.h:97
+ Here is the call graph for this function:

◆ toString()

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

Return a string representation of this.

Definition at line 62 of file edgeGrowth_tpl.h.

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

62  {
63  std::stringstream str;
64  str << u << "-" << edge << "-" << l_v << "-" << v;
65  return str.str();
66  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:76
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:74
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:72
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:79
+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ DFSTree< GUM_SCALAR >

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

Definition at line 64 of file edgeGrowth.h.

Member Data Documentation

◆ degree_list

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

Vector used for computation.

Definition at line 92 of file edgeGrowth.h.

◆ edge

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

The LabelData over the edge of this edge growth.

Definition at line 74 of file edgeGrowth.h.

◆ iso_graph

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 90 of file edgeGrowth.h.

◆ l_v

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

The LabelData over the node of this edge growth.

Definition at line 76 of file edgeGrowth.h.

◆ matches

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 84 of file edgeGrowth.h.

◆ max_indep_set

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 94 of file edgeGrowth.h.

◆ u

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 72 of file edgeGrowth.h.

◆ v

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 79 of file edgeGrowth.h.


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