51#ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H
52# define GUM_MULTI_DIM_FUNCTION_GRAPH_MANAGER_H
61 template <
typename GUM_ELEMENT,
template <
typename >
class TerminalNodePolicy >
96 template <
typename GUM_ELEMENT,
template <
typename >
class TerminalNodePolicy >
356 template <
typename GUM_ELEMENT,
template <
typename >
class TerminalNodePolicy >
410 template <
typename GUM_ELEMENT,
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.
NodeId addInternalNode(const DiscreteVariable *var)
Inserts a new non terminal node in graph.
void clean()
Removes var without nodes in the diagram.
virtual void reduce()=0
Ensures that every isomorphic subgraphs are merged together.
NodeId nodeRedundancyCheck_(const DiscreteVariable *var, NodeId *sonsMap)
Check for redundancy.
bool _isRedundant_(const DiscreteVariable *var, NodeId *sons)
Checks if node has the same child for every variable value.
void _adjacentSwap_(const DiscreteVariable *x, const DiscreteVariable *y)
Swap two adjacent variable.
void reduce_()
Ensures that every isomorphic subgraphs are merged together.
void moveTo(const DiscreteVariable *x, Idx desiredPos)
Changes var position in variable sequence.
virtual NodeId addInternalNode(const DiscreteVariable *var, NodeId *sons)=0
Inserts a new non terminal node in graph.
void setRootNode(const NodeId &root)
Sets root node of decision diagram.
NodeId addTerminalNode(const GUM_ELEMENT &value)
Adds a value to the MultiDimFunctionGraph.
void minimizeSize()
Performs a sifting in search of a(local) minimal size.
NodeId addInternalNode_(const DiscreteVariable *var, NodeId *sons)
Adds an internal node.
MultiDimFunctionGraphManager(MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy > *master)
Default constructor.
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...
virtual ~MultiDimFunctionGraphManager()
Class destructor.
NodeId _checkIsomorphism_(const DiscreteVariable *var, NodeId *sons)
Checks if a similar node does not already exists in the graph.
MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy > * _functionGraph_
The multidimdecisiongraph supposed to be edited.
void setSon(const NodeId &node, const Idx &modality, const NodeId &sonNode)
Sets nodes son for given modality to designated son node.
~MultiDimFunctionGraphROManager() override
MultiDimFunctionGraphROManager(MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy > *master)
void reduce() override
Ensures that every isomorphic subgraphs are merged together.
NodeId addInternalNode(const DiscreteVariable *var, NodeId *sons) override
Inserts a new non terminal node in graph.
NodeId addInternalNode(const DiscreteVariable *var, NodeId *sons) override
Inserts a new non terminal node in graph.
void reduce() override
Ensures that every isomorphic subgraphs are merged together.
MultiDimFunctionGraphTreeManager(MultiDimFunctionGraph< GUM_ELEMENT, TerminalNodePolicy > *master)
Class constructor.
~MultiDimFunctionGraphTreeManager() override
Class destructor.
Class implementingting a function graph.
MultiDimFunctionGraphManager< GUM_ELEMENT, 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.