aGrUM  0.20.2
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),
42  degree_list(new std::vector< NodeId >()) {
43  GUM_CONSTRUCTOR(EdgeGrowth);
44  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:79
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:77
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:97
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:75
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:82
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 47 of file edgeGrowth_tpl.h.

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

48  :
49  u(from.u),
50  edge(from.edge), v(from.v), matches(from.matches),
51  iso_graph(from.iso_graph), degree_list(0),
52  max_indep_set(from.max_indep_set) {
53  GUM_CONS_CPY(EdgeGrowth);
54 
55  if (from.degree_list != 0) {
56  degree_list = new std::vector< NodeId >(*(from.degree_list));
57  }
58  }
Set< NodeId > max_indep_set
The max indep set of matches.
Definition: edgeGrowth.h:99
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:89
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:77
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:97
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:75
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:82
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:95
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 61 of file edgeGrowth_tpl.h.

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

61  {
62  GUM_DESTRUCTOR(EdgeGrowth);
63 
64  if (degree_list != 0) { delete degree_list; }
65  }
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:97
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 75 of file edgeGrowth_tpl.h.

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

76  {
77  NodeId id = iso_graph.addNode();
78  degree_list->push_back(id);
79 
80  for (const auto& elt: matches) {
81  if ((elt.second.first == u) || (elt.second.second == u)
82  || (elt.second.first == v) || (elt.second.second == v)) {
83  iso_graph.addEdge(elt.first, id);
84  }
85  }
86 
87  // The order between u and v is important ! DO NOT INVERSE IT !
88  matches.insert(id, std::make_pair(u, v));
89  }
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:89
std::vector< NodeId > * degree_list
Vector used for computation.
Definition: edgeGrowth.h:97
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:75
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:82
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:95
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 68 of file edgeGrowth_tpl.h.

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

68  {
69  std::stringstream str;
70  str << u << "-" << edge << "-" << l_v << "-" << v;
71  return str.str();
72  }
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:79
LabelData * edge
The LabelData over the edge of this edge growth.
Definition: edgeGrowth.h:77
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:75
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:82
+ 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 97 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 77 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 95 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 79 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 89 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 99 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 75 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 82 of file edgeGrowth.h.


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