Index: lemon/maps.h
===================================================================
--- lemon/maps.h (revision 26)
+++ lemon/maps.h (revision 29)
@@ -53,7 +53,8 @@
/// Null map. (a.k.a. DoNothingMap)
- /// If you have to provide a map only for its type definitions,
- /// or if you have to provide a writable map, but
- /// data written to it will sent to /dev/null...
+ /// This map can be used if you have to provide a map only for
+ /// its type definitions, or if you have to provide a writable map,
+ /// but data written to it is not required (i.e. it will be sent to
+ /// /dev/null).
template
class NullMap : public MapBase {
@@ -69,4 +70,8 @@
};
+ ///Returns a \c NullMap class
+
+ ///This function just returns a \c NullMap class.
+ ///\relates NullMap
template
NullMap nullMap() {
@@ -91,11 +96,13 @@
/// Default constructor
+ /// Default constructor.
/// The value of the map will be uninitialized.
/// (More exactly it will be default constructed.)
ConstMap() {}
- ///\e
-
- /// \param _v The initial value of the map.
- ///
+
+ /// Constructor with specified initial value
+
+ /// Constructor with specified initial value.
+ /// \param _v is the initial value of the map.
ConstMap(const T &_v) : v(_v) {}
@@ -159,6 +166,6 @@
///Map based on std::map
- ///This is essentially a wrapper for \c std::map. With addition that
- ///you can specify a default value different from \c Value() .
+ ///This is essentially a wrapper for \c std::map with addition that
+ ///you can specify a default value different from \c Value().
template >
class StdMap {
@@ -322,7 +329,7 @@
/// @{
- /// \brief Identity mapping.
- ///
- /// This mapping gives back the given key as value without any
+ /// \brief Identity map.
+ ///
+ /// This map gives back the given key as value without any
/// modification.
template
@@ -353,5 +360,5 @@
///
///This \c concepts::ReadMap "read only map"
- ///converts the \c Value of a maps to type \c T.
+ ///converts the \c Value of a map to type \c T.
///Its \c Key is inherited from \c M.
template
@@ -365,6 +372,6 @@
///Constructor
- ///Constructor
- ///\param _m is the underlying map
+ ///Constructor.
+ ///\param _m is the underlying map.
ConvertMap(const M &_m) : m(_m) {};
@@ -375,7 +382,7 @@
};
- ///Returns an \c ConvertMap class
-
- ///This function just returns an \c ConvertMap class.
+ ///Returns a \c ConvertMap class
+
+ ///This function just returns a \c ConvertMap class.
///\relates ConvertMap
template
@@ -384,5 +391,5 @@
}
- ///Simple wrapping of the map
+ ///Simple wrapping of a map
///This \c concepts::ReadMap "read only map" returns the simple
@@ -391,5 +398,7 @@
///map to simple read map.
///
- /// \todo Revise the misleading name
+ ///\sa SimpleWriteMap
+ ///
+ /// \todo Revise the misleading name
template
class SimpleMap : public MapBase {
@@ -407,5 +416,5 @@
};
- ///Simple writeable wrapping of the map
+ ///Simple writable wrapping of the map
///This \c concepts::WriteMap "write map" returns the simple
@@ -414,4 +423,6 @@
///given map to simple read-write map.
///
+ ///\sa SimpleMap
+ ///
/// \todo Revise the misleading name
template
@@ -435,7 +446,7 @@
///This \c concepts::ReadMap "read only map" returns the sum of the two
- ///given maps. Its \c Key and \c Value will be inherited from \c M1.
+ ///given maps.
+ ///Its \c Key and \c Value are inherited from \c M1.
///The \c Key and \c Value of M2 must be convertible to those of \c M1.
-
template
class AddMap : public MapBase {
@@ -469,5 +480,5 @@
///This \c concepts::ReadMap "read only map" returns the sum of the
///given map and a constant value.
- ///Its \c Key and \c Value is inherited from \c M.
+ ///Its \c Key and \c Value are inherited from \c M.
///
///Actually,
@@ -475,9 +486,11 @@
/// ShiftMap sh(x,v);
///\endcode
- ///is equivalent with
+ ///is equivalent to
///\code
/// ConstMap c_tmp(v);
/// AddMap > sh(x,v);
///\endcode
+ ///
+ ///\sa ShiftWriteMap
template
class ShiftMap : public MapBase {
@@ -491,7 +504,7 @@
///Constructor
- ///Constructor
- ///\param _m is the undelying map
- ///\param _v is the shift value
+ ///Constructor.
+ ///\param _m is the undelying map.
+ ///\param _v is the shift value.
ShiftMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
///\e
@@ -499,19 +512,11 @@
};
- ///Shift a map with a constant. This map is also writable.
+ ///Shift a map with a constant (ReadWrite version).
///This \c concepts::ReadWriteMap "read-write map" returns the sum of the
///given map and a constant value. It makes also possible to write the map.
- ///Its \c Key and \c Value is inherited from \c M.
- ///
- ///Actually,
- ///\code
- /// ShiftMap sh(x,v);
- ///\endcode
- ///is equivalent with
- ///\code
- /// ConstMap c_tmp(v);
- /// AddMap > sh(x,v);
- ///\endcode
+ ///Its \c Key and \c Value are inherited from \c M.
+ ///
+ ///\sa ShiftMap
template
class ShiftWriteMap : public MapBase {
@@ -525,7 +530,7 @@
///Constructor
- ///Constructor
- ///\param _m is the undelying map
- ///\param _v is the shift value
+ ///Constructor.
+ ///\param _m is the undelying map.
+ ///\param _v is the shift value.
ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
/// \e
@@ -535,7 +540,7 @@
};
- ///Returns an \c ShiftMap class
-
- ///This function just returns an \c ShiftMap class.
+ ///Returns a \c ShiftMap class
+
+ ///This function just returns a \c ShiftMap class.
///\relates ShiftMap
template
@@ -544,4 +549,8 @@
}
+ ///Returns a \c ShiftWriteMap class
+
+ ///This function just returns a \c ShiftWriteMap class.
+ ///\relates ShiftWriteMap
template
inline ShiftWriteMap shiftMap(M &m,const C &v) {
@@ -552,6 +561,6 @@
///This \c concepts::ReadMap "read only map" returns the difference
- ///of the values of the two
- ///given maps. Its \c Key and \c Value will be inherited from \c M1.
+ ///of the values of the two given maps.
+ ///Its \c Key and \c Value are inherited from \c M1.
///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
///
@@ -585,9 +594,7 @@
///This \c concepts::ReadMap "read only map" returns the product of the
- ///values of the two
- ///given
- ///maps. Its \c Key and \c Value will be inherited from \c M1.
+ ///values of the two given maps.
+ ///Its \c Key and \c Value are inherited from \c M1.
///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
-
template
class MulMap : public MapBase {
@@ -614,9 +621,9 @@
}
- ///Scales a maps with a constant.
+ ///Scales a map with a constant.
///This \c concepts::ReadMap "read only map" returns the value of the
///given map multiplied from the left side with a constant value.
- ///Its \c Key and \c Value is inherited from \c M.
+ ///Its \c Key and \c Value are inherited from \c M.
///
///Actually,
@@ -624,9 +631,11 @@
/// ScaleMap sc(x,v);
///\endcode
- ///is equivalent with
+ ///is equivalent to
///\code
/// ConstMap c_tmp(v);
/// MulMap > sc(x,v);
///\endcode
+ ///
+ ///\sa ScaleWriteMap
template
class ScaleMap : public MapBase {
@@ -640,7 +649,7 @@
///Constructor
- ///Constructor
- ///\param _m is the undelying map
- ///\param _v is the scaling value
+ ///Constructor.
+ ///\param _m is the undelying map.
+ ///\param _v is the scaling value.
ScaleMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
/// \e
@@ -648,10 +657,13 @@
};
- ///Scales a maps with a constant (ReadWrite version).
+ ///Scales a map with a constant (ReadWrite version).
///This \c concepts::ReadWriteMap "read-write map" returns the value of the
///given map multiplied from the left side with a constant value. It can
- ///be used as write map also if the given multiplier is not zero.
- ///Its \c Key and \c Value is inherited from \c M.
+ ///also be used as write map if the \c / operator is defined between
+ ///\c Value and \c C and the given multiplier is not zero.
+ ///Its \c Key and \c Value are inherited from \c M.
+ ///
+ ///\sa ScaleMap
template
class ScaleWriteMap : public MapBase {
@@ -665,7 +677,7 @@
///Constructor
- ///Constructor
- ///\param _m is the undelying map
- ///\param _v is the scaling value
+ ///Constructor.
+ ///\param _m is the undelying map.
+ ///\param _v is the scaling value.
ScaleWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
/// \e
@@ -675,7 +687,7 @@
};
- ///Returns an \c ScaleMap class
-
- ///This function just returns an \c ScaleMap class.
+ ///Returns a \c ScaleMap class
+
+ ///This function just returns a \c ScaleMap class.
///\relates ScaleMap
template
@@ -684,4 +696,8 @@
}
+ ///Returns a \c ScaleWriteMap class
+
+ ///This function just returns a \c ScaleWriteMap class.
+ ///\relates ScaleWriteMap
template
inline ScaleWriteMap scaleMap(M &m,const C &v) {
@@ -692,8 +708,7 @@
///This \c concepts::ReadMap "read only map" returns the quotient of the
- ///values of the two
- ///given maps. Its \c Key and \c Value will be inherited from \c M1.
+ ///values of the two given maps.
+ ///Its \c Key and \c Value are inherited from \c M1.
///The \c Key and \c Value of \c M2 must be convertible to those of \c M1.
-
template
class DivMap : public MapBase {
@@ -723,16 +738,17 @@
///This \c concepts::ReadMap "read only map" returns the composition of
- ///two
- ///given maps. That is to say, if \c m1 is of type \c M1 and \c m2 is
- ///of \c M2,
+ ///two given maps.
+ ///That is to say, if \c m1 is of type \c M1 and \c m2 is of \c M2,
///then for
///\code
/// ComposeMap cm(m1,m2);
///\endcode
- /// cm[x] will be equal to m1[m2[x]]
- ///
- ///Its \c Key is inherited from \c M2 and its \c Value is from
- ///\c M1.
- ///The \c M2::Value must be convertible to \c M1::Key.
+ /// cm[x] will be equal to m1[m2[x]].
+ ///
+ ///Its \c Key is inherited from \c M2 and its \c Value is from \c M1.
+ ///\c M2::Value must be convertible to \c M1::Key.
+ ///
+ ///\sa CombineMap
+ ///
///\todo Check the requirements.
template
@@ -758,8 +774,8 @@
operator[](Key k) const {return m1[m2[k]];}
};
+
///Returns a \c ComposeMap class
///This function just returns a \c ComposeMap class.
- ///
///\relates ComposeMap
template
@@ -768,25 +784,25 @@
}
- ///Combines of two maps using an STL (binary) functor.
-
- ///Combines of two maps using an STL (binary) functor.
- ///
+ ///Combine of two maps using an STL (binary) functor.
+
+ ///Combine of two maps using an STL (binary) functor.
///
///This \c concepts::ReadMap "read only map" takes two maps and a
- ///binary functor and returns the composition of
- ///the two
+ ///binary functor and returns the composition of the two
///given maps unsing the functor.
///That is to say, if \c m1 and \c m2 is of type \c M1 and \c M2
- ///and \c f is of \c F,
- ///then for
+ ///and \c f is of \c F, then for
///\code
- /// CombineMap cm(m1,m2,f);
+ /// CombineMap cm(m1,m2,f);
///\endcode
/// cm[x] will be equal to f(m1[x],m2[x])
///
///Its \c Key is inherited from \c M1 and its \c Value is \c V.
- ///The \c M2::Value and \c M1::Value must be convertible to the corresponding
+ ///\c M2::Value and \c M1::Value must be convertible to the corresponding
///input parameter of \c F and the return type of \c F must be convertible
///to \c V.
+ ///
+ ///\sa ComposeMap
+ ///
///\todo Check the requirements.
template(m1,m2,std::plus())
///\endcode
- ///is equivalent with
+ ///is equivalent to
///\code
///addMap(m1,m2)
@@ -822,5 +838,5 @@
///
///This function is specialized for adaptable binary function
- ///classes and c++ functions.
+ ///classes and C++ functions.
///
///\relates CombineMap
@@ -846,9 +862,9 @@
///This \c concepts::ReadMap "read only map" returns the negative
- ///value of the
- ///value returned by the
- ///given map. Its \c Key and \c Value will be inherited from \c M.
+ ///value of the value returned by the given map.
+ ///Its \c Key and \c Value are inherited from \c M.
///The unary \c - operator must be defined for \c Value, of course.
-
+ ///
+ ///\sa NegWriteMap
template
class NegMap : public MapBase {
@@ -868,8 +884,9 @@
///This \c concepts::ReadWriteMap "read-write map" returns the negative
- ///value of the value returned by the
- ///given map. Its \c Key and \c Value will be inherited from \c M.
+ ///value of the value returned by the given map.
+ ///Its \c Key and \c Value are inherited from \c M.
///The unary \c - operator must be defined for \c Value, of course.
-
+ ///
+ /// \sa NegMap
template
class NegWriteMap : public MapBase {
@@ -897,4 +914,8 @@
}
+ ///Returns a \c NegWriteMap class
+
+ ///This function just returns a \c NegWriteMap class.
+ ///\relates NegWriteMap
template
inline NegWriteMap negMap(M &m) {
@@ -905,12 +926,8 @@
///This \c concepts::ReadMap "read only map" returns the absolute value
- ///of the
- ///value returned by the
- ///given map. Its \c Key and \c Value will be inherited
- ///from M. Value
- ///must be comparable to 0 and the unary -
+ ///of the value returned by the given map.
+ ///Its \c Key and \c Value are inherited from \c M.
+ ///\c Value must be comparable to \c 0 and the unary \c -
///operator must be defined for it, of course.
- ///
-
template
class AbsMap : public MapBase {
@@ -931,7 +948,7 @@
};
- ///Returns a \c AbsMap class
-
- ///This function just returns a \c AbsMap class.
+ ///Returns an \c AbsMap class
+
+ ///This function just returns an \c AbsMap class.
///\relates AbsMap
template
@@ -943,12 +960,13 @@
///This \c concepts::ReadMap "read only map" returns the value
- ///of a
- ///given map.
+ ///of a given functor.
///
///Template parameters \c K and \c V will become its
- ///\c Key and \c Value. They must be given explicitely
+ ///\c Key and \c Value. They must be given explicitly
///because a functor does not provide such typedefs.
///
///Parameter \c F is the type of the used functor.
+ ///
+ ///\sa MapFunctor
template inline
@@ -1000,4 +1018,6 @@
///a ususal \c concepts::ReadMap "readable map",
///i.e. operator[] and the \c Key and \c Value typedefs also exist.
+ ///
+ ///\sa FunctorMap
template
class MapFunctor : public MapBase {
@@ -1034,6 +1054,8 @@
///first map. This class is the just readable map type of the ForkWriteMap.
///
- ///The \c Key and \c Value will be inherited from \c M1.
+ ///The \c Key and \c Value are inherited from \c M1.
///The \c Key and \c Value of M2 must be convertible from those of \c M1.
+ ///
+ ///\sa ForkWriteMap
///
/// \todo Why is it needed?
@@ -1062,6 +1084,8 @@
///corresponding values of \c M1.
///
- ///The \c Key and \c Value will be inherited from \c M1.
+ ///The \c Key and \c Value are inherited from \c M1.
///The \c Key and \c Value of M2 must be convertible from those of \c M1.
+ ///
+ ///\sa ForkMap
template
class ForkWriteMap : public MapBase {
@@ -1081,8 +1105,7 @@
};
- ///Returns an \c ForkMap class
-
- ///This function just returns an \c ForkMap class.
- ///
+ ///Returns a \c ForkMap class
+
+ ///This function just returns a \c ForkMap class.
///\relates ForkMap
template
@@ -1091,4 +1114,8 @@
}
+ ///Returns a \c ForkWriteMap class
+
+ ///This function just returns a \c ForkWriteMap class.
+ ///\relates ForkWriteMap
template
inline ForkWriteMap forkMap(M1 &m1, M2 &m2) {
@@ -1103,8 +1130,8 @@
///This bool \c concepts::ReadMap "read only map" returns the
- ///logical negation of
- ///value returned by the
- ///given map. Its \c Key and will be inherited from \c M,
- ///its Value is bool.
+ ///logical negation of the value returned by the given map.
+ ///Its \c Key is inherited from \c M, its Value is \c bool.
+ ///
+ ///\sa NotWriteMap
template
class NotMap : public MapBase {
@@ -1124,8 +1151,9 @@
///This bool \c concepts::ReadWriteMap "read-write map" returns the
- ///logical negation of value returned by the given map. When it is set,
+ ///logical negation of the value returned by the given map. When it is set,
///the opposite value is set to the original map.
- ///Its \c Key and will be inherited from \c M,
- ///its Value is bool.
+ ///Its \c Key is inherited from \c M, its Value is \c bool.
+ ///
+ ///\sa NotMap
template
class NotWriteMap : public MapBase {
@@ -1153,4 +1181,8 @@
}
+ ///Returns a \c NotWriteMap class
+
+ ///This function just returns a \c NotWriteMap class.
+ ///\relates NotWriteMap
template
inline NotWriteMap notMap(M &m) {
@@ -1184,8 +1216,8 @@
- /// \brief Writable bool map for logging each true assigned elements
- ///
- /// Writable bool map for logging each true assigned elements, i.e it
- /// copies all the keys set to true to the given iterator.
+ /// \brief Writable bool map for logging each \c true assigned element
+ ///
+ /// Writable bool map for logging each \c true assigned element, i.e it
+ /// copies all the keys set to \c true to the given iterator.
///
/// \note The container of the iterator should contain space
@@ -1208,5 +1240,7 @@
///\endcode
///
- ///\todo Revise the name of this class and the relates ones.
+ ///\sa BackInserterBoolMap
+ ///
+ ///\todo Revise the name of this class and the related ones.
template _container.end().
+ /// \param _container The container for storing the elements.
+ /// \param _functor The functor that is used when an element is stored.
InserterBoolMap(Container& _container, const Functor& _functor = Functor())
: container(_container), it(_container.end()), functor(_functor) {}
- /// Setter function of the map
+ /// The \c set function of the map
void set(const Key& key, Value value) {
if (value) {
@@ -1365,9 +1420,9 @@
};
- /// \brief Fill the true set elements with a given value.
- ///
- /// Writable bool map to fill the elements set to \c true with a given value.
- /// The value can set
- /// the container.
+ /// \brief Writable bool map for filling each \c true assigned element with a
+ /// given value.
+ ///
+ /// Writable bool map for filling each \c true assigned element with a
+ /// given value. The value can set the container.
///
/// The following code finds the connected components of a graph
@@ -1419,5 +1474,5 @@
}
- /// Set function of the map
+ /// The \c set function of the map
void set(const Key& key, Value value) {
if (value) {
@@ -1432,8 +1487,8 @@
- /// \brief Writable bool map which stores the sequence number of
- /// true assignments.
+ /// \brief Writable bool map for storing the sequence number of
+ /// \c true assignments.
///
- /// Writable bool map which stores for each true assigned elements
+ /// Writable bool map that stores for each \c true assigned elements
/// the sequence number of this setting.
/// It makes it easy to calculate the leaving