49#ifndef DOXYGEN_SHOULD_SKIP_THIS
100 GUM_ERROR(DuplicateLabel,
"Unable to insert var with the name '" << var.name() <<
"'.")
104 GUM_ERROR(DuplicateElement,
"Unable to insert a new variable with id " <<
id <<
".")
145 GUM_ERROR(DuplicateLabel,
"Unable to insert var with the name '" << new_name <<
"'.")
148 auto var =
const_cast< DiscreteVariable*
>(
_nodes2vars_.second(
id));
151 var->setName(new_name);
Base class for discrete random variable.
const DiscreteVariable & variableFromName(const std::string &name) const
bool exists(NodeId id) const
Return true if id matches a node.
void erase(NodeId id)
Removes a var and it's id of this mapping. The pointer is deleted.
Bijection< std::string, NodeId > _names2nodes_
HashTable for easely find an id from a name.
const DiscreteVariable & get(NodeId id) const
Returns a discrete variable given it's node id.
const DiscreteVariable & operator[](NodeId id) const
Returns a discrete variable given it's node id.
NodeId idFromName(const std::string &name) const
const std::string & name(NodeId id) const
Returns the name of a variable given its id.
Bijection< NodeId, const DiscreteVariable * > _nodes2vars_
Bijection between the node's NodeIds and the variables.
Size size() const
give the size
void changeName(NodeId id, const std::string &new_name)
we allow the user to change the name of a variable
NodeId insert(NodeId id, const DiscreteVariable &var)
Maps id with var.
#define GUM_ERROR(type, msg)
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Size NodeId
Type for node ids.
gum is the global namespace for all aGrUM entities
Header of class VariableNodeMap.