aGrUM  0.14.2
edgeGrowth.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_EDGE_GROWTH_H
28 #define GUM_EDGE_GROWTH_H
29 
30 #include <list>
31 #include <ostream>
32 #include <utility>
33 #include <vector>
34 
35 #include <agrum/core/math/math.h>
36 #include <agrum/core/bijection.h>
37 #include <agrum/core/sequence.h>
38 #include <agrum/core/set.h>
39 
40 #include <agrum/graphs/diGraph.h>
41 
43 
46 
47 namespace gum {
48  namespace prm {
49  namespace gspan {
50  template < typename GUM_SCALAR >
51  class DFSTree;
52 
59  template < typename GUM_SCALAR >
60  class EdgeGrowth {
61  public:
62  friend class DFSTree< GUM_SCALAR >;
64  EdgeGrowth(NodeId a_u,
65  LabelData* an_edge,
66  LabelData* a_l_v,
67  NodeId a_v = 0);
69  EdgeGrowth(const EdgeGrowth& from);
71  ~EdgeGrowth();
86  std::pair< PRMInstance< GUM_SCALAR >*, PRMInstance< GUM_SCALAR >* > >
89  std::string toString();
90 
91  private:
95  std::vector< NodeId >* degree_list;
98  };
99 
100  template < typename GUM_SCALAR >
101  std::ostream& operator<<(std::ostream& out,
103 
104 
105 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
106  extern template class EdgeGrowth< double >;
107 #endif
108 
109 
110  } /* namespace gspan */
111  } /* namespace prm */
112 } /* namespace gum */
113 
115 
116 #endif /* GUM_EDGE_GROWTH_H */
Useful macros for maths.
Set< NodeId > max_indep_set
The max indep set of matches.
Definition: edgeGrowth.h:97
This class is used to define an edge growth of a pattern in this DFSTree.
Definition: edgeGrowth.h:60
Base classes for oriented graphs.
LabelData * l_v
The LabelData over the node of this edge growth.
Definition: edgeGrowth.h:77
std::ostream & operator<<(std::ostream &out, const DFSCode &code)
Print code in out.
Definition: DFSCode.cpp:37
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
Sets of elements (i.e.
Inner class to handle data about labels in this interface graph.
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
Definition: PRMInstance.h:60
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
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
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
The class for generic Hash Tables.
Definition: hashTable.h:676
NodeId u
The id of the node from which we grow an edge.
Definition: edgeGrowth.h:73
A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph...
Definition: DFSTree.h:68
NodeId v
If the growth is backward you must assigned the subscript of v, otherwise 0 is assigned (recall that ...
Definition: edgeGrowth.h:80
Inline implementation of the DFSTree class.
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
std::string toString()
Return a string representation of this.
Base class for undirected graphs.
Definition: undiGraph.h:106
Headers of InterfaceGraph.
UndiGraph iso_graph
The iso graph for computing the maximum independent set of matches.
Definition: edgeGrowth.h:93
Headers of the Pattern class.
Size NodeId
Type for node ids.
Definition: graphElements.h:97
Set of pairs of elements with fast search for both elements.
void insert(PRMInstance< GUM_SCALAR > *u, PRMInstance< GUM_SCALAR > *v)
Add the pair (u,v) as a match for the current growth.
EdgeGrowth(NodeId a_u, LabelData *an_edge, LabelData *a_l_v, NodeId a_v=0)
Constructor.