49#ifndef GUM_SEARCHSTRATEGY_H
50#define GUM_SEARCHSTRATEGY_H
62 template <
typename GUM_SCALAR >
66 template <
typename GUM_SCALAR >
80 template <
typename GUM_SCALAR >
106 void setTree(DFSTree< GUM_SCALAR >* tree);
133 template <
typename GUM_SCALAR >
183 template <
typename GUM_SCALAR >
255 Set< Tensor< GUM_SCALAR >* >& pool,
258 Set< Tensor< GUM_SCALAR >* >& pool);
270 template <
typename GUM_SCALAR >
313#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
314# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
315# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
316# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
322#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
323# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
324# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
325# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
331#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
332# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
333# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
334# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
340#ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
341# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
342# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
343# ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
The class for generic Hash Tables.
The generic class for storing (ordered) sequences of objects.
Base class for undirected graphs.
This class discovers pattern in a PRM<GUM_SCALAR>'s PRMSystem<GUM_SCALAR> to speed up structured infe...
PRMAttribute is a member of a Class in a PRM.
An PRMInstance is a Bayesian network fragment defined by a Class and used in a PRMSystem.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
A DFSTree is used by gspan to sort lexicographically patterns discovered in an interface graph.
This class is used to define an edge growth of a pattern in this DFSTree.
This is class is an implementation of a simple serach strategy for the gspan algorithm: it accept a g...
virtual ~FrequenceSearch()
Destructor.
FrequenceSearch(Size freq)
Default constructor.
virtual bool operator()(LabelData *i, LabelData *j)
virtual bool accept_root(const Pattern *r)
virtual bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth)
FrequenceSearch & operator=(const FrequenceSearch &from)
Copy operator.
This contains all the information we want for a node in a DFSTree.
This is an abstract class used to tune search strategies in the gspan algorithm.
double computeCost_(const Pattern &p)
virtual bool operator()(LabelData *i, LabelData *j)=0
SearchStrategy()
Default constructor.
virtual bool operator()(Pattern *i, Pattern *j)=0
SearchStrategy< GUM_SCALAR > & operator=(const SearchStrategy< GUM_SCALAR > &from)
Copy operator.
DFSTree< GUM_SCALAR > * tree_
void setTree(DFSTree< GUM_SCALAR > *tree)
virtual ~SearchStrategy()
Destructor.
virtual bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth)=0
virtual bool accept_root(const Pattern *r)=0
This is class is an implementation of a strict strategy for the GSpan algorithm.
double _outer_cost_(const Pattern *p)
virtual bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth)
virtual ~StrictSearch()
Destructor.
StrictSearch(Size freq=2)
Default constructor.
virtual bool accept_root(const Pattern *r)
StrictSearch & operator=(const StrictSearch &from)
Copy operator.
double _inner_cost_(const Pattern *p)
HashTable< const Pattern *, std::pair< double, double > > _map_
virtual bool operator()(LabelData *i, LabelData *j)
void _compute_costs_(const Pattern *p)
void _buildPatternGraph_(typename StrictSearch< GUM_SCALAR >::PData &data, Set< Tensor< GUM_SCALAR > * > &pool, const Sequence< PRMInstance< GUM_SCALAR > * > &match)
std::pair< Size, Size > _elimination_cost_(typename StrictSearch< GUM_SCALAR >::PData &data, Set< Tensor< GUM_SCALAR > * > &pool)
std::string _str_(const PRMInstance< GUM_SCALAR > *i, const PRMAttribute< GUM_SCALAR > *a) const
A growth is accepted if and only if the new growth has a tree width less large or equal than its fath...
TreeWidthSearch()
Default constructor.
virtual bool accept_growth(const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth)
virtual ~TreeWidthSearch()
Destructor.
HashTable< const Pattern *, double > _map_
TreeWidthSearch & operator=(const TreeWidthSearch &from)
Copy operator.
virtual bool operator()(LabelData *i, LabelData *j)
virtual bool accept_root(const Pattern *r)
double cost(const Pattern &p)
Headers of the DFSTree class.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
namespace for all probabilistic relational models entities
gum is the global namespace for all aGrUM entities
Inline implementation of the SearchStrategy class.
Inner class to handle data about labels in this interface graph.
Private structure to represent data about a pattern.
Bijection< NodeId, std::string > node2attr
A bijection to easily keep track between graph and attributes, its of the form instance_name DOT attr...
NodeProperty< Size > mod
The pattern's variables modalities.
UndiGraph graph
A yet to be triangulated undigraph.
NodeSet outputs
Returns the set of outputs nodes given all the matches of pattern.
NodeSet inners
Returns the set of inner nodes.
Bijection< NodeId, const DiscreteVariable * > vars
Bijection between graph's nodes and their corresponding DiscreteVariable, for inference purpose.