28 #ifndef DOXYGEN_SHOULD_SKIP_THIS 30 # include <agrum/tools/graphicalModels/variableNodeMap.h> 35 # include <agrum/tools/graphicalModels/variableNodeMap_inl.h> 41 VariableNodeMap::VariableNodeMap() {
42 GUM_CONSTRUCTOR(VariableNodeMap);
47 VariableNodeMap::VariableNodeMap(
const VariableNodeMap& source) {
48 GUM_CONS_CPY(VariableNodeMap);
54 VariableNodeMap::~VariableNodeMap() {
55 GUM_DESTRUCTOR(VariableNodeMap);
61 VariableNodeMap& VariableNodeMap::operator=(
const VariableNodeMap& source) {
68 void VariableNodeMap::clear() {
69 for (
auto iter = _nodes2vars_.begin(); iter != _nodes2vars_.end(); ++iter)
73 _names2nodes_.clear();
77 std::string VariableNodeMap::toString()
const {
78 std::stringstream stream;
80 stream <<
"list of associations:" << std::endl;
81 stream << _nodes2vars_ << std::endl << std::endl;
82 stream <<
"list of variable names:" << std::endl;
83 stream << _names2nodes_ << std::endl;
89 void VariableNodeMap::_copy_(
const VariableNodeMap& source) {
90 for (
auto iter = source._nodes2vars_.begin(); iter != source._nodes2vars_.end(); ++iter)
91 _nodes2vars_.insert(iter.first(), iter.second()->clone());
95 _names2nodes_ = source._names2nodes_;
99 std::ostream& operator<<(std::ostream& stream,
const VariableNodeMap& v) {
100 stream << v.toString();