28 #ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H 29 # define GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H 38 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
39 class MultiDimFunctionGraph;
73 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
74 class MultiDimFunctionGraphManager {
86 friend MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy >*
97 MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy >* master);
215 void moveTo(
const DiscreteVariable* x,
Idx desiredPos);
228 void __adjacentSwap(
const DiscreteVariable* x,
const DiscreteVariable* y);
292 virtual void reduce() = 0;
332 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
386 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
422 #endif // GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H Base node set class for graphs.
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.
Template methods of gum::MultiDimFunctionGraphManager.
Headers of the InternalNode class.
NodeId addInternalNode(const DiscreteVariable *var)
Inserts a new non terminal node in graph.
Base class for discrete random variable.
gum is the global namespace for all aGrUM entities
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.
Headers of MultiDimFunctionGraph.
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.