COIN-OR::LEMON - Graph Library

Changeset 2489:48dddc283cfc in lemon-0.x


Ignore:
Timestamp:
10/09/07 17:46:12 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3328
Message:

Bug fix and redesign StdMap?
Improving map adaptors documentations

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • doc/groups.dox

    r2429 r2489  
    9898addition, multiplication etc.) or e.g. convert a map to another one
    9999of different Value type.
     100
     101The typical usage of this classes is the passing implicit maps to
     102algorithms.  If a function type algorithm is called then the function
     103type map adaptors can be used comfortable. For example let's see the
     104usage of map adaptors with the \c graphToEps() function:
     105\code
     106  Color nodeColor(int deg) {
     107    if (deg >= 2) {
     108      return Color(0.5, 0.0, 0.5);
     109    } else if (deg == 1) {
     110      return Color(1.0, 0.5, 1.0);
     111    } else {
     112      return Color(0.0, 0.0, 0.0);
     113    }
     114  }
     115 
     116  Graph::NodeMap<int> degree_map(graph);
     117 
     118  graphToEps(graph, "graph.eps")
     119    .coords(coords).scaleToA4().undirected()
     120    .nodeColors(composeMap(functorMap(nodeColor), degree_map))
     121    .run();
     122\endcode
     123The \c functorMap() function makes an \c int to \c Color map from the
     124\e nodeColor() function. The \c composeMap() compose the \e degree_map
     125and the previous created map. The composed map is proper function to
     126get color of each node.
     127
     128The usage with class type algorithms is little bit harder. In this
     129case the function type map adaptors can not be used, because the
     130function map adaptors give back temporarly objects.
     131\code
     132  Graph graph;
     133 
     134  typedef Graph::EdgeMap<double> DoubleEdgeMap;
     135  DoubleEdgeMap length(graph);
     136  DoubleEdgeMap speed(graph);
     137 
     138  typedef DivMap<DoubleEdgeMap, DoubleEdgeMap> TimeMap;
     139 
     140  TimeMap time(length, speed);
     141 
     142  Dijkstra<Graph, TimeMap> dijkstra(graph, time);
     143  dijkstra.run(source, target);
     144\endcode
     145
     146We have a length map and a maximum speed map on a graph. The minimum
     147time to pass the edge can be calculated as the division of the two
     148maps which can be done implicitly with the \c DivMap template
     149class. We use the implicit minimum time map as the length map of the
     150\c Dijkstra algorithm.
    100151*/
    101152
     
    116167to work with paths.
    117168
    118 All of them have the same interface, especially they can be built or extended
    119 using a standard Builder subclass. This make is easy to have e.g. the Dijkstra
    120 algorithm to store its result in any kind of path structure.
     169All of them have similar interfaces, and it can be copied easily with
     170assignment operator and copy constructor. This make it easy and
     171efficient to have e.g. the Dijkstra algorithm to store its result in
     172any kind of path structure.
    121173
    122174\sa lemon::concepts::Path
  • lemon/maps.h

    r2423 r2489  
    3030///\brief Miscellaneous property maps
    3131///
    32 ///\todo This file has the same name as the concept file in concepts/,
    33 /// and this is not easily detectable in docs...
    34 
    3532#include <map>
    3633
     
    8077
    8178  /// This is a readable map which assigns a specified value to each key.
    82   /// In other aspects it is equivalent to the \ref NullMap.
    83   /// \todo set could be used to set the value.
     79  /// In other aspects it is equivalent to the \c NullMap.
    8480  template<typename K, typename T>
    8581  class ConstMap : public MapBase<K, T> {
     
    10298    ///
    10399    ConstMap(const T &_v) : v(_v) {}
    104 
     100   
     101    ///\e
    105102    T operator[](const K&) const { return v; }
    106     void set(const K&, const T&) {}
     103
     104    ///\e
     105    void setAll(const T &t) {
     106      v = t;
     107    }   
    107108
    108109    template<typename T1>
     
    115116  };
    116117
    117   ///Returns a \ref ConstMap class
    118 
    119   ///This function just returns a \ref ConstMap class.
     118  ///Returns a \c ConstMap class
     119
     120  ///This function just returns a \c ConstMap class.
    120121  ///\relates ConstMap
    121122  template<typename K, typename V>
     
    125126
    126127
    127   //\todo to document later
    128128  template<typename T, T v>
    129129  struct Const { };
    130130
    131   //\todo to document later
     131  /// Constant map with inlined constant value.
     132
     133  /// This is a readable map which assigns a specified value to each key.
     134  /// In other aspects it is equivalent to the \c NullMap.
    132135  template<typename K, typename V, V v>
    133136  class ConstMap<K, Const<V, v> > : public MapBase<K, V> {
     
    138141
    139142    ConstMap() { }
     143    ///\e
    140144    V operator[](const K&) const { return v; }
     145    ///\e
    141146    void set(const K&, const V&) { }
    142147  };
    143148
    144   ///Returns a \ref ConstMap class
    145 
    146   ///This function just returns a \ref ConstMap class.
     149  ///Returns a \c ConstMap class
     150
     151  ///This function just returns a \c ConstMap class with inlined value.
    147152  ///\relates ConstMap
    148153  template<typename K, typename V, V v>
     
    151156  }
    152157
    153   /// \c std::map wrapper
    154 
    155   /// This is essentially a wrapper for \c std::map. With addition that
    156   /// you can specify a default value different from \c Value() .
    157   ///
    158   /// \todo Provide allocator parameter...
     158  ///Map based on std::map
     159
     160  ///This is essentially a wrapper for \c std::map. With addition that
     161  ///you can specify a default value different from \c Value() .
    159162  template <typename K, typename T, typename Compare = std::less<K> >
    160   class StdMap : public std::map<K, T, Compare> {
    161     typedef std::map<K, T, Compare> parent;
    162     T v;
    163     typedef typename parent::value_type PairType;
    164 
    165   public:
     163  class StdMap {
     164    template <typename K1, typename T1, typename C1>
     165    friend class StdMap;
     166  public:
     167
     168    typedef True ReferenceMapTag;
    166169    ///\e
    167170    typedef K Key;
     
    173176    typedef const T& ConstReference;
    174177
    175 
    176     StdMap() : v() {}
     178  private:
     179   
     180    typedef std::map<K, T, Compare> Map;
     181    Value _value;
     182    Map _map;
     183
     184  public:
     185
    177186    /// Constructor with specified default value
    178     StdMap(const T& _v) : v(_v) {}
    179 
    180     /// \brief Constructs the map from an appropriate std::map.
    181     ///
    182     /// \warning Inefficient: copies the content of \c m !
    183     StdMap(const parent &m) : parent(m) {}
     187    StdMap(const T& value = T()) : _value(value) {}
    184188    /// \brief Constructs the map from an appropriate std::map, and explicitly
    185189    /// specifies a default value.
    186     ///
    187     /// \warning Inefficient: copies the content of \c m !
    188     StdMap(const parent &m, const T& _v) : parent(m), v(_v) {}
     190    template <typename T1, typename Comp1>
     191    StdMap(const std::map<Key, T1, Comp1> &map, const T& value = T())
     192      : _map(map.begin(), map.end()), _value(value) {}
    189193   
     194    /// \brief Constructs a map from an other StdMap.
    190195    template<typename T1, typename Comp1>
    191     StdMap(const StdMap<Key, T1,Comp1> &m, const T &_v) {
    192       //FIXME;
     196    StdMap(const StdMap<Key, T1, Comp1> &c)
     197      : _map(c._map.begin(), c._map.end()), _value(c._value) {}
     198
     199  private:
     200
     201    StdMap& operator=(const StdMap&);
     202
     203  public:
     204
     205    ///\e
     206    Reference operator[](const Key &k) {
     207      typename Map::iterator it = _map.lower_bound(k);
     208      if (it != _map.end() && !_map.key_comp()(k, it->first))
     209        return it->second;
     210      else
     211        return _map.insert(it, std::make_pair(k, _value))->second;
    193212    }
    194213
    195     Reference operator[](const Key &k) {
    196       return insert(PairType(k,v)).first -> second;
     214    /// \e
     215    ConstReference operator[](const Key &k) const {
     216      typename Map::const_iterator it = _map.find(k);
     217      if (it != _map.end())
     218        return it->second;
     219      else
     220        return _value;
    197221    }
    198222
    199     ConstReference operator[](const Key &k) const {
    200       typename parent::iterator i = lower_bound(k);
    201       if (i == parent::end() || parent::key_comp()(k, (*i).first))
    202         return v;
    203       return (*i).second;
     223    /// \e
     224    void set(const Key &k, const T &t) {
     225      typename Map::iterator it = _map.lower_bound(k);
     226      if (it != _map.end() && !_map.key_comp()(k, it->first))
     227        it->second = t;
     228      else
     229        _map.insert(it, std::make_pair(k, t));
    204230    }
    205     void set(const Key &k, const T &t) {
    206       parent::operator[](k) = t;
    207     }
    208 
    209     /// Changes the default value of the map.
    210     /// \return Returns the previous default value.
    211     ///
    212     /// \warning The value of some keys (which has already been queried, but
    213     /// the value has been unchanged from the default) may change!
    214     T setDefault(const T &_v) { T old=v; v=_v; return old; }
    215 
    216     template<typename T1>
     231
     232    /// \e
     233    void setAll(const T &t) {
     234      _value = t;
     235      _map.clear();
     236    }   
     237
     238    template <typename T1, typename C1 = std::less<T1> >
    217239    struct rebind {
    218       typedef StdMap<Key, T1,Compare> other;
     240      typedef StdMap<Key, T1, C1> other;
    219241    };
    220242  };
     
    236258    typedef typename Parent::Value Value;
    237259
     260    /// \e
    238261    const T& operator[](const T& t) const {
    239262      return t;
     
    241264  };
    242265
    243   ///Returns an \ref IdentityMap class
    244 
    245   ///This function just returns an \ref IdentityMap class.
     266  ///Returns an \c IdentityMap class
     267
     268  ///This function just returns an \c IdentityMap class.
    246269  ///\relates IdentityMap
    247270  template<typename T>
     
    253276  ///Convert the \c Value of a map to another type.
    254277
    255   ///This \ref concepts::ReadMap "read only map"
     278  ///This \c concepts::ReadMap "read only map"
    256279  ///converts the \c Value of a maps to type \c T.
    257280  ///Its \c Key is inherited from \c M.
     
    278301  };
    279302 
    280   ///Returns an \ref ConvertMap class
    281 
    282   ///This function just returns an \ref ConvertMap class.
     303  ///Returns an \c ConvertMap class
     304
     305  ///This function just returns an \c ConvertMap class.
    283306  ///\relates ConvertMap
    284   ///\todo The order of the template parameters are changed.
    285307  template<typename T, typename M>
    286308  inline ConvertMap<M, T> convertMap(const M &m) {
     
    290312  ///Simple wrapping of the map
    291313
    292   ///This \ref concepts::ReadMap "read only map" returns the simple
     314  ///This \c concepts::ReadMap "read only map" returns the simple
    293315  ///wrapping of the given map. Sometimes the reference maps cannot be
    294316  ///combined with simple read maps. This map adaptor wraps the given
     
    305327    ///Constructor
    306328    SimpleMap(const M &_m) : m(_m) {};
     329    ///\e
    307330    Value operator[](Key k) const {return m[k];}
    308331  };
     
    310333  ///Simple writeable wrapping of the map
    311334
    312   ///This \ref concepts::ReadMap "read only map" returns the simple
     335  ///This \c concepts::ReadMap "read only map" returns the simple
    313336  ///wrapping of the given map. Sometimes the reference maps cannot be
    314337  ///combined with simple read-write maps. This map adaptor wraps the
     
    325348    ///Constructor
    326349    SimpleWriteMap(M &_m) : m(_m) {};
     350    ///\e
    327351    Value operator[](Key k) const {return m[k];}
     352    ///\e
    328353    void set(Key k, const Value& c) { m.set(k, c); }
    329354  };
     
    331356  ///Sum of two maps
    332357
    333   ///This \ref concepts::ReadMap "read only map" returns the sum of the two
     358  ///This \c concepts::ReadMap "read only map" returns the sum of the two
    334359  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
    335360  ///The \c Key and \c Value of M2 must be convertible to those of \c M1.
     
    347372    ///Constructor
    348373    AddMap(const M1 &_m1,const M2 &_m2) : m1(_m1), m2(_m2) {};
     374    ///\e
    349375    Value operator[](Key k) const {return m1[k]+m2[k];}
    350376  };
    351377 
    352   ///Returns an \ref AddMap class
    353 
    354   ///This function just returns an \ref AddMap class.
     378  ///Returns an \c AddMap class
     379
     380  ///This function just returns an \c AddMap class.
    355381  ///\todo How to call these type of functions?
    356382  ///
    357383  ///\relates AddMap
    358   ///\todo Wrong scope in Doxygen when \c \\relates is used
    359384  template<typename M1, typename M2>
    360385  inline AddMap<M1, M2> addMap(const M1 &m1,const M2 &m2) {
     
    364389  ///Shift a map with a constant.
    365390
    366   ///This \ref concepts::ReadMap "read only map" returns the sum of the
     391  ///This \c concepts::ReadMap "read only map" returns the sum of the
    367392  ///given map and a constant value.
    368393  ///Its \c Key and \c Value is inherited from \c M.
     
    392417    ///\param _v is the shift value
    393418    ShiftMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
     419    ///\e
    394420    Value operator[](Key k) const {return m[k] + v;}
    395421  };
     
    397423  ///Shift a map with a constant.
    398424
    399   ///This \ref concepts::ReadWriteMap "read-write map" returns the sum of the
     425  ///This \c concepts::ReadWriteMap "read-write map" returns the sum of the
    400426  ///given map and a constant value. It makes also possible to write the map.
    401427  ///Its \c Key and \c Value is inherited from \c M.
     
    425451    ///\param _v is the shift value
    426452    ShiftWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
     453    /// \e
    427454    Value operator[](Key k) const {return m[k] + v;}
     455    /// \e
    428456    void set(Key k, const Value& c) { m.set(k, c - v); }
    429457  };
    430458 
    431   ///Returns an \ref ShiftMap class
    432 
    433   ///This function just returns an \ref ShiftMap class.
     459  ///Returns an \c ShiftMap class
     460
     461  ///This function just returns an \c ShiftMap class.
    434462  ///\relates ShiftMap
    435   ///\todo A better name is required.
    436463  template<typename M, typename C>
    437464  inline ShiftMap<M, C> shiftMap(const M &m,const C &v) {
     
    446473  ///Difference of two maps
    447474
    448   ///This \ref concepts::ReadMap "read only map" returns the difference
     475  ///This \c concepts::ReadMap "read only map" returns the difference
    449476  ///of the values of the two
    450477  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
     
    462489    ///Constructor
    463490    SubMap(const M1 &_m1,const M2 &_m2) : m1(_m1), m2(_m2) {};
     491    /// \e
    464492    Value operator[](Key k) const {return m1[k]-m2[k];}
    465493  };
    466494 
    467   ///Returns a \ref SubMap class
    468 
    469   ///This function just returns a \ref SubMap class.
     495  ///Returns a \c SubMap class
     496
     497  ///This function just returns a \c SubMap class.
    470498  ///
    471499  ///\relates SubMap
     
    477505  ///Product of two maps
    478506
    479   ///This \ref concepts::ReadMap "read only map" returns the product of the
     507  ///This \c concepts::ReadMap "read only map" returns the product of the
    480508  ///values of the two
    481509  ///given
     
    494522    ///Constructor
    495523    MulMap(const M1 &_m1,const M2 &_m2) : m1(_m1), m2(_m2) {};
     524    /// \e
    496525    Value operator[](Key k) const {return m1[k]*m2[k];}
    497526  };
    498527 
    499   ///Returns a \ref MulMap class
    500 
    501   ///This function just returns a \ref MulMap class.
     528  ///Returns a \c MulMap class
     529
     530  ///This function just returns a \c MulMap class.
    502531  ///\relates MulMap
    503532  template<typename M1, typename M2>
     
    508537  ///Scales a maps with a constant.
    509538
    510   ///This \ref concepts::ReadMap "read only map" returns the value of the
     539  ///This \c concepts::ReadMap "read only map" returns the value of the
    511540  ///given map multiplied from the left side with a constant value.
    512541  ///Its \c Key and \c Value is inherited from \c M.
     
    536565    ///\param _v is the scaling value
    537566    ScaleMap(const M &_m, const C &_v ) : m(_m), v(_v) {};
     567    /// \e
    538568    Value operator[](Key k) const {return v * m[k];}
    539569  };
     
    541571  ///Scales a maps with a constant.
    542572
    543   ///This \ref concepts::ReadWriteMap "read-write map" returns the value of the
     573  ///This \c concepts::ReadWriteMap "read-write map" returns the value of the
    544574  ///given map multiplied from the left side with a constant value. It can
    545575  ///be used as write map also if the given multiplier is not zero.
     
    560590    ///\param _v is the scaling value
    561591    ScaleWriteMap(M &_m, const C &_v ) : m(_m), v(_v) {};
     592    /// \e
    562593    Value operator[](Key k) const {return v * m[k];}
     594    /// \e
    563595    void set(Key k, const Value& c) { m.set(k, c / v);}
    564596  };
    565597 
    566   ///Returns an \ref ScaleMap class
    567 
    568   ///This function just returns an \ref ScaleMap class.
     598  ///Returns an \c ScaleMap class
     599
     600  ///This function just returns an \c ScaleMap class.
    569601  ///\relates ScaleMap
    570   ///\todo A better name is required.
    571602  template<typename M, typename C>
    572603  inline ScaleMap<M, C> scaleMap(const M &m,const C &v) {
     
    581612  ///Quotient of two maps
    582613
    583   ///This \ref concepts::ReadMap "read only map" returns the quotient of the
     614  ///This \c concepts::ReadMap "read only map" returns the quotient of the
    584615  ///values of the two
    585616  ///given maps. Its \c Key and \c Value will be inherited from \c M1.
     
    597628    ///Constructor
    598629    DivMap(const M1 &_m1,const M2 &_m2) : m1(_m1), m2(_m2) {};
     630    /// \e
    599631    Value operator[](Key k) const {return m1[k]/m2[k];}
    600632  };
    601633 
    602   ///Returns a \ref DivMap class
    603 
    604   ///This function just returns a \ref DivMap class.
     634  ///Returns a \c DivMap class
     635
     636  ///This function just returns a \c DivMap class.
    605637  ///\relates DivMap
    606638  template<typename M1, typename M2>
     
    611643  ///Composition of two maps
    612644
    613   ///This \ref concepts::ReadMap "read only map" returns the composition of
     645  ///This \c concepts::ReadMap "read only map" returns the composition of
    614646  ///two
    615647  ///given maps. That is to say, if \c m1 is of type \c M1 and \c m2 is
     
    625657  ///The \c M2::Value must be convertible to \c M1::Key.
    626658  ///\todo Check the requirements.
    627 
    628659  template <typename M1, typename M2>
    629660  class ComposeMap : public MapBase<typename M2::Key, typename M1::Value> {
     
    639670   
    640671    typename MapTraits<M1>::ConstReturnValue
     672    /// \e
    641673    operator[](Key k) const {return m1[m2[k]];}
    642674  };
    643   ///Returns a \ref ComposeMap class
    644 
    645   ///This function just returns a \ref ComposeMap class.
     675  ///Returns a \c ComposeMap class
     676
     677  ///This function just returns a \c ComposeMap class.
    646678  ///
    647679  ///\relates ComposeMap
     
    656688  ///
    657689  ///
    658   ///This \ref concepts::ReadMap "read only map" takes two maps and a
     690  ///This \c concepts::ReadMap "read only map" takes two maps and a
    659691  ///binary functor and returns the composition of
    660692  ///the two
     
    673705  ///to \c V.
    674706  ///\todo Check the requirements.
    675 
    676707  template<typename M1, typename M2, typename F,
    677            typename V = typename F::result_type,
    678            typename NC = False>
     708           typename V = typename F::result_type>
    679709  class CombineMap : public MapBase<typename M1::Key, V> {
    680710    const M1& m1;
     
    687717
    688718    ///Constructor
    689     CombineMap(const M1 &_m1,const M2 &_m2,const F &_f)
     719    CombineMap(const M1 &_m1,const M2 &_m2,const F &_f = F())
    690720      : m1(_m1), m2(_m2), f(_f) {};
     721    /// \e
    691722    Value operator[](Key k) const {return f(m1[k],m2[k]);}
    692723  };
    693724 
    694   ///Returns a \ref CombineMap class
    695 
    696   ///This function just returns a \ref CombineMap class.
    697   ///
    698   ///Only the first template parameter (the value type) must be given.
     725  ///Returns a \c CombineMap class
     726
     727  ///This function just returns a \c CombineMap class.
    699728  ///
    700729  ///For example if \c m1 and \c m2 are both \c double valued maps, then
    701730  ///\code
    702   ///combineMap<double>(m1,m2,std::plus<double>)
     731  ///combineMap<double>(m1,m2,std::plus<double>())
    703732  ///\endcode
    704733  ///is equivalent with
     
    706735  ///addMap(m1,m2)
    707736  ///\endcode
     737  ///
     738  ///This function is specialized for adaptable binary function
     739  ///classes and c++ functions.
    708740  ///
    709741  ///\relates CombineMap
     
    728760  ///Negative value of a map
    729761
    730   ///This \ref concepts::ReadMap "read only map" returns the negative
     762  ///This \c concepts::ReadMap "read only map" returns the negative
    731763  ///value of the
    732764  ///value returned by the
     
    744776    ///Constructor
    745777    NegMap(const M &_m) : m(_m) {};
     778    /// \e
    746779    Value operator[](Key k) const {return -m[k];}
    747780  };
     
    749782  ///Negative value of a map
    750783
    751   ///This \ref concepts::ReadWriteMap "read-write map" returns the negative
     784  ///This \c concepts::ReadWriteMap "read-write map" returns the negative
    752785  ///value of the value returned by the
    753786  ///given map. Its \c Key and \c Value will be inherited from \c M.
     
    764797    ///Constructor
    765798    NegWriteMap(M &_m) : m(_m) {};
     799    /// \e
    766800    Value operator[](Key k) const {return -m[k];}
     801    /// \e
    767802    void set(Key k, const Value& v) { m.set(k, -v); }
    768803  };
    769804
    770   ///Returns a \ref NegMap class
    771 
    772   ///This function just returns a \ref NegMap class.
     805  ///Returns a \c NegMap class
     806
     807  ///This function just returns a \c NegMap class.
    773808  ///\relates NegMap
    774809  template <typename M>
     
    784819  ///Absolute value of a map
    785820
    786   ///This \ref concepts::ReadMap "read only map" returns the absolute value
     821  ///This \c concepts::ReadMap "read only map" returns the absolute value
    787822  ///of the
    788823  ///value returned by the
     
    815850    ///Constructor
    816851    AbsMap(const M &_m) : m(_m) {};
     852    /// \e
    817853    Value operator[](Key k) const {
    818854      Value tmp = m[k];
     
    822858  };
    823859 
    824   ///Returns a \ref AbsMap class
    825 
    826   ///This function just returns a \ref AbsMap class.
     860  ///Returns a \c AbsMap class
     861
     862  ///This function just returns a \c AbsMap class.
    827863  ///\relates AbsMap
    828864  template<typename M>
     
    833869  ///Converts an STL style functor to a map
    834870
    835   ///This \ref concepts::ReadMap "read only map" returns the value
     871  ///This \c concepts::ReadMap "read only map" returns the value
    836872  ///of a
    837873  ///given map.
     
    842878  ///
    843879  ///Parameter \c F is the type of the used functor.
    844  
    845 
    846880  template<typename F,
    847881           typename K = typename F::argument_type,
    848            typename V = typename F::result_type,
    849            typename NC = False>
     882           typename V = typename F::result_type>
    850883  class FunctorMap : public MapBase<K, V> {
    851884    F f;
     
    856889
    857890    ///Constructor
    858     FunctorMap(const F &_f) : f(_f) {}
    859 
     891    FunctorMap(const F &_f = F()) : f(_f) {}
     892    /// \e
    860893    Value operator[](Key k) const { return f(k);}
    861894  };
    862895 
    863   ///Returns a \ref FunctorMap class
    864 
    865   ///This function just returns a \ref FunctorMap class.
    866   ///
    867   ///The third template parameter isn't necessary to be given.
     896  ///Returns a \c FunctorMap class
     897
     898  ///This function just returns a \c FunctorMap class.
     899  ///
     900  ///It is specialized for adaptable function classes and
     901  ///c++ functions.
    868902  ///\relates FunctorMap
    869903  template<typename K, typename V, typename F> inline
     
    891925  ///
    892926  ///For the sake of convenience it also works as
    893   ///a ususal \ref concepts::ReadMap "readable map",
     927  ///a ususal \c concepts::ReadMap "readable map",
    894928  ///i.e. <tt>operator[]</tt> and the \c Key and \c Value typedefs also exist.
    895 
    896929  template <typename M>
    897930  class MapFunctor : public MapBase<typename M::Key, typename M::Value> {
     
    902935    typedef typename Parent::Value Value;
    903936
    904     ///\e
    905937    typedef typename M::Key argument_type;
    906     ///\e
    907938    typedef typename M::Value result_type;
    908939
    909940    ///Constructor
    910941    MapFunctor(const M &_m) : m(_m) {};
    911     ///Returns a value of the map
     942    ///\e
    912943    Value operator()(Key k) const {return m[k];}
    913944    ///\e
     
    915946  };
    916947 
    917   ///Returns a \ref MapFunctor class
    918 
    919   ///This function just returns a \ref MapFunctor class.
     948  ///Returns a \c MapFunctor class
     949
     950  ///This function just returns a \c MapFunctor class.
    920951  ///\relates MapFunctor
    921952  template<typename M>
     
    926957  ///Applies all map setting operations to two maps
    927958
    928   ///This map has two \ref concepts::ReadMap "readable map"
     959  ///This map has two \c concepts::ReadMap "readable map"
    929960  ///parameters and each read request will be passed just to the
    930961  ///first map. This class is the just readable map type of the ForkWriteMap.
     
    932963  ///The \c Key and \c Value will be inherited from \c M1.
    933964  ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
    934 
    935965  template<typename  M1, typename M2>
    936966  class ForkMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    944974    ///Constructor
    945975    ForkMap(const M1 &_m1, const M2 &_m2) : m1(_m1), m2(_m2) {};
     976    /// \e
    946977    Value operator[](Key k) const {return m1[k];}
    947978  };
     
    950981  ///Applies all map setting operations to two maps
    951982
    952   ///This map has two \ref concepts::WriteMap "writable map"
     983  ///This map has two \c concepts::WriteMap "writable map"
    953984  ///parameters and each write request will be passed to both of them.
    954   ///If \c M1 is also \ref concepts::ReadMap "readable",
     985  ///If \c M1 is also \c concepts::ReadMap "readable",
    955986  ///then the read operations will return the
    956987  ///corresponding values of \c M1.
     
    958989  ///The \c Key and \c Value will be inherited from \c M1.
    959990  ///The \c Key and \c Value of M2 must be convertible from those of \c M1.
    960 
    961991  template<typename  M1, typename M2>
    962992  class ForkWriteMap : public MapBase<typename M1::Key, typename M1::Value> {
     
    9701000    ///Constructor
    9711001    ForkWriteMap(M1 &_m1, M2 &_m2) : m1(_m1), m2(_m2) {};
     1002    ///\e
    9721003    Value operator[](Key k) const {return m1[k];}
     1004    ///\e
    9731005    void set(Key k, const Value &v) {m1.set(k,v); m2.set(k,v);}
    9741006  };
    9751007 
    976   ///Returns an \ref ForkMap class
    977 
    978   ///This function just returns an \ref ForkMap class.
    979   ///\todo How to call these type of functions?
     1008  ///Returns an \c ForkMap class
     1009
     1010  ///This function just returns an \c ForkMap class.
    9801011  ///
    9811012  ///\relates ForkMap
    982   ///\todo Wrong scope in Doxygen when \c \\relates is used
    9831013  template <typename M1, typename M2>
    9841014  inline ForkMap<M1, M2> forkMap(const M1 &m1, const M2 &m2) {
     
    9971027  ///Logical 'not' of a map
    9981028 
    999   ///This bool \ref concepts::ReadMap "read only map" returns the
     1029  ///This bool \c concepts::ReadMap "read only map" returns the
    10001030  ///logical negation of
    10011031  ///value returned by the
    10021032  ///given map. Its \c Key and will be inherited from \c M,
    10031033  ///its Value is <tt>bool</tt>.
    1004 
    10051034  template <typename M>
    10061035  class NotMap : public MapBase<typename M::Key, bool> {
     
    10131042    /// Constructor
    10141043    NotMap(const M &_m) : m(_m) {};
     1044    ///\e
    10151045    Value operator[](Key k) const {return !m[k];}
    10161046  };
     
    10181048  ///Logical 'not' of a map with writing possibility
    10191049 
    1020   ///This bool \ref concepts::ReadWriteMap "read-write map" returns the
     1050  ///This bool \c concepts::ReadWriteMap "read-write map" returns the
    10211051  ///logical negation of value returned by the given map. When it is set,
    10221052  ///the opposite value is set to the original map.
     
    10331063    /// Constructor
    10341064    NotWriteMap(M &_m) : m(_m) {};
     1065    ///\e
    10351066    Value operator[](Key k) const {return !m[k];}
     1067    ///\e
    10361068    void set(Key k, bool v) { m.set(k, !v); }
    10371069  };
    10381070 
    1039   ///Returns a \ref NotMap class
    1040  
    1041   ///This function just returns a \ref NotMap class.
     1071  ///Returns a \c NotMap class
     1072 
     1073  ///This function just returns a \c NotMap class.
    10421074  ///\relates NotMap
    10431075  template <typename M>
     
    12781310  /// }
    12791311  ///\endcode
    1280 
    12811312  template <typename Map>
    12821313  class FillBoolMap {
     
    13261357  /// Writable bool map which stores for each true assigned elements 
    13271358  /// the setting order number. It make easy to calculate the leaving
    1328   /// order of the nodes in the \ref dfs "Dfs" algorithm.
     1359  /// order of the nodes in the \c Dfs algorithm.
    13291360  ///
    13301361  ///\code
Note: See TracChangeset for help on using the changeset viewer.