30 #ifndef GUM_FUSION_CONTEXT_H 31 #define GUM_FUSION_CONTEXT_H 33 #include <agrum/tools/core/multiPriorityQueue.h> 35 #include <agrum/tools/graphs/graphElements.h> 37 #include <agrum/FMDP/learning/core/templateStrategy.h> 38 #include <agrum/FMDP/learning/datastructure/leaves/abstractLeaf.h> 39 #include <agrum/FMDP/learning/datastructure/leaves/leafPair.h> 56 template <
bool isInitial =
false >
78 return SmallObjectAllocator::instance().allocate(s);
81 SmallObjectAllocator::instance().deallocate(p,
sizeof(FusionContext));
96 return containsAssociatedLeaf__(l, Int2Type< isInitial >());
101 return leaf2Pair__.exists(l);
112 return associateLeaf__(l, Int2Type< isInitial >());
125 return updateAssociatedLeaf__(l, Int2Type< isInitial >());
134 return updateAllAssociatedLeaves__(Int2Type< isInitial >());
149 return deassociateLeaf__(l, Int2Type< isInitial >());
193 LeafPair*
top() {
return !pairsHeap__.empty() ? pairsHeap__.top() :
nullptr; }
199 return !pairsHeap__.empty() ? pairsHeap__.topPriority() : 1.0;
218 return leaf2Pair__.getWithDefault(l,
nullptr);
226 return associatedPairs__(Int2Type< isInitial >());
232 return Set< LeafPair* >();
250 #include <agrum/FMDP/learning/datastructure/leaves/fusionContext_tpl.h> void operator delete(void *p)
Default constructor.
INLINE void emplace(Args &&... args)
MultiPriorityQueue< LeafPair *, double, std::less< double > > pairsHeap__
bool removePair(LeafPair *p)
void * operator new(size_t s)
Allocators and Deallocators redefinition.
Set< LeafPair *> associatedPairs__(Int2Type< true >)
LeafPair * leafAssociatedPair(AbstractLeaf *l)
Set< LeafPair *> associatedPairs()
FusionContext(AbstractLeaf *)
Default constructor.
bool updateAssociatedLeaf__(AbstractLeaf *, Int2Type< true >)
bool addPair(LeafPair *p)
bool updateAllAssociatedLeaves__(Int2Type< true >)
bool deassociateLeaf(AbstractLeaf *l)
bool containsAssociatedLeaf__(AbstractLeaf *, Int2Type< true >)
bool containsAssociatedLeaf(AbstractLeaf *l)
bool updateAllAssociatedLeaves()
~FusionContext()
Default destructor.
bool associateLeaf(AbstractLeaf *l)
HashTable< AbstractLeaf *, LeafPair *> leaf2Pair__
bool associateLeaf__(AbstractLeaf *, Int2Type< true >)
bool updateAssociatedLeaf(AbstractLeaf *l)
bool deassociateLeaf__(AbstractLeaf *, Int2Type< true >)
bool updatePair(LeafPair *p)
pair_iterator beginPairs()