![]() |
aGrUM 3.2.0
a C++ library for (probabilistic) graphical models
|
This is class is an implementation of a strict strategy for the GSpan algorithm. More...
#include <agrum/PRM/gspan/DFSTree.h>
Classes | |
| struct | PData |
| Private structure to represent data about a pattern. More... | |
Public Member Functions | |
Constructor and destructor. | |
| StrictSearch (Size freq=2) | |
| Default constructor. | |
| StrictSearch (const StrictSearch &from) | |
| Copy constructor. | |
| ~StrictSearch () override | |
| Destructor. | |
| StrictSearch & | operator= (const StrictSearch &from) |
| Copy operator. | |
Search methods. | |
| bool | accept_root (const Pattern *r) override |
| bool | accept_growth (const Pattern *parent, const Pattern *child, const EdgeGrowth< GUM_SCALAR > &growth) override |
| bool | operator() (LabelData *i, LabelData *j) override |
| bool | operator() (Pattern *i, Pattern *j) override |
Search methods. | |
| void | setTree (DFSTree< GUM_SCALAR > *tree) |
Protected Member Functions | |
| double | computeCost_ (const Pattern &p) |
Protected Attributes | |
| DFSTree< GUM_SCALAR > * | tree_ |
Private Member Functions | |
| double | _inner_cost_ (const Pattern *p) |
| double | _outer_cost_ (const Pattern *p) |
| void | _compute_costs_ (const Pattern *p) |
| std::string | _str_ (const PRMInstance< GUM_SCALAR > *i, const PRMAttribute< GUM_SCALAR > *a) const |
| std::string | _str_ (const PRMInstance< GUM_SCALAR > *i, const PRMAttribute< GUM_SCALAR > &a) const |
| std::string | _str_ (const PRMInstance< GUM_SCALAR > *i, const PRMSlotChain< GUM_SCALAR > &a) const |
| 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) |
Private Attributes | |
| Size | _freq_ |
| HashTable< const Pattern *, std::pair< double, double > > | _map_ |
| std::string | _dot_ |
This is class is an implementation of a strict strategy for the GSpan algorithm.
This will force early cuts in the DFSTree and should help not spending much time searching for new patterns.
A new growth is accepted if it is at least better than its predecessor.
Definition at line 183 of file searchStrategy.h.
|
explicit |
Default constructor.
Definition at line 294 of file searchStrategy_tpl.h.
References gum::prm::gspan::SearchStrategy< GUM_SCALAR >::SearchStrategy(), StrictSearch(), _dot_, and _freq_.
Referenced by StrictSearch(), StrictSearch(), ~StrictSearch(), and operator=().
| gum::prm::gspan::StrictSearch< GUM_SCALAR >::StrictSearch | ( | const StrictSearch< GUM_SCALAR > & | from | ) |
Copy constructor.
Definition at line 300 of file searchStrategy_tpl.h.
References gum::prm::gspan::SearchStrategy< GUM_SCALAR >::SearchStrategy(), StrictSearch(), and _freq_.
|
override |
Destructor.
Definition at line 306 of file searchStrategy_tpl.h.
References StrictSearch().
|
private |
Definition at line 84 of file searchStrategy_tpl.h.
References _str_(), gum::UndiGraph::addEdge(), gum::NodeGraphPart::addNode(), gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::first(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::graph, gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::inners, gum::BijectionImplementation< T1, T2, std::is_scalar< T1 >::value &&std::is_scalar< T2 >::value >::insert(), gum::Set< Key >::insert(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::mod, gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::node2attr, gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::outputs, gum::prm::PRMClassElement< GUM_SCALAR >::prm_aggregate, gum::prm::PRMClassElement< GUM_SCALAR >::prm_attribute, gum::prm::PRMClassElement< GUM_SCALAR >::prm_slotchain, and gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::vars.
Referenced by _compute_costs_().
|
private |
Definition at line 381 of file searchStrategy_tpl.h.
References _buildPatternGraph_(), _elimination_cost_(), _map_, gum::prm::gspan::SearchStrategy< GUM_SCALAR >::computeCost_(), and gum::prm::gspan::SearchStrategy< GUM_SCALAR >::tree_.
Referenced by _inner_cost_(), and _outer_cost_().
|
private |
Definition at line 161 of file searchStrategy_tpl.h.
References gum::StaticTriangulation::eliminationOrder(), gum::Set< Key >::erase(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::graph, gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::inners, gum::List< Val >::insert(), gum::Set< Key >::insert(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::mod, gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::outputs, gum::Set< Key >::size(), and gum::prm::gspan::StrictSearch< GUM_SCALAR >::PData::vars.
Referenced by _compute_costs_().
|
private |
Definition at line 343 of file searchStrategy_tpl.h.
References _compute_costs_(), and _map_.
Referenced by accept_growth(), and operator()().
|
private |
Definition at line 353 of file searchStrategy_tpl.h.
References _compute_costs_(), and _map_.
Referenced by accept_growth(), and operator()().
|
private |
Definition at line 369 of file searchStrategy_tpl.h.
References _dot_, gum::prm::PRMObject::name(), and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().
|
private |
Definition at line 363 of file searchStrategy_tpl.h.
References _dot_, gum::prm::PRMObject::name(), and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().
Referenced by _buildPatternGraph_().
|
private |
Definition at line 375 of file searchStrategy_tpl.h.
References _dot_, gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt(), and gum::prm::PRMObject::name().
|
overridevirtual |
Implements gum::prm::gspan::SearchStrategy< GUM_SCALAR >.
Definition at line 323 of file searchStrategy_tpl.h.
References _inner_cost_(), _outer_cost_(), and gum::prm::gspan::SearchStrategy< GUM_SCALAR >::tree_.
|
overridevirtual |
Implements gum::prm::gspan::SearchStrategy< GUM_SCALAR >.
Definition at line 318 of file searchStrategy_tpl.h.
References _freq_, and gum::prm::gspan::SearchStrategy< GUM_SCALAR >::tree_.
|
protectedinherited |
Definition at line 57 of file searchStrategy_tpl.h.
References gum::SequenceImplementation< Key, Gen >::exists(), gum::SequenceImplementation< Key, Gen >::insert(), and tree_.
Referenced by gum::prm::gspan::StrictSearch< GUM_SCALAR >::_compute_costs_(), and gum::prm::gspan::TreeWidthSearch< GUM_SCALAR >::cost().
|
overridevirtual |
Implements gum::prm::gspan::SearchStrategy< GUM_SCALAR >.
Definition at line 337 of file searchStrategy_tpl.h.
References gum::prm::gspan::SearchStrategy< GUM_SCALAR >::tree_, and gum::prm::gspan::LabelData::tree_width.
|
overridevirtual |
Implements gum::prm::gspan::SearchStrategy< GUM_SCALAR >.
Definition at line 331 of file searchStrategy_tpl.h.
References _inner_cost_(), _outer_cost_(), and gum::prm::gspan::SearchStrategy< GUM_SCALAR >::tree_.
| StrictSearch< GUM_SCALAR > & gum::prm::gspan::StrictSearch< GUM_SCALAR >::operator= | ( | const StrictSearch< GUM_SCALAR > & | from | ) |
Copy operator.
Definition at line 312 of file searchStrategy_tpl.h.
References StrictSearch(), and _freq_.
|
inherited |
Definition at line 236 of file searchStrategy_tpl.h.
References tree_.
Referenced by operator=().
|
private |
Definition at line 246 of file searchStrategy.h.
Referenced by StrictSearch(), _str_(), _str_(), and _str_().
|
private |
Definition at line 219 of file searchStrategy.h.
Referenced by StrictSearch(), StrictSearch(), accept_root(), and operator=().
|
private |
Definition at line 223 of file searchStrategy.h.
Referenced by _compute_costs_(), _inner_cost_(), and _outer_cost_().
|
protectedinherited |
Definition at line 119 of file searchStrategy.h.
Referenced by SearchStrategy(), SearchStrategy(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_compute_costs_(), gum::prm::gspan::FrequenceSearch< GUM_SCALAR >::accept_growth(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::accept_growth(), gum::prm::gspan::FrequenceSearch< GUM_SCALAR >::accept_root(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::accept_root(), computeCost_(), gum::prm::gspan::FrequenceSearch< GUM_SCALAR >::operator()(), gum::prm::gspan::FrequenceSearch< GUM_SCALAR >::operator()(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::operator()(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::operator()(), and setTree().