50#ifndef GUM_MULTI_DIM_FUNCTION_GRAPH_SET_TERMINAL_NODE_POLICY_H
51#define GUM_MULTI_DIM_FUNCTION_GRAPH_SET_TERMINAL_NODE_POLICY_H
68 template <
typename GUM_SCALAR >
81 _map_.insert(n,
new GUM_SCALAR(v));
91 for (
auto nodeIter =
_map_.beginSafe(); nodeIter !=
_map_.endSafe(); ++nodeIter)
92 delete nodeIter.val();
119 for (
auto nodeIter =
_map_.beginSafe(); nodeIter !=
_map_.endSafe(); ++nodeIter)
120 if (*(nodeIter.val()) == v)
return nodeIter.key();
Safe Const Iterators for hashtables.
The class for generic Hash Tables.
Implementation of a Terminal Node Policy that maps nodeid to a set of value.
void clearAllTerminalNodes()
Erase all terminal nodes.
void addTerminalNode(const NodeId &n, const GUM_SCALAR &v)
Insert a new terminal node with given value.
const GUM_SCALAR & terminalNodeValue(const NodeId &n) const
Returns the value of the terminal node that has the given id.
const NodeId & id() const
Returns the id of the current terminal nodes pointed by the constant safe iterator.
HashTable< NodeId, GUM_SCALAR * > _map_
The mapping between NodeIds and Value Sets.
void eraseTerminalNode(const NodeId &n)
Remove node matching given id.
void beginValues() const
Initializes the constant safe iterator on terminal nodes.
HashTableConstIteratorSafe< NodeId, GUM_SCALAR * > _mappy_
The mapping between NodeIds and Value Sets.
const NodeId & terminalNodeId(const GUM_SCALAR &v) const
Returns the id of the terminal node that has the given value.
bool existsTerminalNodeWithValue(const GUM_SCALAR &v) const
Returns true if a terminal node matching this value exists.
const NodeId jocker
The mapping between NodeIds and Value Sets.
bool existsTerminalNodeWithId(const NodeId &n) const
Returns true if a terminal node matching this id exists.
const GUM_SCALAR & value() const
Returns the value of the current terminal nodes pointed by the constant safe iterator.
void nextValue() const
Increments the constant safe iterator.
bool hasValue() const
Indicates if constant safe iterator has reach end of terminal nodes list.
Size NodeId
Type for node ids.
gum is the global namespace for all aGrUM entities
Base node set class for graphs.