aGrUM  0.16.0
o4DGContext.h
Go to the documentation of this file.
1 
31 #ifndef O4DGCONTEXT_H
32 #define O4DGCONTEXT_H
33 
34 #include <agrum/agrum.h>
35 #include <agrum/core/math/math.h>
37 
38 namespace gum {
39 
40  // clang-format off
48  // clang-format on
49  class O4DGContext {
50  public:
51  // ============================================================================
53  // ============================================================================
55 
59  O4DGContext(Idx*, Idx);
60 
64  ~O4DGContext();
65 
69  void* operator new(size_t s);
70 
74  void operator delete(void* p);
76 
77  // ============================================================================
79  // ============================================================================
80 
83  void setDG1Node(const NodeId&);
84 
86  const NodeId& DG1Node() const { return __DG1ExploredNode; }
87 
89  void setDG2Node(const NodeId&);
90 
92  const NodeId& DG2Node() const { return __DG2ExploredNode; }
94 
95  // ============================================================================
97  // ============================================================================
99 
101  void chgVarModality(Idx, Idx);
102 
105 
107  // ============================================================================
109  // ============================================================================
111 
113  const double& key(short int* instNeeded);
114 
116 
117  private:
120 
123 
128 
130  double __key;
131 
133  static const double __logPrime[];
135  };
136 } // namespace gum
137 
138 #ifndef GUM_NO_INLINE
140 #endif /* GUM_NO_INLINE */
141 
142 #endif // O4DGCONTEXT_H
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
static const Idx __offset1
Definition: o4DGContext.h:134
NodeId __DG2ExploredNode
DG2 Diagram current explored node.
Definition: o4DGContext.h:122
const NodeId & DG2Node() const
Get DG2 diagram current explored Node.
Definition: o4DGContext.h:92
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
const NodeId & DG1Node() const
Get DG1 diagram current explored Node.
Definition: o4DGContext.h:86
void setDG1Node(const NodeId &)
Set DG1 diagram current explored Node.
O4DGContext(Idx *, Idx)
Default constructor.
Definition: o4DGContext.cpp:70
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setDG2Node(const NodeId &)
Set DG2 diagram current explored Node.
~O4DGContext()
Default destructor.
Definition: o4DGContext.cpp:78
Size Idx
Type for indexes.
Definition: types.h:53
static const Idx __nbLogPrime
Definition: o4DGContext.h:134
Idx * __varInstantiation
Vector containing for each retrograde variable its current modality 0 meaning no instantiation done =...
Definition: o4DGContext.h:126
Class used to manipulate context during Function Graph Operations.
Definition: o4DGContext.h:49
static const Idx __offset2
Definition: o4DGContext.h:134
Size NodeId
Type for node ids.
Definition: graphElements.h:98
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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