51#ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H
52# define GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H
61 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
96 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
356 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
410 template <
typename GUM_SCALAR,
template <
typename >
class TerminalNodePolicy >
Base class for discrete random variable.
void eraseNode(NodeId id, NodeId replacingId=0, bool updateParents=true)
Erases a node from the diagram.
bool _isRedundant_(const DiscreteVariable *var, NodeId *sons)
Checks if node has the same child for every variable value.
NodeId addInternalNode_(const DiscreteVariable *var, NodeId *sons)
Adds an internal node.
MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > * _functionGraph_
The multidimdecisiongraph supposed to be edited.
void _adjacentSwap_(const DiscreteVariable *x, const DiscreteVariable *y)
Swap two adjacent variable.
void reduce_()
Ensures that every isomorphic subgraphs are merged together.
virtual ~MultiDimFunctionGraphManager()
Class destructor.
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 moveTo(const DiscreteVariable *x, Idx desiredPos)
Changes var position in variable sequence.
void clean()
Removes var without nodes in the diagram.
void setRootNode(const NodeId &root)
Sets root node of decision diagram.
void minimizeSize()
Performs a sifting in search of a(local) minimal size.
NodeId addTerminalNode(const GUM_SCALAR &value)
Adds a value to the MultiDimFunctionGraph.
virtual NodeId addInternalNode(const DiscreteVariable *var, NodeId *sons)=0
Inserts a new non terminal node in graph.
virtual void reduce()=0
Ensures that every isomorphic subgraphs are merged together.
MultiDimFunctionGraphManager(MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *master)
Default constructor.
NodeId addInternalNode(const DiscreteVariable *var)
Inserts a new non terminal node in graph.
NodeId _checkIsomorphism_(const DiscreteVariable *var, NodeId *sons)
Checks if a similar node does not already exists in the graph.
void setSon(const NodeId &node, const Idx &modality, const NodeId &sonNode)
Sets nodes son for given modality to designated son node.
NodeId nodeRedundancyCheck_(const DiscreteVariable *var, NodeId *sonsMap)
Check for redundancy.
MultiDimFunctionGraphROManager(MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *master)
virtual void reduce()
Ensures that every isomorphic subgraphs are merged together.
virtual NodeId addInternalNode(const DiscreteVariable *var, NodeId *sons)
Inserts a new non terminal node in graph.
~MultiDimFunctionGraphROManager()
MultiDimFunctionGraphTreeManager(MultiDimFunctionGraph< GUM_SCALAR, TerminalNodePolicy > *master)
Class constructor.
virtual NodeId addInternalNode(const DiscreteVariable *var, NodeId *sons)
Inserts a new non terminal node in graph.
virtual void reduce()
Ensures that every isomorphic subgraphs are merged together.
~MultiDimFunctionGraphTreeManager()
Class destructor.
Class implementingting a function graph.
MultiDimFunctionGraphManager< GUM_SCALAR, TerminalNodePolicy > * manager()
Returns a const reference to the manager of this diagram.
Size Idx
Type for indexes.
Size NodeId
Type for node ids.
Headers of the InternalNode class.
Template methods of gum::MultiDimFunctionGraphManager.
gum is the global namespace for all aGrUM entities
Base node set class for graphs.