![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Class used to perform Function Graph Operations in the FMDP Framework. More...
#include <agrum/base/multidim/patterns/regress.h>
Public Member Functions | |
Constructors / Destructors | |
| Regress (const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *vfunction, const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *probDist, const gum::VariableSet *primedVars, const DiscreteVariable *targetVar, const GUM_SCALAR neutral) | |
| Default constructor. | |
| ~Regress () | |
| Default destructor. | |
Main Method | |
| MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | compute () |
| Computes and builds the Function Graph that is the result of the operation. | |
Private Member Functions | |
| void | _establishVarOrder_ () |
| Computes an order for the final Decision graph that will minimize the number of re exploration. | |
| 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. | |
| NodeId | _compute_ (O4DGContext ¤tSituation, Idx lastInstVarPos) |
| The main recursion function. | |
Private Attributes | |
| const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | _DG1_ |
| One of the two function graphs used for the operation. | |
| const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | _DG2_ |
| The other one. | |
| MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | _rd_ |
| The resulting function graph. | |
| const gum::VariableSet * | _primedVars_ |
| The set of variables we want to keep at the end. | |
| const DiscreteVariable * | _targetVar_ |
| The variable we work on to eleminate. | |
| const GUM_SCALAR | _neutral_ |
| The function to be performed on the leaves. | |
| Idx | _nbVar_ |
| The total number of variable implied in the operation. | |
| const COMBINEOPERATOR< GUM_SCALAR > | _combine_ |
| The functions to be performed on the leaves. | |
| const PROJECTOPERATOR< GUM_SCALAR > | _project_ |
| HashTable< double, NodeId > | _explorationTable_ |
| The hashtable used to know if two pair of nodes have already been visited. | |
| HashTable< NodeId, short int * > | _DG1InstantiationNeeded_ |
| Table uses to know if a given node of given function graph has retrograde variables. | |
| HashTable< NodeId, short int * > | _DG2InstantiationNeeded_ |
| short int * | _default_ |
| Just a computationnal trick. | |
Class used to perform Function Graph Operations in the FMDP Framework.
| INLINE gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::Regress | ( | const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | vfunction, |
| const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | probDist, | ||
| const gum::VariableSet * | primedVars, | ||
| const DiscreteVariable * | targetVar, | ||
| const GUM_SCALAR | neutral ) |
Default constructor.
Definition at line 64 of file regress_tpl.h.
References Regress(), _combine_, _default_, _DG1_, _DG1InstantiationNeeded_, _DG2_, _DG2InstantiationNeeded_, _nbVar_, _neutral_, _primedVars_, _project_, _rd_, _targetVar_, and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::getReducedAndOrderedInstance().
Referenced by Regress(), and ~Regress().
| INLINE gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::~Regress | ( | ) |
Default destructor.
Definition at line 85 of file regress_tpl.h.
References Regress(), _default_, _DG1InstantiationNeeded_, _DG2InstantiationNeeded_, _nbVar_, and DEALLOCATE.
|
private |
The main recursion function.
Definition at line 311 of file regress_tpl.h.
References _combine_, _compute_(), _default_, _DG1_, _DG1InstantiationNeeded_, _DG2_, _DG2InstantiationNeeded_, _explorationTable_, _nbVar_, _neutral_, _project_, _rd_, _targetVar_, ALLOCATE, gum::O4DGContext::chgVarModality(), DEALLOCATE, gum::O4DGContext::DG1Node(), gum::O4DGContext::DG2Node(), gum::DiscreteVariable::domainSize(), gum::O4DGContext::key(), gum::InternalNode::nodeVar(), gum::O4DGContext::setDG1Node(), gum::O4DGContext::setDG2Node(), gum::InternalNode::son(), and gum::O4DGContext::varModality().
Referenced by _compute_(), and compute().
|
private |
Computes an order for the final Decision graph that will minimize the number of re exploration.
Definition at line 141 of file regress_tpl.h.
References _default_, _DG1_, _DG2_, _nbVar_, _primedVars_, _rd_, and ALLOCATE.
Referenced by compute().
|
private |
Establish for each node in both function graph if it has retrograde variables beneath it.
Definition at line 221 of file regress_tpl.h.
References _nbVar_, _rd_, ALLOCATE, gum::HashTable< Key, Val >::begin(), gum::HashTable< Key, Val >::clear(), DEALLOCATE, gum::Link< T >::element(), gum::HashTable< Key, Val >::end(), gum::HashTable< Key, Val >::insert(), gum::Link< T >::nextLink(), and gum::MultiDimImplementation< GUM_SCALAR >::variablesSequence().
Referenced by compute().
| INLINE MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * gum::Regress< GUM_SCALAR, COMBINEOPERATOR, PROJECTOPERATOR, TerminalNodePolicy >::compute | ( | ) |
Computes and builds the Function Graph that is the result of the operation.
Definition at line 108 of file regress_tpl.h.
References _compute_(), _DG1_, _DG1InstantiationNeeded_, _DG2_, _DG2InstantiationNeeded_, _establishVarOrder_(), _findRetrogradeVariables_(), _nbVar_, _rd_, _targetVar_, ALLOCATE, DEALLOCATE, gum::O4DGContext::setDG1Node(), and gum::O4DGContext::setDG2Node().
Referenced by gum::MDDOperatorStrategy< GUM_SCALAR >::regress().
|
private |
The functions to be performed on the leaves.
Definition at line 137 of file regress.h.
Referenced by Regress(), and _compute_().
|
private |
Just a computationnal trick.
Definition at line 150 of file regress.h.
Referenced by Regress(), ~Regress(), _compute_(), and _establishVarOrder_().
|
private |
One of the two function graphs used for the operation.
Definition at line 116 of file regress.h.
Referenced by Regress(), _compute_(), _establishVarOrder_(), and compute().
|
private |
Table uses to know if a given node of given function graph has retrograde variables.
Definition at line 146 of file regress.h.
Referenced by Regress(), ~Regress(), _compute_(), and compute().
|
private |
The other one.
Definition at line 119 of file regress.h.
Referenced by Regress(), _compute_(), _establishVarOrder_(), and compute().
|
private |
Definition at line 147 of file regress.h.
Referenced by Regress(), ~Regress(), _compute_(), and compute().
|
private |
The hashtable used to know if two pair of nodes have already been visited.
Definition at line 142 of file regress.h.
Referenced by _compute_().
|
private |
The total number of variable implied in the operation.
Definition at line 134 of file regress.h.
Referenced by Regress(), ~Regress(), _compute_(), _establishVarOrder_(), _findRetrogradeVariables_(), and compute().
|
private |
The function to be performed on the leaves.
Definition at line 131 of file regress.h.
Referenced by Regress(), and _compute_().
|
private |
The set of variables we want to keep at the end.
Definition at line 125 of file regress.h.
Referenced by Regress(), and _establishVarOrder_().
|
private |
Definition at line 138 of file regress.h.
Referenced by Regress(), and _compute_().
|
private |
The resulting function graph.
Definition at line 122 of file regress.h.
Referenced by Regress(), _compute_(), _establishVarOrder_(), _findRetrogradeVariables_(), and compute().
|
private |
The variable we work on to eleminate.
Definition at line 128 of file regress.h.
Referenced by Regress(), _compute_(), and compute().