aGrUM  0.16.0
o4DGContext_inl.h
Go to the documentation of this file.
1 
32 
33 namespace gum {
34 
35  // Set DG1 diagram current explored Node
36  INLINE void O4DGContext::setDG1Node(const NodeId& exploredNode) {
37  __DG1ExploredNode = exploredNode;
38  }
39 
40  // Set DG2 diagram current explored Node
41  INLINE void O4DGContext::setDG2Node(const NodeId& exploredNode) {
42  __DG2ExploredNode = exploredNode;
43  }
44 
45  // Changes given variable modality
46  INLINE void O4DGContext::chgVarModality(Idx varIndex, Idx newModality) {
47  __varInstantiation[varIndex] = newModality;
48  }
49 
50  // Changes given variable modality
51  INLINE Idx O4DGContext::varModality(Idx varIndex) {
52  return __varInstantiation[varIndex];
53  }
54 
55  // Returns o4DGContext key
56  INLINE const double& O4DGContext::key(short int* instNeeded) {
59 
60  for (Idx varPos = 0, offset = __offsetv; varPos < __nbVar; varPos++, offset--)
61  if (instNeeded[varPos])
62  __key += __varInstantiation[varPos] * __logPrime[offset];
63 
64  return __key;
65  }
66 
67  INLINE void* O4DGContext::operator new(size_t s) {
69  }
70 
71  INLINE void O4DGContext::operator delete(void* p) {
73  }
75 
76 
77 } /* end of namespace gum */
static const Idx __offset1
Definition: o4DGContext.h:134
NodeId __DG2ExploredNode
DG2 Diagram current explored node.
Definition: o4DGContext.h:122
static const double __logPrime[]
Table containing the log2 of prime numbers.
Definition: o4DGContext.h:133
double __key
The key use to store the context as a key in the hashtable.
Definition: o4DGContext.h:130
const double & key(short int *instNeeded)
Returns o4DGContext key.
void chgVarModality(Idx, Idx)
Changes given variable modality.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
void setDG1Node(const NodeId &)
Set DG1 diagram current explored Node.
void deallocate(void *pDeallocatedObject, const size_t &objectSize)
Deallocates an object.
void setDG2Node(const NodeId &)
Set DG2 diagram current explored Node.
Size Idx
Type for indexes.
Definition: types.h:53
void * allocate(const size_t &objectSize)
Allocates a block.
Idx * __varInstantiation
Vector containing for each retrograde variable its current modality 0 meaning no instantiation done =...
Definition: o4DGContext.h:126
static SmallObjectAllocator & instance()
Class used to manipulate context during Function Graph Operations.
Definition: o4DGContext.h:49
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
static const Idx __offset2
Definition: o4DGContext.h:134
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Idx varModality(Idx)
Changes given variable modality.
NodeId __DG1ExploredNode
DG1 Diagram current explored node.
Definition: o4DGContext.h:119
static const Idx __offsetv
Definition: o4DGContext.h:134