31 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H 32 # define GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H 41 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
42 class MultiDimFunctionGraph;
76 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
77 class MultiDimFunctionGraphManager {
89 friend MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >*
100 MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >* master);
218 void moveTo(
const DiscreteVariable* x,
Idx desiredPos);
231 void __adjacentSwap(
const DiscreteVariable* x,
const DiscreteVariable* y);
295 virtual void reduce() = 0;
335 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
389 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
425 #endif // GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void setSon(const NodeId &node, const Idx &modality, const NodeId &sonNode)
Sets nodes son for given modality to designated son node.
void clean()
Removes var without nodes in the diagram.
void __adjacentSwap(const DiscreteVariable *x, const DiscreteVariable *y)
Swap two adjacent variable.
void setRootNode(const NodeId &root)
Sets root node of decision diagram.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
NodeId addInternalNode(const DiscreteVariable *var)
Inserts a new non terminal node in graph.
Base class for discrete random variable.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void moveTo(const DiscreteVariable *x, Idx desiredPos)
Changes var position in variable sequence.
MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * __functionGraph
The multidimdecisiongraph supposed to be edited.
void eraseNode(NodeId id, NodeId replacingId=0, bool updateParents=true)
Erases a node from the diagram.
Class implementingting a function graph manager.
void _migrateNode(const NodeId &x, const NodeId &y)
Remaps all arcs going to ou going from the first given node to the second node, then delete first nod...
void minimizeSize()
Performs a sifting in search of a(local) minimal size.
MultiDimFunctionGraphManager(MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *master)
Default constructor.
Class implementingting a function graph.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void _reduce()
Ensures that every isomorphic subgraphs are merged together.
NodeId addTerminalNode(const GUM_SCALAR &value)
Adds a value to the MultiDimFunctionGraph.
MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy > * manager()
Returns a const reference to the manager of this diagram.
bool __isRedundant(const DiscreteVariable *var, NodeId *sons)
Checks if node has the same child for every variable value.
NodeId _nodeRedundancyCheck(const DiscreteVariable *var, NodeId *sonsMap)
Check for redundancy.
NodeId _addInternalNode(const DiscreteVariable *var, NodeId *sons)
Adds an internal node.
virtual void reduce()=0
Ensures that every isomorphic subgraphs are merged together.
virtual ~MultiDimFunctionGraphManager()
Class destructor.
Size NodeId
Type for node ids.
NodeId __checkIsomorphism(const DiscreteVariable *var, NodeId *sons)
Checks if a similar node does not already exists in the graph.