35 template <
typename GUM_SCALAR >
41 __gspan(0), __pdata(0), __mining(false), __dot(
".") {
52 template <
typename GUM_SCALAR >
62 template <
typename GUM_SCALAR >
82 template <
typename GUM_SCALAR >
95 template <
typename GUM_SCALAR >
99 template <
typename GUM_SCALAR >
103 template <
typename GUM_SCALAR >
112 if (!this->
hasEvidence() && (chain.second->cpf().nbrDim() == 1)) {
116 m.
set(i, chain.second->cpf().get(i));
134 for (
const auto pot: data.
pool)
135 if (pot->contains(
__query.second->type().variable())) pots.
insert(pot);
137 if (pots.
size() == 1) {
144 for (i.setFirst(), j.setFirst(); !i.end(); i.inc(), j.inc())
151 for (i.setFirst(), j.
setFirst(); !i.end(); i.inc(), j.
inc())
162 for (i.setFirst(), j.setFirst(); !i.end(); i.inc(), j.inc())
176 template <
typename GUM_SCALAR >
183 template <
typename GUM_SCALAR >
186 s <<
"Triangulation time: " <<
triang_time << std::endl;
187 s <<
"Pattern mining time: " <<
mining_time << std::endl;
188 s <<
"Pattern elimination time: " <<
pattern_time << std::endl;
189 s <<
"Inner node elimination time: " <<
inner_time << std::endl;
190 s <<
"Observed node elimination time: " <<
obs_time << std::endl;
191 s <<
"Full inference time: " <<
full_time << std::endl;
192 s <<
"#patterns: " <<
__gspan->patterns().size() << std::endl;
194 typedef std::vector< gspan::Pattern* >::const_iterator Iter;
196 for (Iter p =
__gspan->patterns().begin(); p !=
__gspan->patterns().end();
198 if (
__gspan->matches(**p).size()) {
199 s <<
"Pattern n°" << count++
200 <<
" match count: " <<
__gspan->matches(**p).size() << std::endl;
201 s <<
"Pattern n°" << count++ <<
" instance count: " << (**p).size()
209 template <
typename GUM_SCALAR >
220 typedef std::vector< gspan::Pattern* >::const_iterator Iter;
222 for (Iter p =
__gspan->patterns().begin(); p !=
__gspan->patterns().end();
244 template <
typename GUM_SCALAR >
253 &(data.graph), &(data.mod), data.partial_order());
256 for (
size_t i = 0; i < data.inners().size(); ++i)
257 if (!data.barren.exists(elim_order[i]))
262 data.matches.begin();
264 for (
const auto elt: **iter)
267 if (data.obs().size())
276 if (data.obs().size()) {
277 for (; iter != data.matches.end(); ++iter) {
284 for (; iter != data.matches.end(); ++iter) {
291 for (
const auto pat: fake_patterns) {
292 for (
const auto elt: *pat)
295 data.matches.erase(pat);
300 if (data.queries().size())
301 for (
const auto m: data.matches)
312 template <
typename GUM_SCALAR >
319 std::pair< Idx, std::string >& v) {
320 if ((*inst).hasRefAttr((*inst).get(v.second).id())) {
321 std::vector< std::pair< PRMInstance< GUM_SCALAR >*, std::string > >& refs =
324 for (
auto r = refs.begin(); r != refs.end(); ++r) {
325 if (!match.exists(r->first)) {
333 for (
const auto m: data.
matches) {
335 std::make_pair((*m)[v.first], &((*m)[v.first]->get(v.second))))) {
336 GUM_ASSERT(inst->
type().name() == (*m)[v.first]->type().name());
337 GUM_ASSERT(inst->
get(v.second).safeName()
338 == (*m)[v.first]->get(v.second).safeName());
349 template <
typename GUM_SCALAR >
354 std::pair< Idx, std::string > v;
357 for (
const auto inst: match) {
358 for (
const auto& elt: *inst) {
360 v = std::make_pair(match.pos(inst), elt.second->safeName());
361 data.
map.insert(
id, v);
363 data.
mod.insert(
id, elt.second->type()->domainSize());
364 data.
vars.insert(
id, &(elt.second->type().variable()));
372 if (
id != data.
vars.first(var))
381 && (inst->type().containerDag().children(elt.second->id()).size()
389 for (
const auto mat: data.
matches) {
395 match.atPos(pos)->get(
__query.second->safeName()).type().variable();
410 template <
typename GUM_SCALAR >
413 std::pair< Idx, std::string > attr) {
414 for (
const auto mat: data.
matches)
415 if (mat->atPos(attr.first)
416 ->hasRefAttr(mat->atPos(attr.first)->get(attr.second).id()))
422 template <
typename GUM_SCALAR >
428 for (
const auto node: data.
barren) {
429 for (
const auto pot: pool)
430 if (pot->contains(*data.
vars.second(node))) {
447 while (candidates.
size()) {
448 node = candidates.
back();
449 candidates.
erase(node);
452 for (
const auto pot: pool) {
453 if (pot->contains(*data.
vars.second(node))) {
474 template <
typename GUM_SCALAR >
480 const std::vector< NodeId >& elim_order) {
483 std::pair< Idx, std::string > target;
486 for (
size_t idx = data.
inners().
size(); idx < end; ++idx) {
487 target = data.
map[data.
vars.first(data.
vars.second(elim_order[idx]))];
488 eliminateNode(&(match[target.first]->get(target.second).type().variable()),
496 template <
typename GUM_SCALAR >
502 const std::vector< NodeId >& elim_order) {
505 std::pair< Idx, std::string > target;
508 for (
size_t idx = data.
inners().
size(); idx < end; ++idx) {
509 target = data.
map[data.
vars.first(data.
vars.second(elim_order[idx]))];
510 eliminateNode(&(match[target.first]->get(target.second).type().variable()),
518 template <
typename GUM_SCALAR >
530 GUM_ASSERT((**iter).size() == match.size());
532 for (
Size idx = 0; idx < match.size(); ++idx) {
533 GUM_ASSERT((**iter).atPos(idx)->type() == match.atPos(idx)->type());
540 std::pair< Idx, std::string > target;
545 for (
Size idx = 0; idx < match.size(); ++idx) {
547 const auto& chains = source[idx]->type().slotChains();
549 for (
const auto sc: chains) {
551 GUM_ASSERT(!(sc->isMultiple()));
556 ->getInstance(sc->id())
557 .
get(sc->lastElt().safeName())
561 ->getInstance(sc->id())
562 .
get(sc->lastElt().safeName())
567 if (bij.
first(&(match[idx]
568 ->getInstance(sc->id())
569 .
get(sc->lastElt().safeName())
573 ->getInstance(sc->id())
574 .
get(sc->lastElt().safeName())
588 for (
const auto p: pool) {
589 for (
const auto v: p->variablesSequence()) {
591 target = data.
map[data.
vars.first(v)];
593 v, &(match[target.first]->get(target.second).type().variable()));
602 for (
const auto pot: *my_pool)
613 template <
typename GUM_SCALAR >
620 for (
const auto& elt: *this->
_sys) {
643 partial_order[0].insert(agg);
651 if (partial_order[0].empty()) partial_order.
erase(0);
653 if (partial_order.
size() > 1) {
656 if (partial_order[1].empty()) partial_order.
erase(1);
661 partial_order.
insert(query_set);
664 for (
auto attr = inst->
begin(); attr != inst->
end(); ++attr)
670 for (
const auto& elt: this->
evidence(inst))
677 if (partial_order.
size() > 1)
678 for (
size_t idx = 0; idx < partial_order[0].
size(); ++idx)
680 &(inst->
get(v[idx]).type().variable()), pool,
__trash);
684 for (
const auto elt: *inst)
689 for (
const auto& elt: this->
evidence(inst))
695 for (
size_t idx = 0; idx < partial_order[0].
size(); ++idx)
706 for (
const auto srcPot: data->
pool) {
712 for (
const auto agg: data->
c.aggregates())
714 inst->
get(agg->id()).cpf())));
721 for (
size_t idx = data->
inners().
size(); idx < size; ++idx)
728 for (
const auto pot: pool)
735 template <
typename GUM_SCALAR >
742 for (
const auto pot: data.
pool) {
745 for (
Size var_1 = 0; var_1 < vars.
size(); ++var_1) {
751 data.
mods.insert(id_1, vars.
atPos(var_1)->domainSize());
755 for (
Size var_2 = var_1 + 1; var_2 < vars.
size(); ++var_2) {
761 data.
mods.insert(id_2, vars.
atPos(var_2)->domainSize());
775 for (
const auto pot: *elt.second) {
778 pot->variablesSequence();
780 for (
Size var_1 = 0; var_1 < vars.
size(); ++var_1) {
786 data.
mods.insert(id_1, vars.
atPos(var_1)->domainSize());
790 for (
Size var_2 = var_1 + 1; var_2 < vars.
size(); ++var_2) {
796 data.
mods.insert(id_2, vars.
atPos(var_2)->domainSize());
809 template <
typename GUM_SCALAR >
812 partial_order.insert(
NodeSet());
813 partial_order.insert(
NodeSet());
816 template <
typename GUM_SCALAR >
821 matches(m), __real_order(0) {
824 for (
int i = 0; i < 4; ++i)
828 template <
typename GUM_SCALAR >
838 template <
typename GUM_SCALAR >
851 template <
typename GUM_SCALAR >
859 for (
const auto node:
c.containerDag().nodes()) {
860 switch (
c.get(node).elt_type()) {
870 mods.insert(node,
c.get(node).type()->domainSize());
881 const auto& parents =
c.containerDag().parents(node);
884 for (
auto tail = parents.begin(); tail != parents.end(); ++tail) {
891 while (marry != parents.end()) {
902 switch (
c.get(node).elt_type()) {
904 if (
c.isOutputNode(
c.get(node)))
912 for (
const auto par:
c.containerDag().parents(node)) {
913 const auto& prnt =
c.get(par);
915 if ((!
c.isOutputNode(prnt))
930 if (
c.isOutputNode(
c.get(node)))
957 template <
typename GUM_SCALAR >
965 template <
typename GUM_SCALAR >
974 template <
typename GUM_SCALAR >
979 template <
typename GUM_SCALAR >
986 template <
typename GUM_SCALAR >
993 template <
typename GUM_SCALAR >
1000 template <
typename GUM_SCALAR >
1005 template <
typename GUM_SCALAR >
1010 template <
typename GUM_SCALAR >
1012 return "StructuredInference";
1015 template <
typename GUM_SCALAR >
1020 template <
typename GUM_SCALAR >
1026 template <
typename GUM_SCALAR >
1034 GUM_ASSERT(!data.
mod.exists(
id));
1038 GUM_ASSERT(!data.
map.exists(
id));
1039 data.
vars.eraseFirst(
id);
1040 GUM_ASSERT(!data.
vars.existsFirst(
id));
1045 data.
pots.erase(
id);
1046 GUM_ASSERT(!data.
pots.exists(
id));
List< NodeSet > partial_order
The partial order used of variable elimination.
void __buildPatternGraph(PData &data, Set< Potential< GUM_SCALAR > * > &pool, const Sequence< PRMInstance< GUM_SCALAR > * > &match)
Build the DAG corresponding to Pattern data.pattern, initialize pool with all the Potentials of all v...
A class to combine efficiently several MultiDim tablesMultiDimCombinationDefault is a class designed ...
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
void insert(const T1 &first, const T2 &second)
Inserts a new association in the gum::Bijection.
HashTable< const PRMClass< GUM_SCALAR > *, CData *> __cdata_map
Mapping between a Class<GUM_SCALAR> and data about instances reduced using only Class<GUM_SCALAR> lev...
aGrUM's Potential is a multi-dimensional array with tensor operators.
void __reducePattern(const gspan::Pattern *p)
Proceed with the elimination of all inner variables (observed or not) of all usable matches of Patter...
NodeProperty< Size > mods
The class variables modalities.
UndiGraph reducedGraph
The reduced graph.
virtual void _marginal(const typename PRMInference< GUM_SCALAR >::Chain &chain, Potential< GUM_SCALAR > &m)
See PRMInference::_marginal().
const List< NodeSet > * partial_order()
virtual void addNodeWithId(const NodeId id)
try to insert a node with the given id
Val & push_back(Args &&... args)
An alias for pushBack used for STL compliance.
PData(const gspan::Pattern &p, typename GSpan< GUM_SCALAR >::MatchedInstances &m)
Default constructor.
double step() const
Returns the delta time between now and the last reset() call (or the constructor).
NodeSet & queries()
Returns the set of queried nodes given all the matches of pattern.
List< NodeSet > partial_order
Partial order used for triangulation, first is outputs nodes, second query nodes. ...
Set< Potential< GUM_SCALAR > *> __trash
Keeping track of create potentials to delete them after inference.
PRMAttribute< GUM_SCALAR > & get(NodeId id)
Getter on an PRMAttribute<GUM_SCALAR> of this PRMInstance<GUM_SCALAR>.
const T1 & first(const T2 &second) const
Returns the first value of a pair given its second value.
const std::string & name() const
Returns the name of this object.
virtual GUM_SCALAR get(const Instantiation &i) const final
Default implementation of MultiDimContainer::get().
GSpan< GUM_SCALAR >::MatchedInstances & matches
A reference over the usable matches of pattern.
Set< NodeId > NodeSet
Some typdefs and define for shortcuts ...
void eraseFirst(const T1 &first)
Erases an association containing the given first element.
std::vector< NodeId > __elim_order
Size size() const noexcept
Returns the size of the sequence.
EMap & evidence(const PRMInstance< GUM_SCALAR > &i)
Returns EMap of evidences over i.
GSpan< GUM_SCALAR > * __gspan
Pointer over th GSpan<GUM_SCALAR> instance used by this class.
An PRMInstance is a Bayesian Network fragment defined by a Class and used in a PRMSystem.
const Potential< GUM_SCALAR > & normalize() const
normalisation of this do nothing if sum is 0
UndiGraph moral_graph
The class moral graph. NodeId matches those in c.
PData * __pdata
The pattern data of the pattern which one of its matches contains the query.
The generic class for storing (ordered) sequences of objects.
virtual void addEdge(const NodeId first, const NodeId second)
insert a new edge into the undirected graph
NodeSet & outputs()
Returns the set of outputs nodes given all the matches of pattern.
PRMClass< GUM_SCALAR > & type()
Returns the type of this instance.
NodeProperty< std::pair< Idx, std::string > > map
To ease translating potentials from one match to another.
bool __mining
Flag which tells to use pattern mining or not.
virtual void erase(const DiscreteVariable &var) final
Removes a var from the variables of the multidimensional matrix.
Set< Potential< GUM_SCALAR > *> * __eliminateObservedNodesInSource(typename StructuredInference::PData &data, const Set< Potential< GUM_SCALAR > * > &pool, const Sequence< PRMInstance< GUM_SCALAR > * > &match, const std::vector< NodeId > &elim_order)
List< NodeSet > * __real_order
A copy of __partial_order without empty sets.
Set< const PRMInstance< GUM_SCALAR > *> instances
The Set of Instances reduces at class level.
Bijection< const DiscreteVariable *, NodeId > var2node
Mapping between DiscreteVariable and NodeId.
void __insertNodeInElimLists(typename StructuredInference::PData &data, const Sequence< PRMInstance< GUM_SCALAR > * > &match, PRMInstance< GUM_SCALAR > *inst, PRMAttribute< GUM_SCALAR > *attr, NodeId id, std::pair< Idx, std::string > &v)
Abstract class representing an element of PRM class.
Private structure to represent data about a Class<GUM_SCALAR>.
void __reduceAloneInstances(RGData &data)
Add the reduced potentials of instances not in any used patterns.
UndiGraph graph
A yet to be triangulated undigraph.
NodeSet & obs()
Returns the set of inner and observed nodes given all the matches of pattern.
std::string __dot
Unreduce the match containing the query.
void erase(const Key &k)
Erases an element from the set.
bool exists(const NodeId id) const
alias for existsNode
Base class for discrete random variable.
Generic doubly linked lists.
Copyright 2005-2020 Pierre-Henri WUILLEMIN () et Christophe GONZALES () info_at_agrum_dot_org.
NodeSet & outputs()
Returns the set of outputs nodes.
bool __found_query
Flag with an explicit name.
iterator begin() const
The usual unsafe begin iterator to parse the set.
void __addEdgesInReducedGraph(RGData &data)
Add the nodes in the reduced graph.
PRM< GUM_SCALAR > const * _prm
The PRM<GUM_SCALAR> on which inference is done.
virtual NodeId addNode()
insert a new node and return its id
const gspan::Pattern & pattern
The pattern for which this represents data about it.
Size size() const
Returns the number of attributes in this PRMInstance<GUM_SCALAR>.
NodeSet & queries()
Returns the set of query nodes (which will not be eliminated).
StructuredInference & operator=(const StructuredInference &source)
Copy operator.
NodeProperty< Potential< GUM_SCALAR > *> pots
To handle barren nodes.
void __buildReduceGraph(RGData &data)
This calls __reducePattern() over each pattern and then build the reduced graph which is used for inf...
const NodeSet & neighbours(const NodeId id) const
returns the set of edges adjacent to a given node
virtual void eraseNode(const NodeId id)
remove a node and its adjacent edges from the graph
std::vector< std::pair< PRMInstance< GUM_SCALAR > *, std::string > > & getRefAttr(NodeId id)
Returns a vector of pairs of refering attributes of id.
NodeSet & outputs()
Returns the set of outputs nodes (which will be eliminated).
Representation of a setA Set is a structure that contains arbitrary elements.
const std::string & safeName() const
Returns the safe name of this PRMClassElement, if any.
void reset()
Reset the timer.
bool existsFirst(const T1 &first) const
Returns true if first is the first element in a pair in the gum::Bijection.
bool exists(const Key &k) const
Indicates whether a given elements belong to the set.
void __removeBarrenNodes(typename StructuredInference::PData &data, Set< Potential< GUM_SCALAR > * > &pool)
void erase(Size i)
Erases the ith element of the List (the first one is in position 0).
HashTable< const Sequence< PRMInstance< GUM_SCALAR > *> *, Set< Potential< GUM_SCALAR > *> *> __elim_map
Mapping between a Pattern's match and its potential pool after inner variables were eliminated...
RGData()
Default constructor.
<agrum/PRM/structuredInference.h>
Bijection< NodeId, const DiscreteVariable *> vars
Bijection between graph's nodes and their corresponding DiscreteVariable, for inference purpose...
Private structure to represent data about a pattern.
class for graph triangulations for which we enforce a given partial ordering on the nodes elimination...
PRMInference< GUM_SCALAR >::Chain __query
The query.
void inc()
Operator increment.
StructuredInference(const PRM< GUM_SCALAR > &prm, const PRMSystem< GUM_SCALAR > &system, gspan::SearchStrategy< GUM_SCALAR > *strategy=0)
Default constructor.
Set< Potential< GUM_SCALAR > *> pool
The potential pool obtained by C elimination of inner nodes.
Size size() const noexcept
Returns the number of elements in the list.
const Bijection< const DiscreteVariable *, const DiscreteVariable *> & bijection() const
Returns a mapping between DiscreteVariable used in this and the ones used in this PRMInstance<GUM_SCA...
Set< const PRMInstance< GUM_SCALAR > *> __reducedInstances
This keeps track of reduced instances.
const std::vector< NodeId > & eliminationOrder()
returns an elimination ordering compatible with the triangulated graph
Set< NodeId > barren
Set of barren nodes.
const NodeGraphPart & nodes() const
return *this as a NodeGraphPart
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
Base class for all aGrUM's exceptions.
virtual std::string name() const
Tells this algorithm to use pattern mining or not.
Set of pairs of elements with fast search for both elements.
Potential< GUM_SCALAR > * copyPotential(const Bijection< const DiscreteVariable *, const DiscreteVariable * > &bij, const Potential< GUM_SCALAR > &source)
Returns a copy of a Potential after applying a bijection over the variables in source.
List< NodeSet > __partial_order
We'll use a PartialOrderedTriangulation with three sets: output, nodes and obs with children outside ...
void eliminateNode(const DiscreteVariable *var, Set< Potential< GUM_SCALAR > * > &pool, Set< Potential< GUM_SCALAR > * > &trash)
Proceeds with the elimination of var in pool.
NodeSet & inners()
Returns the set of inner nodes.
Set< Potential< GUM_SCALAR > *> * __eliminateObservedNodes(typename StructuredInference::PData &data, const Set< Potential< GUM_SCALAR > * > &pool, const Sequence< PRMInstance< GUM_SCALAR > * > &match, const std::vector< NodeId > &elim_order)
Add in data.queries() any queried variable in one of data.pattern matches.
A PRMSlotChain represents a sequence of gum::prm::PRMClassElement<GUM_SCALAR> where the n-1 first gum...
bool hasEvidence() const
Returns true if i has evidence on PRMAttribute<GUM_SCALAR> a.
PRMSystem< GUM_SCALAR > const * _sys
The Model on which inference is done.
NodeProperty< Size > mod
The pattern's variables modalities.
NodeSet & aggregators()
Returns the set of aggregators and their parents.
Unsafe iterators for the Set class.
std::pair< const PRMInstance< GUM_SCALAR > *, const PRMAttribute< GUM_SCALAR > *> Chain
Code alias.
Set< Potential< GUM_SCALAR > *> * __translatePotSet(typename StructuredInference::PData &data, const Set< Potential< GUM_SCALAR > * > &pool, const Sequence< PRMInstance< GUM_SCALAR > * > &match)
Translate a given Potential Set into one w.r.t. variables in match.
Class for assigning/browsing values to tuples of discrete variables.
virtual void _joint(const std::vector< typename PRMInference< GUM_SCALAR >::Chain > &queries, Potential< GUM_SCALAR > &j)
See PRMInference::_joint().
void erase(const Key &k)
Remove an element from the sequence.
HashTable< const PRMClass< GUM_SCALAR > *, std::vector< NodeId > *> __outputs
std::string __str(const PRMInstance< GUM_SCALAR > *i, const PRMAttribute< GUM_SCALAR > *a) const
Val & insert(const Val &val)
Inserts a new element at the end of the chained list (alias of pushBack).
This abstract class is used as base class for all inference class on PRM<GUM_SCALAR>.
bool __allInstanceNoRefAttr(typename StructuredInference::PData &data, std::pair< Idx, std::string > attr)
Private structure to represent data about a reduced graph.
std::vector< NodeId > & elim_order()
The elimination order for nodes of this class.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
const iterator & end()
Returns a reference over the iterator at the end of the list of gum::prm::PRMAttribute<GUM_SCALAR> in...
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
This class discovers pattern in a PRM<GUM_SCALAR>'s PRMSystem<GUM_SCALAR> to speed up structured infe...
std::pair< Idx, std::string > __query_data
virtual void set(const Instantiation &i, const GUM_SCALAR &value) const final
Default implementation of MultiDimContainer::set().
void setFirst()
Assign the first values to the tuple of the Instantiation.
virtual ~StructuredInference()
Destructor.
Size Idx
Type for indexes.
CData(const PRMClass< GUM_SCALAR > &c)
Default constructor.
NodeSet & inners()
Returns the set of inner nodes.
GSpan< GUM_SCALAR > & gspan()
Returns the instance of gspan used to search patterns.
virtual void _evidenceRemoved(const typename PRMInference< GUM_SCALAR >::Chain &chain)
See PRMInference::_evidenceRemoved().
PRMAttribute is a member of a Class in a PRM.
Bijection< NodeId, std::string > node2attr
A bijection to easily keep track between graph and attributes, its of the form instance_name DOT attr...
virtual void _evidenceAdded(const typename PRMInference< GUM_SCALAR >::Chain &chain)
See PRMInference::_evidenceAdded().
std::size_t Size
In aGrUM, hashed values are unsigned long int.
PRMClassElement< GUM_SCALAR > & lastElt()
Returns the last element of the slot chain, typically this is an gum::PRMAttribute or a gum::PRMAggre...
virtual const Sequence< const DiscreteVariable *> & variablesSequence() const final
Returns a const ref to the sequence of DiscreteVariable*.
iterator begin()
Returns an iterator at the begining of the list of gum::prm::PRMAttribute<GUM_SCALAR> in this PRMInst...
Set< Potential< GUM_SCALAR > *> pool
The pool of potentials matching the reduced graph.
Size size() const noexcept
Returns the number of elements in the set.
void setPatternMining(bool b)
Tells this algorithm to use pattern mining or not.
static INLINE bool isAggregate(const PRMClassElement< GUM_SCALAR > &elt)
Return true if obj is of type PRMAggregate.
virtual bool contains(const DiscreteVariable &var) const final
Returns true if var is in *this.
virtual TABLE< GUM_SCALAR > * combine(const Set< const TABLE< GUM_SCALAR > * > &set)
Creates and returns the result of the combination of the tables within set.
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.
Size NodeId
Type for node ids.
NodeProperty< Size > mods
Mapping between NodeId and modalities.
void insert(const Key &k)
Inserts a new element into the set.
const Key & back() const
Returns the last element of the sequence.
const PRMClass< GUM_SCALAR > & c
The class about what this data is about.
#define GUM_ERROR(type, msg)
const Key & atPos(Idx i) const
Returns the object at the pos i.
Set< Potential< GUM_SCALAR > *> __trash
void __removeNode(typename StructuredInference::PData &data, NodeId id, Set< Potential< GUM_SCALAR > * > &pool)
bool end() const
Returns true if the Instantiation reached the end.
Potential< GUM_SCALAR > * multPotential(const Potential< GUM_SCALAR > &t1, const Potential< GUM_SCALAR > &t2)
void searchPatterns()
Search for patterns without doing any computations.
void insert(const Key &k)
Insert an element at the end of the sequence.