1.1 --- a/lemon/maps.h Tue Feb 05 11:24:32 2008 +0000
1.2 +++ b/lemon/maps.h Tue Feb 05 12:41:05 2008 +0000
1.3 @@ -44,17 +44,18 @@
1.4 template<typename K, typename T>
1.5 class MapBase {
1.6 public:
1.7 - ///\e
1.8 + /// The key type of the map.
1.9 typedef K Key;
1.10 - ///\e
1.11 + /// The value type of the map. (The type of objects associated with the keys).
1.12 typedef T Value;
1.13 };
1.14
1.15 /// Null map. (a.k.a. DoNothingMap)
1.16
1.17 - /// If you have to provide a map only for its type definitions,
1.18 - /// or if you have to provide a writable map, but
1.19 - /// data written to it will sent to <tt>/dev/null</tt>...
1.20 + /// This map can be used if you have to provide a map only for
1.21 + /// its type definitions, or if you have to provide a writable map,
1.22 + /// but data written to it is not required (i.e. it will be sent to
1.23 + /// <tt>/dev/null</tt>).
1.24 template<typename K, typename T>
1.25 class NullMap : public MapBase<K, T> {
1.26 public:
1.27 @@ -68,6 +69,10 @@
1.28 void set(const K&, const T&) {}
1.29 };
1.30
1.31 + ///Returns a \c NullMap class
1.32 +
1.33 + ///This function just returns a \c NullMap class.
1.34 + ///\relates NullMap
1.35 template <typename K, typename V>
1.36 NullMap<K, V> nullMap() {
1.37 return NullMap<K, V>();
1.38 @@ -76,8 +81,9 @@
1.39
1.40 /// Constant map.
1.41
1.42 - /// This is a readable map which assigns a specified value to each key.
1.43 - /// In other aspects it is equivalent to the \c NullMap.
1.44 + /// This is a \ref concepts::ReadMap "readable" map which assigns a
1.45 + /// specified value to each key.
1.46 + /// In other aspects it is equivalent to \c NullMap.
1.47 template<typename K, typename T>
1.48 class ConstMap : public MapBase<K, T> {
1.49 private:
1.50 @@ -90,13 +96,15 @@
1.51
1.52 /// Default constructor
1.53
1.54 + /// Default constructor.
1.55 /// The value of the map will be uninitialized.
1.56 /// (More exactly it will be default constructed.)
1.57 ConstMap() {}
1.58 - ///\e
1.59 +
1.60 + /// Constructor with specified initial value
1.61
1.62 - /// \param _v The initial value of the map.
1.63 - ///
1.64 + /// Constructor with specified initial value.
1.65 + /// \param _v is the initial value of the map.
1.66 ConstMap(const T &_v) : v(_v) {}
1.67
1.68 ///\e
1.69 @@ -131,8 +139,9 @@
1.70
1.71 /// Constant map with inlined constant value.
1.72
1.73 - /// This is a readable map which assigns a specified value to each key.
1.74 - /// In other aspects it is equivalent to the \c NullMap.
1.75 + /// This is a \ref concepts::ReadMap "readable" map which assigns a
1.76 + /// specified value to each key.
1.77 + /// In other aspects it is equivalent to \c NullMap.
1.78 template<typename K, typename V, V v>
1.79 class ConstMap<K, Const<V, v> > : public MapBase<K, V> {
1.80 public:
1.81 @@ -147,7 +156,7 @@
1.82 void set(const K&, const V&) { }
1.83 };
1.84
1.85 - ///Returns a \c ConstMap class
1.86 + ///Returns a \c ConstMap class with inlined value
1.87
1.88 ///This function just returns a \c ConstMap class with inlined value.
1.89 ///\relates ConstMap
1.90 @@ -156,25 +165,28 @@
1.91 return ConstMap<K, Const<V, v> >();
1.92 }
1.93
1.94 - ///Map based on std::map
1.95 + ///Map based on \c std::map
1.96
1.97 - ///This is essentially a wrapper for \c std::map. With addition that
1.98 + ///This is essentially a wrapper for \c std::map with addition that
1.99 ///you can specify a default value different from \c Value() .
1.100 + ///It meets the \ref concepts::ReferenceMap "ReferenceMap" concept.
1.101 template <typename K, typename T, typename Compare = std::less<K> >
1.102 - class StdMap {
1.103 + class StdMap : public MapBase<K, T> {
1.104 template <typename K1, typename T1, typename C1>
1.105 friend class StdMap;
1.106 public:
1.107
1.108 + typedef MapBase<K, T> Parent;
1.109 + ///Key type
1.110 + typedef typename Parent::Key Key;
1.111 + ///Value type
1.112 + typedef typename Parent::Value Value;
1.113 + ///Reference Type
1.114 + typedef T& Reference;
1.115 + ///Const reference type
1.116 + typedef const T& ConstReference;
1.117 +
1.118 typedef True ReferenceMapTag;
1.119 - ///\e
1.120 - typedef K Key;
1.121 - ///\e
1.122 - typedef T Value;
1.123 - ///\e
1.124 - typedef T& Reference;
1.125 - ///\e
1.126 - typedef const T& ConstReference;
1.127
1.128 private:
1.129
1.130 @@ -186,13 +198,13 @@
1.131
1.132 /// Constructor with specified default value
1.133 StdMap(const T& value = T()) : _value(value) {}
1.134 - /// \brief Constructs the map from an appropriate std::map, and explicitly
1.135 - /// specifies a default value.
1.136 + /// \brief Constructs the map from an appropriate \c std::map, and
1.137 + /// explicitly specifies a default value.
1.138 template <typename T1, typename Comp1>
1.139 StdMap(const std::map<Key, T1, Comp1> &map, const T& value = T())
1.140 : _map(map.begin(), map.end()), _value(value) {}
1.141
1.142 - /// \brief Constructs a map from an other StdMap.
1.143 + /// \brief Constructs a map from an other \ref StdMap.
1.144 template<typename T1, typename Comp1>
1.145 StdMap(const StdMap<Key, T1, Comp1> &c)
1.146 : _map(c._map.begin(), c._map.end()), _value(c._value) {}
1.147 @@ -242,30 +254,58 @@
1.148 };
1.149 };
1.150
1.151 - /// \brief Map for storing values for the range \c [0..size-1] range keys
1.152 + ///Returns a \c StdMap class
1.153 +
1.154 + ///This function just returns a \c StdMap class with specified
1.155 + ///default value.
1.156 + ///\relates StdMap
1.157 + template<typename K, typename V, typename Compare>
1.158 + inline StdMap<K, V, Compare> stdMap(const V& value = V()) {
1.159 + return StdMap<K, V, Compare>(value);
1.160 + }
1.161 +
1.162 + template<typename K, typename V>
1.163 + inline StdMap<K, V, std::less<K> > stdMap(const V& value = V()) {
1.164 + return StdMap<K, V, std::less<K> >(value);
1.165 + }
1.166 +
1.167 + ///Returns a \c StdMap class created from an appropriate \c std::map
1.168 +
1.169 + ///This function just returns a \c StdMap class created from an
1.170 + ///appropriate \c std::map.
1.171 + ///\relates StdMap
1.172 + template<typename K, typename V, typename Compare>
1.173 + inline StdMap<K, V, Compare> stdMap( const std::map<K, V, Compare> &map,
1.174 + const V& value = V() ) {
1.175 + return StdMap<K, V, Compare>(map, value);
1.176 + }
1.177 +
1.178 + /// \brief Map for storing values for keys from the range <tt>[0..size-1]</tt>
1.179 ///
1.180 - /// The current map has the \c [0..size-1] keyset and the values
1.181 + /// This map has the <tt>[0..size-1]</tt> keyset and the values
1.182 /// are stored in a \c std::vector<T> container. It can be used with
1.183 /// some data structures, for example \c UnionFind, \c BinHeap, when
1.184 /// the used items are small integer numbers.
1.185 template <typename T>
1.186 - class IntegerMap {
1.187 + class IntegerMap : public MapBase<int, T> {
1.188
1.189 template <typename T1>
1.190 friend class IntegerMap;
1.191
1.192 public:
1.193
1.194 - typedef True ReferenceMapTag;
1.195 + typedef MapBase<int, T> Parent;
1.196 ///\e
1.197 - typedef int Key;
1.198 + typedef typename Parent::Key Key;
1.199 ///\e
1.200 - typedef T Value;
1.201 + typedef typename Parent::Value Value;
1.202 ///\e
1.203 typedef T& Reference;
1.204 ///\e
1.205 typedef const T& ConstReference;
1.206
1.207 + typedef True ReferenceMapTag;
1.208 +
1.209 private:
1.210
1.211 typedef std::vector<T> Vector;
1.212 @@ -276,12 +316,12 @@
1.213 /// Constructor with specified default value
1.214 IntegerMap(int size = 0, const T& value = T()) : _vector(size, value) {}
1.215
1.216 - /// \brief Constructs the map from an appropriate std::vector.
1.217 + /// \brief Constructs the map from an appropriate \c std::vector.
1.218 template <typename T1>
1.219 IntegerMap(const std::vector<T1>& vector)
1.220 : _vector(vector.begin(), vector.end()) {}
1.221
1.222 - /// \brief Constructs a map from an other IntegerMap.
1.223 + /// \brief Constructs a map from an other \ref IntegerMap.
1.224 template <typename T1>
1.225 IntegerMap(const IntegerMap<T1> &c)
1.226 : _vector(c._vector.begin(), c._vector.end()) {}
1.227 @@ -314,14 +354,23 @@
1.228
1.229 };
1.230
1.231 + ///Returns an \c IntegerMap class
1.232 +
1.233 + ///This function just returns an \c IntegerMap class.
1.234 + ///\relates IntegerMap
1.235 + template<typename T>
1.236 + inline IntegerMap<T> integerMap(int size = 0, const T& value = T()) {
1.237 + return IntegerMap<T>(size, value);
1.238 + }
1.239 +
1.240 /// @}
1.241
1.242 /// \addtogroup map_adaptors
1.243 /// @{
1.244
1.245 - /// \brief Identity mapping.
1.246 + /// \brief Identity map.
1.247 ///
1.248 - /// This mapping gives back the given key as value without any
1.249 + /// This map gives back the given key as value without any
1.250 /// modification.
1.251 template <typename T>
1.252 class IdentityMap : public MapBase<T, T> {
1.253 @@ -346,10 +395,11 @@
1.254 }
1.255
1.256
1.257 - ///Convert the \c Value of a map to another type.
1.258 -
1.259 - ///This \c concepts::ReadMap "read only map"
1.260 - ///converts the \c Value of a maps to type \c T.
1.261 + ///\brief Convert the \c Value of a map to another type using
1.262 + ///the default conversion.
1.263 + ///
1.264 + ///This \ref concepts::ReadMap "read only map"
1.265 + ///converts the \c Value of a map to type \c T.
1.266 ///Its \c Key is inherited from \c M.
1.267 template <typename M, typename T>
1.268 class ConvertMap : public MapBase<typename M::Key, T> {
1.269 @@ -365,29 +415,29 @@
1.270 ///\param _m is the underlying map
1.271 ConvertMap(const M &_m) : m(_m) {};
1.272
1.273 - /// \brief The subscript operator.
1.274 - ///
1.275 - /// The subscript operator.
1.276 - /// \param k The key
1.277 - /// \return The target of the edge
1.278 + ///\e
1.279 Value operator[](const Key& k) const {return m[k];}
1.280 };
1.281
1.282 - ///Returns an \c ConvertMap class
1.283 + ///Returns a \c ConvertMap class
1.284
1.285 - ///This function just returns an \c ConvertMap class.
1.286 + ///This function just returns a \c ConvertMap class.
1.287 ///\relates ConvertMap
1.288 template<typename T, typename M>
1.289 inline ConvertMap<M, T> convertMap(const M &m) {
1.290 return ConvertMap<M, T>(m);
1.291 }
1.292
1.293 - ///Simple wrapping of the map
1.294 + ///Simple wrapping of a map
1.295
1.296 - ///This \c concepts::ReadMap "read only map" returns the simple
1.297 + ///This \ref concepts::ReadMap "read only map" returns the simple
1.298 ///wrapping of the given map. Sometimes the reference maps cannot be
1.299 ///combined with simple read maps. This map adaptor wraps the given
1.300 ///map to simple read map.
1.301 + ///
1.302 + ///\sa SimpleWriteMap
1.303 + ///
1.304 + /// \todo Revise the misleading name
1.305 template<typename M>
1.306 class SimpleMap : public MapBase<typename M::Key, typename M::Value> {
1.307 const M& m;
1.308 @@ -403,12 +453,25 @@
1.309 Value operator[](Key k) const {return m[k];}
1.310 };
1.311
1.312 - ///Simple writeable wrapping of the map
1.313 + ///Returns a \c SimpleMap class
1.314
1.315 - ///This \c concepts::ReadMap "read only map" returns the simple
1.316 + ///This function just returns a \c SimpleMap class.
1.317 + ///\relates SimpleMap
1.318 + template<typename M>
1.319 + inline SimpleMap<M> simpleMap(const M &m) {
1.320 + return SimpleMap<M>(m);
1.321 + }
1.322 +
1.323 + ///Simple writable wrapping of a map
1.324 +
1.325 + ///This \ref concepts::ReadWriteMap "read-write map" returns the simple
1.326 ///wrapping of the given map. Sometimes the reference maps cannot be
1.327 ///combined with simple read-write maps. This map adaptor wraps the
1.328 ///given map to simple read-write map.
1.329 + ///
1.330 + ///\sa SimpleMap
1.331 + ///
1.332 + /// \todo Revise the misleading name
1.333 template<typename M>
1.334 class SimpleWriteMap : public MapBase<typename M::Key, typename M::Value> {
1.335 M& m;
1.336 @@ -426,12 +489,21 @@
1.337 void set(Key k, const Value& c) { m.set(k, c); }
1.338 };
1.339
1.340 + ///Returns a \c SimpleWriteMap class
1.341 +
1.342 + ///This function just returns a \c SimpleWriteMap class.
1.343 + ///\relates SimpleWriteMap
1.344 + template<typename M>
1.345 + inline SimpleWriteMap<M> simpleWriteMap(M &m) {
1.346 + return SimpleWriteMap<M>(m);
1.347 + }
1.348 +
1.349 ///Sum of two maps
1.350
1.351 - ///This \c concepts::ReadMap "read only map" returns the sum of the two
1.352 - ///given maps. Its \c Key and \c Value will be inherited from \c M1.
1.353 - ///The \c Key and \c Value of M2 must be convertible to those of \c M1.
1.354 -
1.355 + ///This \ref concepts::ReadMap "read only map" returns the sum of the two
1.356 + ///given maps.
1.357 + ///Its \c Key and \c Value are inherited from \c M1.
1.358 + ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
1.359 template<typename M1, typename M2>
1.360 class AddMap : public MapBase<typename M1::Key, typename M1::Value> {
1.361 const M1& m1;
1.362 @@ -461,7 +533,7 @@
1.363
1.364 ///Shift a map with a constant.
1.365
1.366 - ///This \c concepts::ReadMap "read only map" returns the sum of the
1.367 + ///This \ref concepts::ReadMap "read only map" returns the sum of the
1.368 ///given map and a constant value.
1.369 ///Its \c Key and \c Value is inherited from \c M.
1.370 ///
1.371 @@ -469,11 +541,13 @@
1.372 ///\code
1.373 /// ShiftMap<X> sh(x,v);
1.374 ///\endcode
1.375 - ///is equivalent with
1.376 + ///is equivalent to
1.377 ///\code
1.378 /// ConstMap<X::Key, X::Value> c_tmp(v);
1.379 /// AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v);
1.380 ///\endcode
1.381 + ///
1.382 + ///\sa ShiftWriteMap
1.383 template<typename M, typename C = typename M::Value>
1.384 class ShiftMap : public MapBase<typename M::Key, typename M::Value> {
1.385 const M& m;
1.386 @@ -493,21 +567,13 @@
1.387 Value operator[](Key k) const {return m[k] + v;}
1.388 };
1.389
1.390 - ///Shift a map with a constant.
1.391 + ///Shift a map with a constant (ReadWrite version).
1.392
1.393 - ///This \c concepts::ReadWriteMap "read-write map" returns the sum of the
1.394 + ///This \ref concepts::ReadWriteMap "read-write map" returns the sum of the
1.395 ///given map and a constant value. It makes also possible to write the map.
1.396 - ///Its \c Key and \c Value is inherited from \c M.
1.397 + ///Its \c Key and \c Value are inherited from \c M.
1.398 ///
1.399 - ///Actually,
1.400 - ///\code
1.401 - /// ShiftMap<X> sh(x,v);
1.402 - ///\endcode
1.403 - ///is equivalent with
1.404 - ///\code
1.405 - /// ConstMap<X::Key, X::Value> c_tmp(v);
1.406 - /// AddMap<X, ConstMap<X::Key, X::Value> > sh(x,v);
1.407 - ///\endcode
1.408 + ///\sa ShiftMap
1.409 template<typename M, typename C = typename M::Value>
1.410 class ShiftWriteMap : public MapBase<typename M::Key, typename M::Value> {
1.411 M& m;
1.412 @@ -529,7 +595,7 @@
1.413 void set(Key k, const Value& c) { m.set(k, c - v); }
1.414 };
1.415
1.416 - ///Returns an \c ShiftMap class
1.417 + ///Returns a \c ShiftMap class
1.418
1.419 ///This function just returns an \c ShiftMap class.
1.420 ///\relates ShiftMap
1.421 @@ -538,6 +604,10 @@
1.422 return ShiftMap<M, C>(m,v);
1.423 }
1.424
1.425 + ///Returns a \c ShiftWriteMap class
1.426 +
1.427 + ///This function just returns a \c ShiftWriteMap class.
1.428 + ///\relates ShiftWriteMap
1.429 template<typename M, typename C>
1.430 inline ShiftWriteMap<M, C> shiftMap(M &m,const C &v) {
1.431 return ShiftWriteMap<M, C>(m,v);
1.432 @@ -545,9 +615,9 @@
1.433
1.434 ///Difference of two maps
1.435
1.436 - ///This \c concepts::ReadMap "read only map" returns the difference
1.437 - ///of the values of the two
1.438 - ///given maps. Its \c Key and \c Value will be inherited from \c M1.
1.439 + ///This \ref concepts::ReadMap "read only map" returns the difference
1.440 + ///of the values of the two given maps.
1.441 + ///Its \c Key and \c Value are inherited from \c M1.
1.442 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
1.443
1.444 template<typename M1, typename M2>
1.445 @@ -577,12 +647,10 @@
1.446
1.447 ///Product of two maps
1.448
1.449 - ///This \c concepts::ReadMap "read only map" returns the product of the
1.450 - ///values of the two
1.451 - ///given
1.452 - ///maps. Its \c Key and \c Value will be inherited from \c M1.
1.453 + ///This \ref concepts::ReadMap "read only map" returns the product of the
1.454 + ///values of the two given maps.
1.455 + ///Its \c Key and \c Value are inherited from \c M1.
1.456 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
1.457 -
1.458 template<typename M1, typename M2>
1.459 class MulMap : public MapBase<typename M1::Key, typename M1::Value> {
1.460 const M1& m1;
1.461 @@ -607,21 +675,23 @@
1.462 return MulMap<M1, M2>(m1,m2);
1.463 }
1.464
1.465 - ///Scales a maps with a constant.
1.466 + ///Scales a map with a constant.
1.467
1.468 - ///This \c concepts::ReadMap "read only map" returns the value of the
1.469 + ///This \ref concepts::ReadMap "read only map" returns the value of the
1.470 ///given map multiplied from the left side with a constant value.
1.471 - ///Its \c Key and \c Value is inherited from \c M.
1.472 + ///Its \c Key and \c Value are inherited from \c M.
1.473 ///
1.474 ///Actually,
1.475 ///\code
1.476 /// ScaleMap<X> sc(x,v);
1.477 ///\endcode
1.478 - ///is equivalent with
1.479 + ///is equivalent to
1.480 ///\code
1.481 /// ConstMap<X::Key, X::Value> c_tmp(v);
1.482 /// MulMap<X, ConstMap<X::Key, X::Value> > sc(x,v);
1.483 ///\endcode
1.484 + ///
1.485 + ///\sa ScaleWriteMap
1.486 template<typename M, typename C = typename M::Value>
1.487 class ScaleMap : public MapBase<typename M::Key, typename M::Value> {
1.488 const M& m;
1.489 @@ -641,12 +711,15 @@
1.490 Value operator[](Key k) const {return v * m[k];}
1.491 };
1.492
1.493 - ///Scales a maps with a constant.
1.494 + ///Scales a map with a constant (ReadWrite version).
1.495
1.496 - ///This \c concepts::ReadWriteMap "read-write map" returns the value of the
1.497 + ///This \ref concepts::ReadWriteMap "read-write map" returns the value of the
1.498 ///given map multiplied from the left side with a constant value. It can
1.499 - ///be used as write map also if the given multiplier is not zero.
1.500 - ///Its \c Key and \c Value is inherited from \c M.
1.501 + ///also be used as write map if the \c / operator is defined between
1.502 + ///\c Value and \c C and the given multiplier is not zero.
1.503 + ///Its \c Key and \c Value are inherited from \c M.
1.504 + ///
1.505 + ///\sa ScaleMap
1.506 template<typename M, typename C = typename M::Value>
1.507 class ScaleWriteMap : public MapBase<typename M::Key, typename M::Value> {
1.508 M& m;
1.509 @@ -668,15 +741,19 @@
1.510 void set(Key k, const Value& c) { m.set(k, c / v);}
1.511 };
1.512
1.513 - ///Returns an \c ScaleMap class
1.514 + ///Returns a \c ScaleMap class
1.515
1.516 - ///This function just returns an \c ScaleMap class.
1.517 + ///This function just returns a \c ScaleMap class.
1.518 ///\relates ScaleMap
1.519 template<typename M, typename C>
1.520 inline ScaleMap<M, C> scaleMap(const M &m,const C &v) {
1.521 return ScaleMap<M, C>(m,v);
1.522 }
1.523
1.524 + ///Returns a \c ScaleWriteMap class
1.525 +
1.526 + ///This function just returns a \c ScaleWriteMap class.
1.527 + ///\relates ScaleWriteMap
1.528 template<typename M, typename C>
1.529 inline ScaleWriteMap<M, C> scaleMap(M &m,const C &v) {
1.530 return ScaleWriteMap<M, C>(m,v);
1.531 @@ -684,11 +761,10 @@
1.532
1.533 ///Quotient of two maps
1.534
1.535 - ///This \c concepts::ReadMap "read only map" returns the quotient of the
1.536 - ///values of the two
1.537 - ///given maps. Its \c Key and \c Value will be inherited from \c M1.
1.538 + ///This \ref concepts::ReadMap "read only map" returns the quotient of the
1.539 + ///values of the two given maps.
1.540 + ///Its \c Key and \c Value are inherited from \c M1.
1.541 ///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
1.542 -
1.543 template<typename M1, typename M2>
1.544 class DivMap : public MapBase<typename M1::Key, typename M1::Value> {
1.545 const M1& m1;
1.546 @@ -715,19 +791,20 @@
1.547
1.548 ///Composition of two maps
1.549
1.550 - ///This \c concepts::ReadMap "read only map" returns the composition of
1.551 - ///two
1.552 - ///given maps. That is to say, if \c m1 is of type \c M1 and \c m2 is
1.553 - ///of \c M2,
1.554 + ///This \ref concepts::ReadMap "read only map" returns the composition of
1.555 + ///two given maps.
1.556 + ///That is to say, if \c m1 is of type \c M1 and \c m2 is of \c M2,
1.557 ///then for
1.558 ///\code
1.559 /// ComposeMap<M1, M2> cm(m1,m2);
1.560 ///\endcode
1.561 - /// <tt>cm[x]</tt> will be equal to <tt>m1[m2[x]]</tt>
1.562 + /// <tt>cm[x]</tt> will be equal to <tt>m1[m2[x]]</tt>.
1.563 ///
1.564 - ///Its \c Key is inherited from \c M2 and its \c Value is from
1.565 - ///\c M1.
1.566 - ///The \c M2::Value must be convertible to \c M1::Key.
1.567 + ///Its \c Key is inherited from \c M2 and its \c Value is from \c M1.
1.568 + ///\c M2::Value must be convertible to \c M1::Key.
1.569 + ///
1.570 + ///\sa CombineMap
1.571 + ///
1.572 ///\todo Check the requirements.
1.573 template <typename M1, typename M2>
1.574 class ComposeMap : public MapBase<typename M2::Key, typename M1::Value> {
1.575 @@ -755,27 +832,27 @@
1.576 return ComposeMap<M1, M2>(m1,m2);
1.577 }
1.578
1.579 - ///Combines of two maps using an STL (binary) functor.
1.580 + ///Combine of two maps using an STL (binary) functor.
1.581
1.582 - ///Combines of two maps using an STL (binary) functor.
1.583 + ///Combine of two maps using an STL (binary) functor.
1.584 ///
1.585 - ///
1.586 - ///This \c concepts::ReadMap "read only map" takes two maps and a
1.587 - ///binary functor and returns the composition of
1.588 - ///the two
1.589 + ///This \ref concepts::ReadMap "read only map" takes two maps and a
1.590 + ///binary functor and returns the composition of the two
1.591 ///given maps unsing the functor.
1.592 ///That is to say, if \c m1 and \c m2 is of type \c M1 and \c M2
1.593 - ///and \c f is of \c F,
1.594 - ///then for
1.595 + ///and \c f is of \c F, then for
1.596 ///\code
1.597 /// CombineMap<M1, M2,F,V> cm(m1,m2,f);
1.598 ///\endcode
1.599 /// <tt>cm[x]</tt> will be equal to <tt>f(m1[x],m2[x])</tt>
1.600 ///
1.601 ///Its \c Key is inherited from \c M1 and its \c Value is \c V.
1.602 - ///The \c M2::Value and \c M1::Value must be convertible to the corresponding
1.603 + ///\c M2::Value and \c M1::Value must be convertible to the corresponding
1.604 ///input parameter of \c F and the return type of \c F must be convertible
1.605 ///to \c V.
1.606 + ///
1.607 + ///\sa ComposeMap
1.608 + ///
1.609 ///\todo Check the requirements.
1.610 template<typename M1, typename M2, typename F,
1.611 typename V = typename F::result_type>
1.612 @@ -801,15 +878,15 @@
1.613 ///
1.614 ///For example if \c m1 and \c m2 are both \c double valued maps, then
1.615 ///\code
1.616 - ///combineMap<double>(m1,m2,std::plus<double>())
1.617 + ///combineMap(m1,m2,std::plus<double>())
1.618 ///\endcode
1.619 - ///is equivalent with
1.620 + ///is equivalent to
1.621 ///\code
1.622 ///addMap(m1,m2)
1.623 ///\endcode
1.624 ///
1.625 ///This function is specialized for adaptable binary function
1.626 - ///classes and c++ functions.
1.627 + ///classes and C++ functions.
1.628 ///
1.629 ///\relates CombineMap
1.630 template<typename M1, typename M2, typename F, typename V>
1.631 @@ -832,12 +909,12 @@
1.632
1.633 ///Negative value of a map
1.634
1.635 - ///This \c concepts::ReadMap "read only map" returns the negative
1.636 - ///value of the
1.637 - ///value returned by the
1.638 - ///given map. Its \c Key and \c Value will be inherited from \c M.
1.639 + ///This \ref concepts::ReadMap "read only map" returns the negative
1.640 + ///value of the value returned by the given map.
1.641 + ///Its \c Key and \c Value are inherited from \c M.
1.642 ///The unary \c - operator must be defined for \c Value, of course.
1.643 -
1.644 + ///
1.645 + ///\sa NegWriteMap
1.646 template<typename M>
1.647 class NegMap : public MapBase<typename M::Key, typename M::Value> {
1.648 const M& m;
1.649 @@ -852,13 +929,14 @@
1.650 Value operator[](Key k) const {return -m[k];}
1.651 };
1.652
1.653 - ///Negative value of a map
1.654 + ///Negative value of a map (ReadWrite version)
1.655
1.656 - ///This \c concepts::ReadWriteMap "read-write map" returns the negative
1.657 - ///value of the value returned by the
1.658 - ///given map. Its \c Key and \c Value will be inherited from \c M.
1.659 + ///This \ref concepts::ReadWriteMap "read-write map" returns the negative
1.660 + ///value of the value returned by the given map.
1.661 + ///Its \c Key and \c Value are inherited from \c M.
1.662 ///The unary \c - operator must be defined for \c Value, of course.
1.663 -
1.664 + ///
1.665 + /// \sa NegMap
1.666 template<typename M>
1.667 class NegWriteMap : public MapBase<typename M::Key, typename M::Value> {
1.668 M& m;
1.669 @@ -884,6 +962,10 @@
1.670 return NegMap<M>(m);
1.671 }
1.672
1.673 + ///Returns a \c NegWriteMap class
1.674 +
1.675 + ///This function just returns a \c NegWriteMap class.
1.676 + ///\relates NegWriteMap
1.677 template <typename M>
1.678 inline NegWriteMap<M> negMap(M &m) {
1.679 return NegWriteMap<M>(m);
1.680 @@ -891,12 +973,10 @@
1.681
1.682 ///Absolute value of a map
1.683
1.684 - ///This \c concepts::ReadMap "read only map" returns the absolute value
1.685 - ///of the
1.686 - ///value returned by the
1.687 - ///given map. Its \c Key and \c Value will be inherited
1.688 - ///from <tt>M</tt>. <tt>Value</tt>
1.689 - ///must be comparable to <tt>0</tt> and the unary <tt>-</tt>
1.690 + ///This \ref concepts::ReadMap "read only map" returns the absolute value
1.691 + ///of the value returned by the given map.
1.692 + ///Its \c Key and \c Value are inherited from \c M.
1.693 + ///\c Value must be comparable to \c 0 and the unary \c -
1.694 ///operator must be defined for it, of course.
1.695 ///
1.696 ///\bug We need a unified way to handle the situation below:
1.697 @@ -930,9 +1010,9 @@
1.698
1.699 };
1.700
1.701 - ///Returns a \c AbsMap class
1.702 + ///Returns an \c AbsMap class
1.703
1.704 - ///This function just returns a \c AbsMap class.
1.705 + ///This function just returns an \c AbsMap class.
1.706 ///\relates AbsMap
1.707 template<typename M>
1.708 inline AbsMap<M> absMap(const M &m) {
1.709 @@ -941,15 +1021,18 @@
1.710
1.711 ///Converts an STL style functor to a map
1.712
1.713 - ///This \c concepts::ReadMap "read only map" returns the value
1.714 - ///of a
1.715 - ///given map.
1.716 + ///This \ref concepts::ReadMap "read only map" returns the value
1.717 + ///of a given functor.
1.718 ///
1.719 ///Template parameters \c K and \c V will become its
1.720 - ///\c Key and \c Value. They must be given explicitely
1.721 - ///because a functor does not provide such typedefs.
1.722 + ///\c Key and \c Value.
1.723 + ///In most cases they have to be given explicitly because a
1.724 + ///functor typically does not provide \c argument_type and
1.725 + ///\c result_type typedefs.
1.726 ///
1.727 ///Parameter \c F is the type of the used functor.
1.728 + ///
1.729 + ///\sa MapFunctor
1.730 template<typename F,
1.731 typename K = typename F::argument_type,
1.732 typename V = typename F::result_type>
1.733 @@ -970,8 +1053,9 @@
1.734
1.735 ///This function just returns a \c FunctorMap class.
1.736 ///
1.737 - ///It is specialized for adaptable function classes and
1.738 - ///c++ functions.
1.739 + ///This function is specialized for adaptable binary function
1.740 + ///classes and C++ functions.
1.741 + ///
1.742 ///\relates FunctorMap
1.743 template<typename K, typename V, typename F> inline
1.744 FunctorMap<F, K, V> functorMap(const F &f) {
1.745 @@ -994,11 +1078,13 @@
1.746 ///Converts a map to an STL style (unary) functor
1.747
1.748 ///This class Converts a map to an STL style (unary) functor.
1.749 - ///that is it provides an <tt>operator()</tt> to read its values.
1.750 + ///That is it provides an <tt>operator()</tt> to read its values.
1.751 ///
1.752 ///For the sake of convenience it also works as
1.753 - ///a ususal \c concepts::ReadMap "readable map",
1.754 + ///a ususal \ref concepts::ReadMap "readable map",
1.755 ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist.
1.756 + ///
1.757 + ///\sa FunctorMap
1.758 template <typename M>
1.759 class MapFunctor : public MapBase<typename M::Key, typename M::Value> {
1.760 const M& m;
1.761 @@ -1027,14 +1113,17 @@
1.762 return MapFunctor<M>(m);
1.763 }
1.764
1.765 - ///Applies all map setting operations to two maps
1.766 + ///Just readable version of \ref ForkWriteMap
1.767
1.768 - ///This map has two \c concepts::ReadMap "readable map"
1.769 + ///This map has two \ref concepts::ReadMap "readable map"
1.770 ///parameters and each read request will be passed just to the
1.771 - ///first map. This class is the just readable map type of the ForkWriteMap.
1.772 + ///first map. This class is the just readable map type of \c ForkWriteMap.
1.773 ///
1.774 - ///The \c Key and \c Value will be inherited from \c M1.
1.775 - ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
1.776 + ///The \c Key and \c Value are inherited from \c M1.
1.777 + ///The \c Key and \c Value of \c M2 must be convertible from those of \c M1.
1.778 + ///
1.779 + ///\sa ForkWriteMap
1.780 +
1.781 template<typename M1, typename M2>
1.782 class ForkMap : public MapBase<typename M1::Key, typename M1::Value> {
1.783 const M1& m1;
1.784 @@ -1053,14 +1142,16 @@
1.785
1.786 ///Applies all map setting operations to two maps
1.787
1.788 - ///This map has two \c concepts::WriteMap "writable map"
1.789 + ///This map has two \ref concepts::WriteMap "writable map"
1.790 ///parameters and each write request will be passed to both of them.
1.791 - ///If \c M1 is also \c concepts::ReadMap "readable",
1.792 + ///If \c M1 is also \ref concepts::ReadMap "readable",
1.793 ///then the read operations will return the
1.794 ///corresponding values of \c M1.
1.795 ///
1.796 - ///The \c Key and \c Value will be inherited from \c M1.
1.797 - ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
1.798 + ///The \c Key and \c Value are inherited from \c M1.
1.799 + ///The \c Key and \c Value of \c M2 must be convertible from those of \c M1.
1.800 + ///
1.801 + ///\sa ForkMap
1.802 template<typename M1, typename M2>
1.803 class ForkWriteMap : public MapBase<typename M1::Key, typename M1::Value> {
1.804 M1& m1;
1.805 @@ -1078,16 +1169,19 @@
1.806 void set(Key k, const Value &v) {m1.set(k,v); m2.set(k,v);}
1.807 };
1.808
1.809 - ///Returns an \c ForkMap class
1.810 + ///Returns a \c ForkMap class
1.811
1.812 - ///This function just returns an \c ForkMap class.
1.813 - ///
1.814 + ///This function just returns a \c ForkMap class.
1.815 ///\relates ForkMap
1.816 template <typename M1, typename M2>
1.817 inline ForkMap<M1, M2> forkMap(const M1 &m1, const M2 &m2) {
1.818 return ForkMap<M1, M2>(m1,m2);
1.819 }
1.820
1.821 + ///Returns a \c ForkWriteMap class
1.822 +
1.823 + ///This function just returns a \c ForkWriteMap class.
1.824 + ///\relates ForkWriteMap
1.825 template <typename M1, typename M2>
1.826 inline ForkWriteMap<M1, M2> forkMap(M1 &m1, M2 &m2) {
1.827 return ForkWriteMap<M1, M2>(m1,m2);
1.828 @@ -1099,11 +1193,11 @@
1.829
1.830 ///Logical 'not' of a map
1.831
1.832 - ///This bool \c concepts::ReadMap "read only map" returns the
1.833 - ///logical negation of
1.834 - ///value returned by the
1.835 - ///given map. Its \c Key and will be inherited from \c M,
1.836 - ///its Value is <tt>bool</tt>.
1.837 + ///This bool \ref concepts::ReadMap "read only map" returns the
1.838 + ///logical negation of the value returned by the given map.
1.839 + ///Its \c Key is inherited from \c M, its \c Value is \c bool.
1.840 + ///
1.841 + ///\sa NotWriteMap
1.842 template <typename M>
1.843 class NotMap : public MapBase<typename M::Key, bool> {
1.844 const M& m;
1.845 @@ -1118,13 +1212,14 @@
1.846 Value operator[](Key k) const {return !m[k];}
1.847 };
1.848
1.849 - ///Logical 'not' of a map with writing possibility
1.850 + ///Logical 'not' of a map (ReadWrie version)
1.851
1.852 - ///This bool \c concepts::ReadWriteMap "read-write map" returns the
1.853 - ///logical negation of value returned by the given map. When it is set,
1.854 + ///This bool \ref concepts::ReadWriteMap "read-write map" returns the
1.855 + ///logical negation of the value returned by the given map. When it is set,
1.856 ///the opposite value is set to the original map.
1.857 - ///Its \c Key and will be inherited from \c M,
1.858 - ///its Value is <tt>bool</tt>.
1.859 + ///Its \c Key is inherited from \c M, its \c Value is \c bool.
1.860 + ///
1.861 + ///\sa NotMap
1.862 template <typename M>
1.863 class NotWriteMap : public MapBase<typename M::Key, bool> {
1.864 M& m;
1.865 @@ -1150,6 +1245,10 @@
1.866 return NotMap<M>(m);
1.867 }
1.868
1.869 + ///Returns a \c NotWriteMap class
1.870 +
1.871 + ///This function just returns a \c NotWriteMap class.
1.872 + ///\relates NotWriteMap
1.873 template <typename M>
1.874 inline NotWriteMap<M> notMap(M &m) {
1.875 return NotWriteMap<M>(m);
1.876 @@ -1181,16 +1280,17 @@
1.877 }
1.878
1.879
1.880 - /// \brief Writable bool map for store each true assigned elements.
1.881 + /// \brief Writable bool map for logging each \c true assigned element
1.882 ///
1.883 - /// Writable bool map to store each true assigned elements. It will
1.884 - /// copies all the keys set to true to the given iterator.
1.885 + /// A \ref concepts::ReadWriteMap "read-write" bool map for logging
1.886 + /// each \c true assigned element, i.e it copies all the keys set
1.887 + /// to \c true to the given iterator.
1.888 ///
1.889 /// \note The container of the iterator should contain space
1.890 /// for each element.
1.891 ///
1.892 - /// The next example shows how can you write the nodes directly
1.893 - /// to the standard output.
1.894 + /// The following example shows how you can write the edges found by
1.895 + /// the \ref Prim algorithm directly to the standard output.
1.896 ///\code
1.897 /// typedef IdMap<UGraph, UEdge> UEdgeIdMap;
1.898 /// UEdgeIdMap uedgeId(ugraph);
1.899 @@ -1203,6 +1303,10 @@
1.900 ///
1.901 /// prim(ugraph, cost, writerMap);
1.902 ///\endcode
1.903 + ///
1.904 + ///\sa BackInserterBoolMap
1.905 + ///\sa FrontInserterBoolMap
1.906 + ///\sa InserterBoolMap
1.907 template <typename _Iterator,
1.908 typename _Functor =
1.909 _maps_bits::Identity<typename _maps_bits::
1.910 @@ -1220,17 +1324,17 @@
1.911 StoreBoolMap(Iterator it, const Functor& functor = Functor())
1.912 : _begin(it), _end(it), _functor(functor) {}
1.913
1.914 - /// Gives back the given iterator set for the first time.
1.915 + /// Gives back the given iterator set for the first key
1.916 Iterator begin() const {
1.917 return _begin;
1.918 }
1.919
1.920 - /// Gives back the iterator after the last set operation.
1.921 + /// Gives back the the 'after the last' iterator
1.922 Iterator end() const {
1.923 return _end;
1.924 }
1.925
1.926 - /// Setter function of the map
1.927 + /// The \c set function of the map
1.928 void set(const Key& key, Value value) const {
1.929 if (value) {
1.930 *_end++ = _functor(key);
1.931 @@ -1243,26 +1347,30 @@
1.932 Functor _functor;
1.933 };
1.934
1.935 - /// \brief Writable bool map for store each true assigned elements in
1.936 + /// \brief Writable bool map for logging each \c true assigned element in
1.937 /// a back insertable container.
1.938 ///
1.939 - /// Writable bool map for store each true assigned elements in a back
1.940 - /// insertable container. It will push back all the keys set to true into
1.941 - /// the container. It can be used to retrieve the items into a standard
1.942 - /// container. The next example shows how can you store the undirected
1.943 - /// edges in a vector with prim algorithm.
1.944 + /// Writable bool map for logging each \c true assigned element by pushing
1.945 + /// them into a back insertable container.
1.946 + /// It can be used to retrieve the items into a standard
1.947 + /// container. The next example shows how you can store the
1.948 + /// edges found by the Prim algorithm in a vector.
1.949 ///
1.950 ///\code
1.951 /// vector<UEdge> span_tree_uedges;
1.952 /// BackInserterBoolMap<vector<UEdge> > inserter_map(span_tree_uedges);
1.953 /// prim(ugraph, cost, inserter_map);
1.954 ///\endcode
1.955 + ///
1.956 + ///\sa StoreBoolMap
1.957 + ///\sa FrontInserterBoolMap
1.958 + ///\sa InserterBoolMap
1.959 template <typename Container,
1.960 typename Functor =
1.961 _maps_bits::Identity<typename Container::value_type> >
1.962 class BackInserterBoolMap {
1.963 public:
1.964 - typedef typename Container::value_type Key;
1.965 + typedef typename Functor::argument_type Key;
1.966 typedef bool Value;
1.967
1.968 /// Constructor
1.969 @@ -1270,7 +1378,7 @@
1.970 const Functor& _functor = Functor())
1.971 : container(_container), functor(_functor) {}
1.972
1.973 - /// Setter function of the map
1.974 + /// The \c set function of the map
1.975 void set(const Key& key, Value value) {
1.976 if (value) {
1.977 container.push_back(functor(key));
1.978 @@ -1282,18 +1390,22 @@
1.979 Functor functor;
1.980 };
1.981
1.982 - /// \brief Writable bool map for store each true assigned elements in
1.983 + /// \brief Writable bool map for logging each \c true assigned element in
1.984 /// a front insertable container.
1.985 ///
1.986 - /// Writable bool map for store each true assigned elements in a front
1.987 - /// insertable container. It will push front all the keys set to \c true into
1.988 - /// the container. For example see the BackInserterBoolMap.
1.989 + /// Writable bool map for logging each \c true assigned element by pushing
1.990 + /// them into a front insertable container.
1.991 + /// It can be used to retrieve the items into a standard
1.992 + /// container. For example see \ref BackInserterBoolMap.
1.993 + ///
1.994 + ///\sa BackInserterBoolMap
1.995 + ///\sa InserterBoolMap
1.996 template <typename Container,
1.997 typename Functor =
1.998 _maps_bits::Identity<typename Container::value_type> >
1.999 class FrontInserterBoolMap {
1.1000 public:
1.1001 - typedef typename Container::value_type Key;
1.1002 + typedef typename Functor::argument_type Key;
1.1003 typedef bool Value;
1.1004
1.1005 /// Constructor
1.1006 @@ -1301,10 +1413,10 @@
1.1007 const Functor& _functor = Functor())
1.1008 : container(_container), functor(_functor) {}
1.1009
1.1010 - /// Setter function of the map
1.1011 + /// The \c set function of the map
1.1012 void set(const Key& key, Value value) {
1.1013 if (value) {
1.1014 - container.push_front(key);
1.1015 + container.push_front(functor(key));
1.1016 }
1.1017 }
1.1018
1.1019 @@ -1313,12 +1425,14 @@
1.1020 Functor functor;
1.1021 };
1.1022
1.1023 - /// \brief Writable bool map for store each true assigned elements in
1.1024 + /// \brief Writable bool map for storing each \c true assigned element in
1.1025 /// an insertable container.
1.1026 ///
1.1027 - /// Writable bool map for store each true assigned elements in an
1.1028 + /// Writable bool map for storing each \c true assigned element in an
1.1029 /// insertable container. It will insert all the keys set to \c true into
1.1030 - /// the container. If you want to store the cut edges of the strongly
1.1031 + /// the container.
1.1032 + ///
1.1033 + /// For example, if you want to store the cut arcs of the strongly
1.1034 /// connected components in a set you can use the next code:
1.1035 ///
1.1036 ///\code
1.1037 @@ -1326,6 +1440,9 @@
1.1038 /// InserterBoolMap<set<Edge> > inserter_map(cut_edges);
1.1039 /// stronglyConnectedCutEdges(graph, cost, inserter_map);
1.1040 ///\endcode
1.1041 + ///
1.1042 + ///\sa BackInserterBoolMap
1.1043 + ///\sa FrontInserterBoolMap
1.1044 template <typename Container,
1.1045 typename Functor =
1.1046 _maps_bits::Identity<typename Container::value_type> >
1.1047 @@ -1334,19 +1451,29 @@
1.1048 typedef typename Container::value_type Key;
1.1049 typedef bool Value;
1.1050
1.1051 - /// Constructor
1.1052 + /// Constructor with specified iterator
1.1053 +
1.1054 + /// Constructor with specified iterator.
1.1055 + /// \param _container The container for storing the elements.
1.1056 + /// \param _it The elements will be inserted before this iterator.
1.1057 + /// \param _functor The functor that is used when an element is stored.
1.1058 InserterBoolMap(Container& _container, typename Container::iterator _it,
1.1059 const Functor& _functor = Functor())
1.1060 : container(_container), it(_it), functor(_functor) {}
1.1061
1.1062 /// Constructor
1.1063 +
1.1064 + /// Constructor without specified iterator.
1.1065 + /// The elements will be inserted before <tt>_container.end()</tt>.
1.1066 + /// \param _container The container for storing the elements.
1.1067 + /// \param _functor The functor that is used when an element is stored.
1.1068 InserterBoolMap(Container& _container, const Functor& _functor = Functor())
1.1069 : container(_container), it(_container.end()), functor(_functor) {}
1.1070
1.1071 - /// Setter function of the map
1.1072 + /// The \c set function of the map
1.1073 void set(const Key& key, Value value) {
1.1074 if (value) {
1.1075 - it = container.insert(it, key);
1.1076 + it = container.insert(it, functor(key));
1.1077 ++it;
1.1078 }
1.1079 }
1.1080 @@ -1357,13 +1484,13 @@
1.1081 Functor functor;
1.1082 };
1.1083
1.1084 - /// \brief Fill the true set elements with a given value.
1.1085 + /// \brief Writable bool map for filling each \c true assigned element with a
1.1086 + /// given value.
1.1087 ///
1.1088 - /// Writable bool map to fill the elements set to \c true with a given value.
1.1089 - /// The value can set
1.1090 - /// the container.
1.1091 + /// Writable bool map for filling each \c true assigned element with a
1.1092 + /// given value. The value can set the container.
1.1093 ///
1.1094 - /// The next code finds the connected components of the undirected graph
1.1095 + /// The following code finds the connected components of a graph
1.1096 /// and stores it in the \c comp map:
1.1097 ///\code
1.1098 /// typedef UGraph::NodeMap<int> ComponentMap;
1.1099 @@ -1411,7 +1538,7 @@
1.1100 fill = _fill;
1.1101 }
1.1102
1.1103 - /// Setter function of the map
1.1104 + /// The \c set function of the map
1.1105 void set(const Key& key, Value value) {
1.1106 if (value) {
1.1107 map.set(key, fill);
1.1108 @@ -1424,11 +1551,12 @@
1.1109 };
1.1110
1.1111
1.1112 - /// \brief Writable bool map which stores for each true assigned elements
1.1113 - /// the setting order number.
1.1114 + /// \brief Writable bool map for storing the sequence number of
1.1115 + /// \c true assignments.
1.1116 ///
1.1117 - /// Writable bool map which stores for each true assigned elements
1.1118 - /// the setting order number. It make easy to calculate the leaving
1.1119 + /// Writable bool map that stores for each \c true assigned elements
1.1120 + /// the sequence number of this setting.
1.1121 + /// It makes it easy to calculate the leaving
1.1122 /// order of the nodes in the \c Dfs algorithm.
1.1123 ///
1.1124 ///\code
1.1125 @@ -1447,9 +1575,9 @@
1.1126 /// }
1.1127 ///\endcode
1.1128 ///
1.1129 - /// The discovering order can be stored a little harder because the
1.1130 + /// The storing of the discovering order is more difficult because the
1.1131 /// ReachedMap should be readable in the dfs algorithm but the setting
1.1132 - /// order map is not readable. Now we should use the fork map:
1.1133 + /// order map is not readable. Thus we must use the fork map:
1.1134 ///
1.1135 ///\code
1.1136 /// typedef Graph::NodeMap<int> OrderMap;
1.1137 @@ -1487,7 +1615,7 @@
1.1138 return counter;
1.1139 }
1.1140
1.1141 - /// Setter function of the map
1.1142 + /// The \c set function of the map
1.1143 void set(const Key& key, Value value) {
1.1144 if (value) {
1.1145 map.set(key, counter++);