![]() |
aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
|
Class used to perform Function Graph Operations. More...
#include <agrum/base/multidim/patterns/multiDimFunctionGraphOperator.h>
Public Member Functions | |
| Idx | nbCall () |
| Idx | nbVarRetro () |
| Idx | sizeVarRetroDomain () |
Constructors / Destructors | |
| MultiDimFunctionGraphOperator (const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *DG1, const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *DG2) | |
| Default constructor. | |
| ~MultiDimFunctionGraphOperator () | |
| 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. | |
| Idx | _distance_ (const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *, const DiscreteVariable *, const DiscreteVariable *) |
| Heuristic methods to decide which of two retrograde variables should come first. | |
| 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 | |
| Idx | _nbCall_ |
| Idx | _nbVarRetro_ |
| Idx | _sizeVarRetro_ |
| 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. | |
| Idx | _nbVar_ |
| The total number of variable implied in the operation. | |
| const FUNCTOR< GUM_SCALAR > | _function_ |
| The function to be performed on the leaves. | |
| 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 first function graph has retrograde vrariables. | |
| HashTable< NodeId, short int * > | _DG2InstantiationNeeded_ |
| Table uses to know if a given node of second function graph has retrograde vrariables. | |
| short int * | _default_ |
| Just a comptuationnal trick. | |
Class used to perform Function Graph Operations.
Definition at line 73 of file multiDimFunctionGraphOperator.h.
| gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::MultiDimFunctionGraphOperator | ( | const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | DG1, |
| const MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * | DG2 ) |
Default constructor.
Definition at line 59 of file multiDimFunctionGraphOperator_tpl.h.
References MultiDimFunctionGraphOperator(), _default_, _DG1_, _DG1InstantiationNeeded_, _DG2_, _DG2InstantiationNeeded_, _function_, _nbCall_, _nbVar_, _rd_, _sizeVarRetro_, and gum::MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >::getReducedAndOrderedInstance().
Referenced by MultiDimFunctionGraphOperator(), and ~MultiDimFunctionGraphOperator().
| gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::~MultiDimFunctionGraphOperator | ( | ) |
Default destructor.
Definition at line 78 of file multiDimFunctionGraphOperator_tpl.h.
References MultiDimFunctionGraphOperator(), _default_, _DG1InstantiationNeeded_, _DG2InstantiationNeeded_, _nbVar_, and SOA_DEALLOCATE.
|
private |
The main recursion function.
Main recursion function, called every time we move on a node to determine what we have to do.
Definition at line 332 of file multiDimFunctionGraphOperator_tpl.h.
References _compute_(), _default_, _DG1_, _DG1InstantiationNeeded_, _DG2_, _DG2InstantiationNeeded_, _explorationTable_, _function_, _nbCall_, _nbVar_, _rd_, gum::O4DGContext::chgVarModality(), gum::O4DGContext::DG1Node(), gum::O4DGContext::DG2Node(), gum::DiscreteVariable::domainSize(), gum::O4DGContext::key(), gum::InternalNode::nodeVar(), gum::O4DGContext::setDG1Node(), gum::O4DGContext::setDG2Node(), SOA_ALLOCATE, SOA_DEALLOCATE, gum::InternalNode::son(), and gum::O4DGContext::varModality().
Referenced by _compute_(), and compute().
|
private |
Heuristic methods to decide which of two retrograde variables should come first.
Definition at line 223 of file multiDimFunctionGraphOperator_tpl.h.
References gum::MultiDimImplementation< GUM_SCALAR >::variablesSequence().
Referenced by _establishVarOrder_().
|
private |
Computes an order for the final Decision graph that will minimize the number of re exploration.
Definition at line 131 of file multiDimFunctionGraphOperator_tpl.h.
References _default_, _DG1_, _DG2_, _distance_(), _nbVar_, _nbVarRetro_, _rd_, _sizeVarRetro_, and SOA_ALLOCATE.
Referenced by compute().
|
private |
Establish for each node in both function graph if it has retrograde variables beneath it.
Definition at line 243 of file multiDimFunctionGraphOperator_tpl.h.
References _nbVar_, _rd_, gum::HashTable< Key, Val >::begin(), gum::HashTable< Key, Val >::clear(), gum::Link< T >::element(), gum::HashTable< Key, Val >::end(), gum::HashTable< Key, Val >::insert(), gum::Link< T >::nextLink(), SOA_ALLOCATE, SOA_DEALLOCATE, and gum::MultiDimImplementation< GUM_SCALAR >::variablesSequence().
Referenced by compute().
| MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::compute | ( | ) |
Computes and builds the Function Graph that is the result of the operation.
Definition at line 102 of file multiDimFunctionGraphOperator_tpl.h.
References _compute_(), _DG1_, _DG1InstantiationNeeded_, _DG2_, _DG2InstantiationNeeded_, _establishVarOrder_(), _findRetrogradeVariables_(), _nbVar_, _rd_, gum::O4DGContext::setDG1Node(), gum::O4DGContext::setDG2Node(), SOA_ALLOCATE, and SOA_DEALLOCATE.
Referenced by gum::MDDOperatorStrategy< GUM_SCALAR >::argmaximize().
| INLINE Idx gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::nbCall | ( | ) |
Definition at line 535 of file multiDimFunctionGraphOperator_tpl.h.
References _nbCall_.
| INLINE Idx gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::nbVarRetro | ( | ) |
Definition at line 543 of file multiDimFunctionGraphOperator_tpl.h.
References _nbVarRetro_.
| INLINE Idx gum::MultiDimFunctionGraphOperator< GUM_SCALAR, FUNCTOR, TerminalNodePolicy >::sizeVarRetroDomain | ( | ) |
Definition at line 550 of file multiDimFunctionGraphOperator_tpl.h.
References _sizeVarRetro_.
|
private |
Just a comptuationnal trick.
Definition at line 162 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), ~MultiDimFunctionGraphOperator(), _compute_(), and _establishVarOrder_().
|
private |
One of the two function graphs used for the operation.
Definition at line 135 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), _compute_(), _establishVarOrder_(), and compute().
|
private |
Table uses to know if a given node of first function graph has retrograde vrariables.
Definition at line 155 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), ~MultiDimFunctionGraphOperator(), _compute_(), and compute().
|
private |
The other one.
Definition at line 138 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), _compute_(), _establishVarOrder_(), and compute().
|
private |
Table uses to know if a given node of second function graph has retrograde vrariables.
Definition at line 159 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), ~MultiDimFunctionGraphOperator(), _compute_(), and compute().
|
private |
The hashtable used to know if two pair of nodes have already been visited.
Definition at line 151 of file multiDimFunctionGraphOperator.h.
Referenced by _compute_().
|
private |
The function to be performed on the leaves.
Definition at line 147 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), and _compute_().
|
private |
Definition at line 111 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), _compute_(), and nbCall().
|
private |
The total number of variable implied in the operation.
Definition at line 144 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), ~MultiDimFunctionGraphOperator(), _compute_(), _establishVarOrder_(), _findRetrogradeVariables_(), and compute().
|
private |
Definition at line 112 of file multiDimFunctionGraphOperator.h.
Referenced by _establishVarOrder_(), and nbVarRetro().
|
private |
The resulting function graph.
Definition at line 141 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), _compute_(), _establishVarOrder_(), _findRetrogradeVariables_(), and compute().
|
private |
Definition at line 113 of file multiDimFunctionGraphOperator.h.
Referenced by MultiDimFunctionGraphOperator(), _establishVarOrder_(), and sizeVarRetroDomain().