aGrUM  0.16.0
multiDimFunctionGraphOperator.h
Go to the documentation of this file.
1 
31 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_OPERATOR_H
32 #define GUM_MULTI_DIM_FUNCTION_GRAPH_OPERATOR_H
33 
34 #include <functional>
35 
39 
40 namespace gum {
41 
42  // clang-format off
50  // clang-format on
51  template < typename GUM_SCALAR,
52  template < typename >
53  class FUNCTOR,
54  template < typename > class TerminalNodePolicy =
55  ExactTerminalNodePolicy >
57  public:
58  // ============================================================================
60  // ============================================================================
62 
69 
74 
76  // ============================================================================
78  // ============================================================================
80 
86 
88 
89  Idx nbCall();
90  Idx nbVarRetro();
92 
93  private:
97 
100  void __establishVarOrder();
101 
105  const DiscreteVariable*,
106  const DiscreteVariable*);
107 
112  HashTable< NodeId, short int* >& dgInstNeed);
113 
115  NodeId __compute(O4DGContext& currentSituation, Idx lastInstVarPos);
116 
119 
122 
125 
128 
130  const FUNCTOR< GUM_SCALAR > __function;
131 
135 
139 
143 
145  short int* __default;
146  };
147 
148 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
150 #endif
151 
152 } // namespace gum
153 
155 
156 #endif // GUM_MULTI_DIM_FUNCTION_GRAPH_OPERATOR_H
void __findRetrogradeVariables(const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *dg, HashTable< NodeId, short int * > &dgInstNeed)
Establish for each node in both function graph if it has retrograde variables beneath it...
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * compute()
Computes and builds the Function Graph that is the result of the operation.
MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __rd
The resulting function graph.
short int * __default
Just a comptuationnal trick.
HashTable< NodeId, short int *> __DG1InstantiationNeeded
Table uses to know if a given node of first function graph has retrograde vrariables.
Idx __nbVar
The total number of variable implied in the operation.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Idx __distance(const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *, const DiscreteVariable *, const DiscreteVariable *)
Heuristic methods to decide which of two retrograde variables should come first.
HashTable< double, NodeId > __explorationTable
The hashtable used to know if two pair of nodes have already been visited.
HashTable< NodeId, short int *> __DG2InstantiationNeeded
Table uses to know if a given node of second function graph has retrograde vrariables.
Class implementingting a function graph.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Class used to perform Function Graph Operations.
const FUNCTOR< GUM_SCALAR > __function
The function to be performed on the leaves.
const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __DG1
One of the two function graphs used for the operation.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
MultiDimFunctionGraphOperator(const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *DG1, const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *DG2)
Default constructor.
Size Idx
Type for indexes.
Definition: types.h:53
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.
void __establishVarOrder()
Computes an order for the final Decision graph that will minimize the number of re exploration...
Size NodeId
Type for node ids.
Definition: graphElements.h:98
NodeId __compute(O4DGContext &currentSituation, Idx lastInstVarPos)
The main recursion function.
const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __DG2
The other one.