Changes in lemon/bits/vector_map.h [664:4137ef9aacc6:314:2cc60866a0c9] in lemon
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/bits/vector_map.h
r664 r314 3 3 * This file is a part of LEMON, a generic C++ optimization library. 4 4 * 5 * Copyright (C) 2003-200 95 * Copyright (C) 2003-2008 6 6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport 7 7 * (Egervary Research Group on Combinatorial Optimization, EGRES). … … 39 39 // \brief Graph map based on the std::vector storage. 40 40 // 41 // The VectorMap template class is graph map structure that automatically42 // updates the map when a key is added to or erased from the graph.43 // This map type usesstd::vector to store the values.41 // The VectorMap template class is graph map structure what 42 // automatically updates the map when a key is added to or erased from 43 // the map. This map type uses the std::vector to store the values. 44 44 // 45 45 // \tparam _Graph The graph this map is attached to. … … 57 57 58 58 // The graph type of the map. 59 typedef _Graph Graph Type;59 typedef _Graph Graph; 60 60 // The item type of the map. 61 61 typedef _Item Item; … … 73 73 // The map type. 74 74 typedef VectorMap Map; 75 // The base class of the map. 76 typedef typename Notifier::ObserverBase Parent; 75 77 76 78 // The reference type of the map; … … 79 81 typedef typename Container::const_reference ConstReference; 80 82 81 private:82 83 // The base class of the map.84 typedef typename Notifier::ObserverBase Parent;85 86 public:87 83 88 84 // \brief Constructor to attach the new map into the notifier. … … 90 86 // It constructs a map and attachs it into the notifier. 91 87 // It adds all the items of the graph to the map. 92 VectorMap(const Graph Type& graph) {88 VectorMap(const Graph& graph) { 93 89 Parent::attach(graph.notifier(Item())); 94 90 container.resize(Parent::notifier()->maxId() + 1); … … 99 95 // It constructs a map uses a given value to initialize the map. 100 96 // It adds all the items of the graph to the map. 101 VectorMap(const Graph Type& graph, const Value& value) {97 VectorMap(const Graph& graph, const Value& value) { 102 98 Parent::attach(graph.notifier(Item())); 103 99 container.resize(Parent::notifier()->maxId() + 1, value); … … 129 125 // \brief Template assign operator. 130 126 // 131 // The given parameter should conform to the ReadMap127 // The given parameter should be conform to the ReadMap 132 128 // concecpt and could be indiced by the current item set of 133 129 // the NodeMap. In this case the value for each item … … 174 170 // \brief Adds a new key to the map. 175 171 // 176 // It adds a new key to the map. It iscalled by the observer notifier172 // It adds a new key to the map. It called by the observer notifier 177 173 // and it overrides the add() member function of the observer base. 178 174 virtual void add(const Key& key) { … … 185 181 // \brief Adds more new keys to the map. 186 182 // 187 // It adds more new keys to the map. It iscalled by the observer notifier183 // It adds more new keys to the map. It called by the observer notifier 188 184 // and it overrides the add() member function of the observer base. 189 185 virtual void add(const std::vector<Key>& keys) { … … 200 196 // \brief Erase a key from the map. 201 197 // 202 // Erase a key from the map. It iscalled by the observer notifier198 // Erase a key from the map. It called by the observer notifier 203 199 // and it overrides the erase() member function of the observer base. 204 200 virtual void erase(const Key& key) { … … 208 204 // \brief Erase more keys from the map. 209 205 // 210 // It erases more keys from the map. It iscalled by the observer notifier206 // Erase more keys from the map. It called by the observer notifier 211 207 // and it overrides the erase() member function of the observer base. 212 208 virtual void erase(const std::vector<Key>& keys) { … … 216 212 } 217 213 218 // \brief Build the map.219 // 220 // It build s the map. It iscalled by the observer notifier214 // \brief Buildes the map. 215 // 216 // It buildes the map. It called by the observer notifier 221 217 // and it overrides the build() member function of the observer base. 222 218 virtual void build() { … … 228 224 // \brief Clear the map. 229 225 // 230 // It erase s all items from the map. It iscalled by the observer notifier226 // It erase all items from the map. It called by the observer notifier 231 227 // and it overrides the clear() member function of the observer base. 232 228 virtual void clear() {
Note: See TracChangeset
for help on using the changeset viewer.