aGrUM  0.16.0
regress.h
Go to the documentation of this file.
1 
31 #ifndef GUM_REGRESS_H
32 #define GUM_REGRESS_H
33 
37 
38 namespace gum {
39 
47  template < typename GUM_SCALAR,
48  template < typename >
49  class COMBINEOPERATOR,
50  template < typename >
51  class PROJECTOPERATOR,
52  template < typename > class TerminalNodePolicy =
53  ExactTerminalNodePolicy >
54  class Regress {
55  public:
56  // ============================================================================
58  // ============================================================================
60 
62  Regress(
65  const Set< const DiscreteVariable* >* primedVars,
66  const DiscreteVariable* targetVar,
67  const GUM_SCALAR neutral);
68 
70  ~Regress();
71 
73 
74  // ============================================================================
76  // ============================================================================
78 
82 
84 
85  private:
89  void __establishVarOrder();
90 
97 
99  NodeId __compute(O4DGContext& currentSituation, Idx lastInstVarPos);
100 
103 
106 
109 
112 
115 
117  const GUM_SCALAR __neutral;
118 
121 
123  const COMBINEOPERATOR< GUM_SCALAR > __combine;
124  const PROJECTOPERATOR< GUM_SCALAR > __project;
125 
129 
134 
136  short int* __default;
137  };
138 
139 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
140  extern template class Regress< double, std::multiplies, std::plus >;
141 #endif
142 
143 } // namespace gum
144 
146 
147 #endif // GUM_REGRESS_H
const PROJECTOPERATOR< GUM_SCALAR > __project
Definition: regress.h:124
MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __rd
The resulting function graph.
Definition: regress.h:108
HashTable< NodeId, short int *> __DG2InstantiationNeeded
Definition: regress.h:133
const DiscreteVariable * __targetVar
The variable we work on to eleminate.
Definition: regress.h:114
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
const GUM_SCALAR __neutral
The function to be performed on the leaves.
Definition: regress.h:117
MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * compute()
Computes and builds the Function Graph that is the result of the operation.
Definition: regress_tpl.h:104
const COMBINEOPERATOR< GUM_SCALAR > __combine
The functions to be performed on the leaves.
Definition: regress.h:123
HashTable< NodeId, short int *> __DG1InstantiationNeeded
Table uses to know if a given node of given function graph has retrograde variables.
Definition: regress.h:132
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
const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __DG2
The other one.
Definition: regress.h:105
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:165
Regress(const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *vfunction, const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *probDist, const Set< const DiscreteVariable * > *primedVars, const DiscreteVariable *targetVar, const GUM_SCALAR neutral)
Default constructor.
Definition: regress_tpl.h:48
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...
Definition: regress_tpl.h:142
Class implementingting a function graph.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
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...
Definition: regress_tpl.h:230
NodeId __compute(O4DGContext &currentSituation, Idx lastInstVarPos)
The main recursion function.
Definition: regress_tpl.h:328
Idx __nbVar
The total number of variable implied in the operation.
Definition: regress.h:120
Class used to perform Function Graph Operations in the FMDP Framework.
Definition: regress.h:54
const Set< const DiscreteVariable *> * __primedVars
The set of variables we want to keep at the end.
Definition: regress.h:111
HashTable< double, NodeId > __explorationTable
The hashtable used to know if two pair of nodes have already been visited.
Definition: regress.h:128
Size Idx
Type for indexes.
Definition: types.h:53
short int * __default
Just a computationnal trick.
Definition: regress.h:136
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.
const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __DG1
One of the two function graphs used for the operation.
Definition: regress.h:102
Size NodeId
Type for node ids.
Definition: graphElements.h:98
~Regress()
Default destructor.
Definition: regress_tpl.h:76