27 #ifndef GUM_DFS_TREE_H 28 #define GUM_DFS_TREE_H 53 template <
typename GUM_SCALAR >
57 template <
typename GUM_SCALAR >
67 template <
typename GUM_SCALAR >
115 std::list< NodeId >&
roots();
118 const std::list< NodeId >&
roots()
const;
303 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
PatternData(Pattern *p)
Constructor.
const InterfaceGraph< GUM_SCALAR > * __graph
The interface graph on which this DFSTree applies.
This class is used to define an edge growth of a pattern in this DFSTree.
Base classes for oriented graphs.
SearchStrategy< GUM_SCALAR > * __strategy
The strategy used to prune the search tree.
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
void __addChild(Pattern &p, Pattern *child, EdgeGrowth< GUM_SCALAR > &edge_growth)
Add a child to this DFSTree.
Inner class to handle data about labels in this interface graph.
Pattern * pattern
The pattern.
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
The generic class for storing (ordered) sequences of objects.
Pattern & growPattern(Pattern &p, EdgeGrowth< GUM_SCALAR > &edge_growth, Size min_freq)
Add a one edge growth of p as one of its child.
Abstract class representing an element of PRM class.
std::list< NodeId > __roots
The list of root patterns in this DFSTree.
UndiGraph & g
The isomorphism graph.
Inner class to handle data about edges in __graph.
This is used to generate the max_indep_set of a Pattern.
This class represent the interface graph of a given gum::prm::PRMSystem<GUM_SCALAR>.
void addRoot(LabelData &data)
Add a one edge Pattern in this DFSTree.
gum is the global namespace for all aGrUM entities
bool __is_new_seq(Sequence< PRMInstance< GUM_SCALAR > * > &seq, NodeProperty< Sequence< PRMInstance< GUM_SCALAR > * > * > &iso_map)
Check if an instance match is redundant.
The class for generic Hash Tables.
std::list< NodeId > & roots()
Returns the list of root patterns in this DFSTree.
const InterfaceGraph< GUM_SCALAR > & graph() const
Returns the list of root patterns in this DFSTree.
A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph...
~PatternData()
Destructor.
Size cost
The cost of this Pattern.
Base class for all oriented graphs.
Headers of the DFSTree class.
Headers of the SearchStrategy class and child.
Set< NodeId > max_indep_set
The maximal independent set of p.
Set of pairs of elements with fast search for both elements.
NodeProperty< Sequence< PRMInstance< GUM_SCALAR > *> *> iso_map
The instances matching p in the interface graph.
Inline implementation of the DFSTree class.
SearchStrategy< GUM_SCALAR > & strategy()
strategy getter
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
This class discovers pattern in a PRM<GUM_SCALAR>'s PRMSystem<GUM_SCALAR> to speed up structured infe...
void __initialiaze_root(Pattern *p, Sequence< EdgeData< GUM_SCALAR > * > &seq)
This initialize the DSFTree with a new root.
Base class for undirected graphs.
Headers of InterfaceGraph.
Size gain
The gain of this Pattern.
PatternData & data(const Pattern &p)
HashTable< Pattern *, PatternData *> __data
Data about patterns in this DFSTree.
double frequency(const Pattern &p) const
Returns the frequency of p respecting it's maximal independent set.
bool __test_equality(HashTable< PRMClassElement< GUM_SCALAR > *, Size > &x, HashTable< PRMClassElement< GUM_SCALAR > *, Size > &y)
void __checkGrowth(Pattern &p, Pattern *child, EdgeGrowth< GUM_SCALAR > &edge_growth)
Raise different exceptions if child is invalid or illegal.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Pattern & parent(const Pattern &p)
Returns the parent of p in this DFSTree.
UndiGraph iso_graph
The isomorphism graph of the pattern.
Headers of the Pattern class.
Bijection< NodeId, Pattern *> __node_map
The mapping between nodes in this DFSTree and the patterns they represents.
std::list< NodeId > children
The list of the pattern's children, sorted lexicographically.
This contains all the information we want for a node in a DFSTree.
DFSTree(const InterfaceGraph< GUM_SCALAR > &graph, SearchStrategy< GUM_SCALAR > *strategy=0)
Default constructor.
This is an abstract class used to tune search strategies in the gspan algorithm.
Size NodeId
Type for node ids.
Set of pairs of elements with fast search for both elements.