COIN-OR::LEMON - Graph Library

Changeset 987:87f7c54892df in lemon-0.x


Ignore:
Timestamp:
11/13/04 18:07:10 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
Message:

Naming changes:

Files:
37 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r928 r987  
     1        * ValueType -> Value, KeyType -> Key, ReferenceType ->Reference,
     2          PointerType -> Pointer
     3        * target() -> target(), source() -> source()
     4        * Graph factory
     5        * Right include paths in documentation
     6       
    172004-09-30  Alpar Juttner  <alpar@cs.elte.hu>
    28
  • doc/maps.dox

    r986 r987  
    1010
    1111\code
    12   typedef Edge KeyType;
    13   typedef double ValueType;
     12  typedef Edge Key;
     13  typedef double Value;
    1414\endcode
    1515
     
    5353\endcode
    5454- <em>Writable maps</em> have
    55 a member function \c set(KeyType,const ValueType &)
     55a member function \c set(Key,const Value &)
    5656for this purpose.
    5757\code
     
    8383struct MyMap
    8484{
    85   typedef double ValueType;
    86   typedef Graph::Edge KeyType;
    87   double operator[](KeyType e) const { return M_PI;}
     85  typedef double Value;
     86  typedef Graph::Edge Key;
     87  double operator[](Key e) const { return M_PI;}
    8888};
    8989\endcode
     
    9696struct MyMap : public MapBase<Graph::Edge,double>
    9797{
    98   ValueType operator[](KeyType e) const { return M_PI;}
     98  Value operator[](Key e) const { return M_PI;}
    9999};
    100100\endcode
     
    112112 
    113113public:
    114   ValueType operator[](KeyType e) const {
     114  Value operator[](Key e) const {
    115115    return orig_len.get(e)-pot.get(G.target(e))-pot.get(G.source(e));
    116116  }
  • src/lemon/array_map.h

    r980 r987  
    3939   *
    4040   *  The template parameter is the MapRegistry that the maps
    41    *  will belong to and the ValueType.
     41   *  will belong to and the Value.
    4242   */
    4343
     
    5353    typedef _Graph Graph;
    5454    /// The key type of the maps.
    55     typedef _Item KeyType;
     55    typedef _Item Key;
    5656
    5757    typedef AlterationObserverRegistry<_Item> Registry;
     
    6161    typedef _ItemIt KeyIt;
    6262
    63     typedef _Value Value;
    64 
    6563    /// The MapBase of the Map which imlements the core regisitry function.
    6664    typedef typename Registry::ObserverBase Parent;
     
    7068
    7169    /// The value type of the map.
    72     typedef Value ValueType;
     70    typedef _Value Value;
    7371    /// The reference type of the map;
    74     typedef Value& ReferenceType;
     72    typedef Value& Reference;
    7573    /// The pointer type of the map;
    76     typedef Value* PointerType;
     74    typedef Value* Pointer;
    7775
    7876    /// The const value type of the map.
    79     typedef const Value ConstValueType;
     77    typedef const Value ConstValue;
    8078    /// The const reference type of the map;
    81     typedef const Value& ConstReferenceType;
     79    typedef const Value& ConstReference;
    8280    /// The pointer type of the map;
    83     typedef const Value* ConstPointerType;
     81    typedef const Value* ConstPointer;
    8482
    8583
     
    173171     * actual keys of the graph.
    174172     */
    175     ReferenceType operator[](const KeyType& key) {
     173    Reference operator[](const Key& key) {
    176174      int id = graph->id(key);
    177175      return values[id];
     
    182180     * actual keys of the graph.
    183181     */
    184     ConstReferenceType operator[](const KeyType& key) const {
     182    ConstReference operator[](const Key& key) const {
    185183      int id = graph->id(key);
    186184      return values[id];
     
    190188     *  This is a compatibility feature with the not dereferable maps.
    191189     */
    192     void set(const KeyType& key, const ValueType& val) {
     190    void set(const Key& key, const Value& val) {
    193191      (*this)[key] = val;
    194192    }
     
    196194    /** Add a new key to the map. It called by the map registry.
    197195     */
    198     void add(const KeyType& key) {
     196    void add(const Key& key) {
    199197      int id = graph->id(key);
    200198      if (id >= capacity) {
     
    220218    /** Erase a key from the map. It called by the map registry.
    221219     */
    222     void erase(const KeyType& key) {
     220    void erase(const Key& key) {
    223221      int id = graph->id(key);
    224222      allocator.destroy(&(values[id]));
     
    322320//     typedef Iterator iterator;
    323321//     typedef ConstIterator const_iterator;
    324 //     typedef typename Iterator::PairValueType value_type;
    325 //     typedef typename Iterator::KeyType key_type;
    326 //     typedef typename Iterator::ValueType data_type;
    327 //     typedef typename Iterator::PairReferenceType reference;
    328 //     typedef typename Iterator::PairPointerType pointer;
    329 //     typedef typename ConstIterator::PairReferenceType const_reference;
    330 //     typedef typename ConstIterator::PairPointerType const_pointer;
     322//     typedef typename Iterator::PairValue value_type;
     323//     typedef typename Iterator::Key key_type;
     324//     typedef typename Iterator::Value data_type;
     325//     typedef typename Iterator::PairReference reference;
     326//     typedef typename Iterator::PairPointer pointer;
     327//     typedef typename ConstIterator::PairReference const_reference;
     328//     typedef typename ConstIterator::PairPointer const_pointer;
    331329//     typedef int difference_type;             
    332330  };           
  • src/lemon/concept/graph.h

    r986 r987  
    568568//      {
    569569//        //Check the typedef's
    570 //        typename Graph::template NodeMap<int>::ValueType val;
     570//        typename Graph::template NodeMap<int>::Value val;
    571571//        val=1;
    572 //        typename Graph::template NodeMap<int>::KeyType key;
     572//        typename Graph::template NodeMap<int>::Key key;
    573573//        key = typename Graph::NodeIt(G);
    574574//      }
     
    592592//      {
    593593//        //Check the typedef's
    594 //        typename Graph::template NodeMap<bool>::ValueType val;
     594//        typename Graph::template NodeMap<bool>::Value val;
    595595//        val=true;
    596 //        typename Graph::template NodeMap<bool>::KeyType key;
     596//        typename Graph::template NodeMap<bool>::Key key;
    597597//        key= typename Graph::NodeIt(G);
    598598//      }
     
    615615//      {
    616616//        //Check the typedef's
    617 //        typename Graph::template EdgeMap<int>::ValueType val;
     617//        typename Graph::template EdgeMap<int>::Value val;
    618618//        val=1;
    619 //        typename Graph::template EdgeMap<int>::KeyType key;
     619//        typename Graph::template EdgeMap<int>::Key key;
    620620//        key= typename Graph::EdgeIt(G);
    621621//      }
     
    638638//      {
    639639//        //Check the typedef's
    640 //        typename Graph::template EdgeMap<bool>::ValueType val;
     640//        typename Graph::template EdgeMap<bool>::Value val;
    641641//        val=true;
    642 //        typename Graph::template EdgeMap<bool>::KeyType key;
     642//        typename Graph::template EdgeMap<bool>::Key key;
    643643//        key= typename Graph::EdgeIt(G);
    644644//      }
  • src/lemon/concept/graph_component.h

    r986 r987  
    678678      typedef BaseGraphComponent::Edge Edge;
    679679
    680       template <typename Value>
    681       class NodeMap : public ReferenceMap<Node, Value> {
     680      template <typename _Value>
     681      class NodeMap : public ReferenceMap<Node, _Value> {
    682682      public:
    683683        NodeMap(const Graph&) {}
    684         NodeMap(const Graph&, const Value&) {}
     684        NodeMap(const Graph&, const _Value&) {}
    685685        NodeMap(const NodeMap&) {}
    686686
     
    689689      };
    690690
    691       template <typename Value>
    692       class EdgeMap : public ReferenceMap<Edge, Value> {
     691      template <typename _Value>
     692      class EdgeMap : public ReferenceMap<Edge, _Value> {
    693693      public:
    694694        EdgeMap(const Graph&) {}
    695         EdgeMap(const Graph&, const Value&) {}
     695        EdgeMap(const Graph&, const _Value&) {}
    696696        EdgeMap(const EdgeMap&) {}
    697697
  • src/lemon/concept/maps.h

    r959 r987  
    3737    public:
    3838      /// Map's key type.
    39       typedef K KeyType;   
    40       /// Map's value type. (The type of objects associated with the keys).
    41       typedef T ValueType;
     39      typedef K Key;   
     40      /// Map's value type. (The type of objects associated with the keys).
     41      typedef T Value;
    4242
    4343      /// Returns the value associated with a key.
    44       ValueType operator[](const KeyType &k) const {return ValueType();}
     44      Value operator[](const Key &k) const {return Value();}
    4545
    4646      ///Default constructor
     
    5555    public:
    5656      /// Map's key type.
    57       typedef K KeyType;   
    58       /// Map's value type. (The type of objects associated with the keys).
    59       typedef T ValueType;
     57      typedef K Key;   
     58      /// Map's value type. (The type of objects associated with the keys).
     59      typedef T Value;
    6060
    6161      /// Sets the value associated with a key.
    62       void set(const KeyType &k,const ValueType &t) {}
     62      void set(const Key &k,const Value &t) {}
    6363
    6464      ///Default constructor
     
    7373    public:
    7474      /// Map's key type.
    75       typedef K KeyType;   
    76       /// Map's value type. (The type of objects associated with the keys).
    77       typedef T ValueType;
     75      typedef K Key;   
     76      /// Map's value type. (The type of objects associated with the keys).
     77      typedef T Value;
    7878
    7979      /// Returns the value associated with a key.
    80       ValueType operator[](const KeyType &k) const {return ValueType();}
     80      Value operator[](const Key &k) const {return Value();}
    8181      /// Sets the value associated with a key.
    82       void set(const KeyType &k,const ValueType &t) {}
     82      void set(const Key &k,const Value &t) {}
    8383
    8484      ///Default constructor
     
    9393    public:
    9494      /// Map's key type.
    95       typedef K KeyType;   
    96       /// Map's value type. (The type of objects associated with the keys).
    97       typedef T ValueType;
     95      typedef K Key;   
     96      /// Map's value type. (The type of objects associated with the keys).
     97      typedef T Value;
    9898
    9999    protected:
    100       ValueType tmp;
    101     public:
    102       typedef ValueType& ReferenceType;
     100      Value tmp;
     101    public:
     102      typedef Value& Reference;
    103103      /// Map's const reference type.
    104       typedef const ValueType& ConstReferenceType;
     104      typedef const Value& ConstReference;
    105105
    106106      ///Returns a reference to the value associated to a key.
    107       ReferenceType operator[](const KeyType &i) { return tmp; }
     107      Reference operator[](const Key &i) { return tmp; }
    108108      ///Returns a const reference to the value associated to a key.
    109       ConstReferenceType operator[](const KeyType &i) const
     109      ConstReference operator[](const Key &i) const
    110110      { return tmp; }
    111111      /// Sets the value associated with a key.
    112       void set(const KeyType &k,const ValueType &t) { operator[](k)=t; }
     112      void set(const Key &k,const Value &t) { operator[](k)=t; }
    113113
    114114      ///Default constructor
     
    150150    template<typename ReadMap>
    151151    struct ReadMapConcept {
    152       typedef typename ReadMap::KeyType KeyType;
    153       typedef typename ReadMap::ValueType ValueType;
     152      typedef typename ReadMap::Key Key;
     153      typedef typename ReadMap::Value Value;
    154154
    155155      void constraints() {
    156156        // No constraints for constructor.
    157157
    158         // What are the requirement for the ValueType?
     158        // What are the requirement for the Value?
    159159        // CopyConstructible? Assignable? None of these?
    160         ValueType v = m[k];
     160        Value v = m[k];
    161161        v = m[k];
    162162
     
    166166
    167167      ReadMap m;
    168       KeyType k;
     168      Key k;
    169169    };
    170170
    171171    template<typename WriteMap>
    172172    struct WriteMapConcept {
    173       typedef typename WriteMap::KeyType KeyType;
    174       typedef typename WriteMap::ValueType ValueType;
     173      typedef typename WriteMap::Key Key;
     174      typedef typename WriteMap::Value Value;
    175175
    176176      void constraints() {
     
    181181
    182182      WriteMap m;
    183       KeyType k;
    184       ValueType v;
     183      Key k;
     184      Value v;
    185185    };
    186186
     
    195195    template<typename ReferenceMap>
    196196    struct ReferenceMapConcept {
    197       typedef typename ReferenceMap::KeyType KeyType;
    198       typedef typename ReferenceMap::ValueType ValueType;
    199       typedef typename ReferenceMap::ReferenceType ReferenceType;
     197      typedef typename ReferenceMap::Key Key;
     198      typedef typename ReferenceMap::Value Value;
     199      typedef typename ReferenceMap::Reference Reference;
    200200
    201201      // What for is this?
    202       typedef typename ReferenceMap::ConstReferenceType ConstReferenceType;
     202      typedef typename ReferenceMap::ConstReference ConstReference;
    203203
    204204      void constraints() {
     
    208208        // Or should we require real reference?
    209209        // Like this:
    210         // ValueType &vv = m[k];
     210        // Value &vv = m[k];
    211211        // ignore_unused_variable_warning(vv);
    212212      }
    213213
    214214      ReferenceMap m;
    215       KeyType k;
    216       ValueType v;
     215      Key k;
     216      Value v;
    217217    };
    218218
     
    236236      const GraphMap &c;
    237237      const Graph &g;
    238       const typename GraphMap::ValueType &t;
     238      const typename GraphMap::Value &t;
    239239    };
    240240   
  • src/lemon/default_map.h

    r980 r987  
    3434  /** The ArrayMap template class is graph map structure what
    3535   *  automatically updates the map when a key is added to or erased from
    36    *  the map. This map uses the VectorMap if the ValueType is a primitive
     36   *  the map. This map uses the VectorMap if the Value is a primitive
    3737   *  type and the ArrayMap for the other cases.
    3838   *
    3939   *  The template parameter is the MapRegistry that the maps
    40    *  will belong to and the ValueType.
     40   *  will belong to and the Value.
    4141   */
    4242
     
    148148   
    149149    typedef typename Parent::Graph Graph;
    150     typedef typename Parent::ValueType ValueType;
     150    typedef typename Parent::Value Value;
    151151
    152152    DefaultMap(const Graph& _g) : Parent(_g) {}
    153     DefaultMap(const Graph& _g, const ValueType& _v) : Parent(_g, _v) {}
     153    DefaultMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {}
    154154  };
    155155
     
    181181
    182182      //typedef typename Parent::Graph Graph;
    183       typedef typename Parent::ValueType ValueType;
     183      typedef typename Parent::Value Value;
    184184
    185185      NodeMap(const Graph& _g)
    186186        : Parent(_g) {}
    187       NodeMap(const Graph& _g, const ValueType& _v)
     187      NodeMap(const Graph& _g, const Value& _v)
    188188        : Parent(_g, _v) {}
    189189
     
    201201
    202202      //typedef typename Parent::Graph Graph;
    203       typedef typename Parent::ValueType ValueType;
     203      typedef typename Parent::Value Value;
    204204
    205205      EdgeMap(const Graph& _g)
    206206        : Parent(_g) {}
    207       EdgeMap(const Graph& _g, const ValueType& _v)
     207      EdgeMap(const Graph& _g, const Value& _v)
    208208        : Parent(_g, _v) {}
    209209
  • src/lemon/dijkstra.h

    r986 r987  
    3838  ///
    3939  ///The type of the length is determined by the
    40   ///\ref concept::ReadMap::ValueType "ValueType" of the length map.
     40  ///\ref concept::ReadMap::Value "Value" of the length map.
    4141  ///
    4242  ///It is also possible to change the underlying priority heap.
     
    8282   
    8383    ///The type of the length of the edges.
    84     typedef typename LM::ValueType ValueType;
     84    typedef typename LM::Value Value;
    8585    ///The type of the map that stores the edge lengths.
    8686    typedef LM LengthMap;
     
    9292    typedef typename Graph::template NodeMap<Node> PredNodeMap;
    9393    ///The type of the map that stores the dists of the nodes.
    94     typedef typename Graph::template NodeMap<ValueType> DistMap;
     94    typedef typename Graph::template NodeMap<Value> DistMap;
    9595
    9696  private:
     
    238238      typename GR::template NodeMap<int> heap_map(*G,-1);
    239239     
    240       typedef Heap<Node, ValueType, typename GR::template NodeMap<int>,
    241       std::less<ValueType> >
     240      typedef Heap<Node, Value, typename GR::template NodeMap<int>,
     241      std::less<Value> >
    242242      HeapType;
    243243     
     
    249249       
    250250        Node v=heap.top();
    251         ValueType oldvalue=heap[v];
     251        Value oldvalue=heap[v];
    252252        heap.pop();
    253253        distance->set(v, oldvalue);
     
    282282    ///\warning If node \c v in unreachable from the root the return value
    283283    ///of this funcion is undefined.
    284     ValueType dist(Node v) const { return (*distance)[v]; }
     284    Value dist(Node v) const { return (*distance)[v]; }
    285285
    286286    ///Returns the 'previous edge' of the shortest path tree.
  • src/lemon/dimacs.h

    r986 r987  
    5151                  CostMap& cost) {
    5252    g.clear();
    53     typename CapacityMap::ValueType _cap;
    54     typename CostMap::ValueType _cost;
     53    typename CapacityMap::Value _cap;
     54    typename CostMap::Value _cost;
    5555    char d;
    5656    std::string problem;
  • src/lemon/graph_wrapper.h

    r986 r987  
    11221122      typename Graph::template EdgeMap<T> forward_map, backward_map;
    11231123    public:
    1124       typedef T ValueType;
    1125       typedef Edge KeyType;
     1124      typedef T Value;
     1125      typedef Edge Key;
    11261126
    11271127      EdgeMap(const SubBidirGraphWrapper<Graph,
     
    11511151      }
    11521152
    1153       typename Graph::template EdgeMap<T>::ConstReferenceType
     1153      typename Graph::template EdgeMap<T>::ConstReference
    11541154      operator[](Edge e) const {
    11551155        if (!e.backward)
     
    11591159      }
    11601160
    1161       typename Graph::template EdgeMap<T>::ReferenceType
     1161      typename Graph::template EdgeMap<T>::Reference
    11621162      operator[](Edge e) {
    11631163        if (!e.backward)
     
    13461346      const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>* res_graph;
    13471347    public:
    1348       typedef Number ValueType;
    1349       typedef Edge KeyType;
     1348      typedef Number Value;
     1349      typedef Edge Key;
    13501350      ResCap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>&
    13511351             _res_graph) : res_graph(&_res_graph) { }
  • src/lemon/kruskal.h

    r986 r987  
    113113    const Map &m;
    114114  public:
    115     typedef typename Map::ValueType ValueType;
     115    typedef typename Map::Value Value;
    116116
    117117    NonConstMapWr(const Map &_m) : m(_m) {}
    118118
    119     template<class KeyType>
    120     void set(KeyType const& k, ValueType const &v) const { m.set(k,v); }
     119    template<class Key>
     120    void set(Key const& k, Value const &v) const { m.set(k,v); }
    121121  };
    122122
     
    151151  class KruskalMapInput
    152152    : public std::vector< std::pair<typename GR::Edge,
    153                                     typename Map::ValueType> > {
     153                                    typename Map::Value> > {
    154154   
    155155  public:
    156156    typedef std::vector< std::pair<typename GR::Edge,
    157                                    typename Map::ValueType> > Parent;
     157                                   typename Map::Value> > Parent;
    158158    typedef typename Parent::value_type value_type;
    159159
     
    236236  /// wrapper function exists: \ref kruskalEdgeMap_IteratorOut().
    237237  ///
    238   /// \warning Not a regular property map, as it doesn't know its KeyType
     238  /// \warning Not a regular property map, as it doesn't know its Key
    239239
    240240  template<class Iterator>
     
    243243
    244244  public:
    245     typedef bool ValueType;
     245    typedef bool Value;
    246246
    247247    KruskalSequenceOutput(Iterator const &_it) : it(_it) {}
    248248
    249     template<typename KeyType>
    250     void set(KeyType const& k, bool v) const { if(v) {*it=k; ++it;} }
     249    template<typename Key>
     250    void set(Key const& k, bool v) const { if(v) {*it=k; ++it;} }
    251251  };
    252252
     
    288288  template <class GR, class IN, class RET>
    289289  inline
    290   typename IN::ValueType
     290  typename IN::Value
    291291  kruskalEdgeMap(GR const& G,
    292292                 IN const& in,
     
    333333  template <class GR, class IN, class RET>
    334334  inline
    335   typename IN::ValueType
     335  typename IN::Value
    336336  kruskalEdgeMap_IteratorOut(const GR& G,
    337337                             const IN& in,
  • src/lemon/map_defines.h

    r937 r987  
    5252 */
    5353#define CREATE_NODE_MAP(DynMap) \
    54 template <typename Value> \
    55 class NodeMap : public DynMap<NodeMapRegistry, Value> { \
    56 public: \
    57 typedef DynMap<NodeMapRegistry, Value> Parent; \
     54template <typename _Value> \
     55class NodeMap : public DynMap<NodeMapRegistry, _Value> { \
     56public: \
     57typedef DynMap<NodeMapRegistry, _Value> Parent; \
    5858NodeMap(const typename Parent::Graph& g) \
    5959  : Parent(g, g.node_maps) {} \
    60 NodeMap(const typename Parent::Graph& g, const Value& v) \
     60NodeMap(const typename Parent::Graph& g, const _Value& v) \
    6161  : Parent(g, g.node_maps, v) {} \
    6262NodeMap(const NodeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \
     
    8282 */
    8383#define CREATE_EDGE_MAP(DynMap) \
    84 template <typename Value> \
    85 class EdgeMap : public DynMap<EdgeMapRegistry, Value> { \
    86 public: \
    87 typedef DynMap<EdgeMapRegistry, Value> Parent; \
     84template <typename _Value> \
     85class EdgeMap : public DynMap<EdgeMapRegistry, _Value> { \
     86public: \
     87typedef DynMap<EdgeMapRegistry, _Value> Parent; \
    8888\
    8989EdgeMap(const typename Parent::Graph& g) \
    9090  : Parent(g, g.edge_maps) {} \
    91 EdgeMap(const typename Parent::Graph& g, const Value& v) \
     91EdgeMap(const typename Parent::Graph& g, const _Value& v) \
    9292  : Parent(g, g.edge_maps, v) {} \
    9393EdgeMap(const EdgeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \
     
    126126 */
    127127#define CREATE_SYM_EDGE_MAP(DynMap) \
    128 template <typename Value> \
    129 class SymEdgeMap : public DynMap<SymEdgeMapRegistry, Value> { \
    130 public: \
    131 typedef DynMap<SymEdgeMapRegistry, Value> Parent; \
     128template <typename _Value> \
     129class SymEdgeMap : public DynMap<SymEdgeMapRegistry, _Value> { \
     130public: \
     131typedef DynMap<SymEdgeMapRegistry, _Value> Parent; \
    132132\
    133133SymEdgeMap(const typename Parent::Graph& g) \
    134134  : Parent(g, g.sym_edge_maps) {} \
    135 SymEdgeMap(const typename Parent::Graph& g, const Value& v) \
     135SymEdgeMap(const typename Parent::Graph& g, const _Value& v) \
    136136  : Parent(g, g.sym_edge_maps, v) {} \
    137137SymEdgeMap(const SymEdgeMap& copy) \
     
    154154 */
    155155#define IMPORT_NODE_MAP(From, from, To, to) \
    156 template <typename Value> \
    157 class NodeMap : public From::template NodeMap<Value> { \
    158 \
    159 public: \
    160 typedef typename From::template NodeMap<Value> Parent; \
     156template <typename _Value> \
     157class NodeMap : public From::template NodeMap<_Value> { \
     158\
     159public: \
     160typedef typename From::template NodeMap<_Value> Parent; \
    161161\
    162162NodeMap(const To& to) \
    163163  : Parent(static_cast<const From&>(from)) { } \
    164 NodeMap(const To& to, const Value& value) \
     164NodeMap(const To& to, const _Value& value) \
    165165  : Parent(static_cast<const From&>(from), value) { } \
    166166NodeMap(const NodeMap& copy) \
     
    183183 */
    184184#define IMPORT_EDGE_MAP(From, from, To, to) \
    185 template <typename Value> \
    186 class EdgeMap : public From::template EdgeMap<Value> { \
    187 \
    188 public: \
    189 typedef typename From::template EdgeMap<Value> Parent; \
     185template <typename _Value> \
     186class EdgeMap : public From::template EdgeMap<_Value> { \
     187\
     188public: \
     189typedef typename From::template EdgeMap<_Value> Parent; \
    190190\
    191191EdgeMap(const To& to) \
    192192  : Parent(static_cast<const From&>(from)) { } \
    193 EdgeMap(const To& to, const Value& value) \
     193EdgeMap(const To& to, const _Value& value) \
    194194  : Parent(static_cast<const From&>(from), value) { } \
    195195EdgeMap(const EdgeMap& copy) \
  • src/lemon/map_iterator.h

    r921 r987  
    4242
    4343    /// The key type of the iterator.
    44     typedef typename Map::KeyType KeyType;
    45     /// The iterator to iterate on the keys.
    46     typedef typename Map::KeyIt KeyIt;
    47 
    48     /// The value type of the iterator.
    49     typedef typename Map::ValueType ValueType;
    50     /// The reference type of the iterator.
    51     typedef typename Map::ReferenceType ReferenceType;
    52     /// The pointer type of the iterator.
    53     typedef typename Map::PointerType PointerType;
    54 
    55     /// The const value type of the iterator.
    56     typedef typename Map::ConstValueType ConstValueType;
    57     /// The const reference type of the iterator.
    58     typedef typename Map::ConstReferenceType ConstReferenceType;
    59     /// The pointer type of the iterator.
    60     typedef typename Map::ConstPointerType ConstPointerType;
     44    typedef typename Map::Key Key;
     45    /// The iterator to iterate on the keys.
     46    typedef typename Map::KeyIt KeyIt;
     47
     48    /// The value type of the iterator.
     49    typedef typename Map::Value Value;
     50    /// The reference type of the iterator.
     51    typedef typename Map::Reference Reference;
     52    /// The pointer type of the iterator.
     53    typedef typename Map::Pointer Pointer;
     54
     55    /// The const value type of the iterator.
     56    typedef typename Map::ConstValue ConstValue;
     57    /// The const reference type of the iterator.
     58    typedef typename Map::ConstReference ConstReference;
     59    /// The pointer type of the iterator.
     60    typedef typename Map::ConstPointer ConstPointer;
    6161
    6262  protected:
     
    105105
    106106    /// The key type of the iterator.
    107     typedef typename Map::KeyType KeyType;
    108     /// The iterator to iterate on the keys.
    109     typedef typename Map::KeyIt KeyIt;
    110 
    111     /// The value type of the iterator.
    112     typedef typename Map::ValueType ValueType;
    113     /// The reference type of the iterator.
    114     typedef typename Map::ReferenceType ReferenceType;
    115     /// The pointer type of the iterator.
    116     typedef typename Map::PointerType PointerType;
    117 
    118     /// The const value type of the iterator.
    119     typedef typename Map::ConstValueType ConstValueType;
    120     /// The const reference type of the iterator.
    121     typedef typename Map::ConstReferenceType ConstReferenceType;
    122     /// The pointer type of the iterator.
    123     typedef typename Map::ConstPointerType ConstPointerType;
     107    typedef typename Map::Key Key;
     108    /// The iterator to iterate on the keys.
     109    typedef typename Map::KeyIt KeyIt;
     110
     111    /// The value type of the iterator.
     112    typedef typename Map::Value Value;
     113    /// The reference type of the iterator.
     114    typedef typename Map::Reference Reference;
     115    /// The pointer type of the iterator.
     116    typedef typename Map::Pointer Pointer;
     117
     118    /// The const value type of the iterator.
     119    typedef typename Map::ConstValue ConstValue;
     120    /// The const reference type of the iterator.
     121    typedef typename Map::ConstReference ConstReference;
     122    /// The pointer type of the iterator.
     123    typedef typename Map::ConstPointer ConstPointer;
    124124   
    125125  public:
    126126
    127127    /// The value type of the iterator.
    128     typedef extended_pair<KeyType, const KeyType&,
    129       ValueType, const ValueType&> PairValueType;
     128    typedef extended_pair<Key, const Key&,
     129      Value, const Value&> PairValue;
    130130
    131131    /// The reference type of the iterator.
    132     typedef extended_pair<const KeyType&, const KeyType&,
    133       ReferenceType, ReferenceType> PairReferenceType;
     132    typedef extended_pair<const Key&, const Key&,
     133      Reference, Reference> PairReference;
    134134
    135135    /// Default constructor.
     
    141141
    142142    /// Dereference operator for the iterator.
    143     PairReferenceType operator*() {
    144       return PairReferenceType(Base::it, (*map)[Base::it]);
    145     }
    146 
    147     /// The pointer type of the iterator.
    148     class PairPointerType {
     143    PairReference operator*() {
     144      return PairReference(Base::it, (*map)[Base::it]);
     145    }
     146
     147    /// The pointer type of the iterator.
     148    class PairPointer {
    149149      friend class MapIterator;
    150150    private:
    151       PairReferenceType data;
    152       PairPointerType(const KeyType& key, ReferenceType val)
     151      PairReference data;
     152      PairPointer(const Key& key, Reference val)
    153153        : data(key, val) {}
    154154    public:
    155       PairReferenceType* operator->() {return &data;}
     155      PairReference* operator->() {return &data;}
    156156    };
    157157
    158158    /// Arrow operator for the iterator.
    159     PairPointerType operator->() {
    160       return PairPointerType(Base::it, ((*map)[Base::it]));
     159    PairPointer operator->() {
     160      return PairPointer(Base::it, ((*map)[Base::it]));
    161161    }
    162162       
     
    181181    typedef std::forward_iterator_tag iterator_category;
    182182    typedef int difference_type;
    183     typedef PairValueType value_type;
    184     typedef PairReferenceType reference;
    185     typedef PairPointerType pointer;
     183    typedef PairValue value_type;
     184    typedef PairReference reference;
     185    typedef PairPointer pointer;
    186186  };
    187187
     
    198198
    199199    /// The key type of the iterator.
    200     typedef typename Map::KeyType KeyType;
    201     /// The iterator to iterate on the keys.
    202     typedef typename Map::KeyIt KeyIt;
    203 
    204     /// The value type of the iterator.
    205     typedef typename Map::ValueType ValueType;
    206     /// The reference type of the iterator.
    207     typedef typename Map::ReferenceType ReferenceType;
    208     /// The pointer type of the iterator.
    209     typedef typename Map::PointerType PointerType;
    210 
    211     /// The const value type of the iterator.
    212     typedef typename Map::ConstValueType ConstValueType;
    213     /// The const reference type of the iterator.
    214     typedef typename Map::ConstReferenceType ConstReferenceType;
    215     /// The pointer type of the iterator.
    216     typedef typename Map::ConstPointerType ConstPointerType;
     200    typedef typename Map::Key Key;
     201    /// The iterator to iterate on the keys.
     202    typedef typename Map::KeyIt KeyIt;
     203
     204    /// The value type of the iterator.
     205    typedef typename Map::Value Value;
     206    /// The reference type of the iterator.
     207    typedef typename Map::Reference Reference;
     208    /// The pointer type of the iterator.
     209    typedef typename Map::Pointer Pointer;
     210
     211    /// The const value type of the iterator.
     212    typedef typename Map::ConstValue ConstValue;
     213    /// The const reference type of the iterator.
     214    typedef typename Map::ConstReference ConstReference;
     215    /// The pointer type of the iterator.
     216    typedef typename Map::ConstPointer ConstPointer;
    217217
    218218  public:   
     
    233233
    234234    /// The value type of the iterator.
    235     typedef extended_pair<KeyType, const KeyType&,
    236       ValueType, const ValueType&> PairValueType;
     235    typedef extended_pair<Key, const Key&,
     236      Value, const Value&> PairValue;
    237237
    238238    /// The reference type of map.
    239     typedef extended_pair<const KeyType&, const KeyType&,
    240       ConstReferenceType, ConstReferenceType> PairReferenceType;
     239    typedef extended_pair<const Key&, const Key&,
     240      ConstReference, ConstReference> PairReference;
    241241
    242242    /// Dereference operator for the iterator.
    243     PairReferenceType operator*() {
    244       return PairReferenceType(Base::it, (*map)[Base::it]);
    245     }
    246 
    247     /// The pointer type of the iterator.
    248     class PairPointerType {
     243    PairReference operator*() {
     244      return PairReference(Base::it, (*map)[Base::it]);
     245    }
     246
     247    /// The pointer type of the iterator.
     248    class PairPointer {
    249249      friend class MapConstIterator;
    250250    private:
    251       PairReferenceType data;
    252       PairPointerType(const KeyType& key, ConstReferenceType val)
     251      PairReference data;
     252      PairPointer(const Key& key, ConstReference val)
    253253        : data(key, val) {}
    254254    public:
    255       PairReferenceType* operator->() {return &data;}
     255      PairReference* operator->() {return &data;}
    256256    };
    257257
    258258    /// Arrow operator for the iterator.
    259     PairPointerType operator->() {
    260       return PairPointerType(Base::it, (*map)[Base::it]);
     259    PairPointer operator->() {
     260      return PairPointer(Base::it, (*map)[Base::it]);
    261261    }
    262262
     
    281281    typedef std::input_iterator_tag iterator_category;
    282282    typedef int difference_type;
    283     typedef PairValueType value_type;
    284     typedef PairReferenceType reference;
    285     typedef PairPointerType pointer;
     283    typedef PairValue value_type;
     284    typedef PairReference reference;
     285    typedef PairPointer pointer;
    286286  };
    287287
     
    298298 
    299299    /// The key type of the iterator.
    300     typedef typename Map::KeyType KeyType;
     300    typedef typename Map::Key Key;
    301301    /// The iterator to iterate on the keys.
    302302    typedef typename Map::KeyIt KeyIt;
     
    324324
    325325    /// The dereferencing operator of the iterator.
    326     KeyType operator*() const {
    327       return static_cast<KeyType>(Base::it);
     326    Key operator*() const {
     327      return static_cast<Key>(Base::it);
    328328    }
    329329
     
    332332    typedef std::input_iterator_tag iterator_category;
    333333    typedef int difference_type;
    334     typedef KeyType value_type;
    335     typedef const KeyType& reference;
    336     typedef const KeyType* pointer;
     334    typedef Key value_type;
     335    typedef const Key& reference;
     336    typedef const Key* pointer;
    337337  };
    338338
     
    353353
    354354    /// The key type of the iterator.
    355     typedef typename Map::KeyType KeyType;
    356     /// The iterator to iterate on the keys.
    357     typedef typename Map::KeyIt KeyIt;
    358 
    359 
    360     /// The value type of the iterator.
    361     typedef typename Map::ValueType ValueType;
    362     /// The reference type of the iterator.
    363     typedef typename Map::ReferenceType ReferenceType;
    364     /// The pointer type of the iterator.
    365     typedef typename Map::PointerType PointerType;
    366 
    367     /// The const value type of the iterator.
    368     typedef typename Map::ConstValueType ConstValueType;
    369     /// The const reference type of the iterator.
    370     typedef typename Map::ConstReferenceType ConstReferenceType;
    371     /// The pointer type of the iterator.
    372     typedef typename Map::ConstPointerType ConstPointerType;
     355    typedef typename Map::Key Key;
     356    /// The iterator to iterate on the keys.
     357    typedef typename Map::KeyIt KeyIt;
     358
     359
     360    /// The value type of the iterator.
     361    typedef typename Map::Value Value;
     362    /// The reference type of the iterator.
     363    typedef typename Map::Reference Reference;
     364    /// The pointer type of the iterator.
     365    typedef typename Map::Pointer Pointer;
     366
     367    /// The const value type of the iterator.
     368    typedef typename Map::ConstValue ConstValue;
     369    /// The const reference type of the iterator.
     370    typedef typename Map::ConstReference ConstReference;
     371    /// The pointer type of the iterator.
     372    typedef typename Map::ConstPointer ConstPointer;
    373373
    374374  private:
     
    400400
    401401    /// The dereferencing operator of the iterator.
    402     ReferenceType operator*() const {
     402    Reference operator*() const {
    403403      return (*map)[Base::it];
    404404    }
    405405
    406406    /// The arrow operator of the iterator.
    407     PointerType operator->() const {
     407    Pointer operator->() const {
    408408      return &(operator*());
    409409    }
     
    413413    typedef std::forward_iterator_tag iterator_category;
    414414    typedef int difference_type;
    415     typedef ValueType value_type;
    416     typedef ReferenceType reference;
    417     typedef PointerType pointer;
     415    typedef Value value_type;
     416    typedef Reference reference;
     417    typedef Pointer pointer;
    418418  };
    419419
     
    431431
    432432    /// The key type of the iterator.
    433     typedef typename Map::KeyType KeyType;
    434     /// The iterator to iterate on the keys.
    435     typedef typename Map::KeyIt KeyIt;
    436 
    437     /// The value type of the iterator.
    438     typedef typename Map::ValueType ValueType;
    439     /// The reference type of the iterator.
    440     typedef typename Map::ReferenceType ReferenceType;
    441     /// The pointer type of the iterator.
    442     typedef typename Map::PointerType PointerType;
    443 
    444     /// The const value type of the iterator.
    445     typedef typename Map::ConstValueType ConstValueType;
    446     /// The const reference type of the iterator.
    447     typedef typename Map::ConstReferenceType ConstReferenceType;
    448     /// The pointer type of the iterator.
    449     typedef typename Map::ConstPointerType ConstPointerType;
     433    typedef typename Map::Key Key;
     434    /// The iterator to iterate on the keys.
     435    typedef typename Map::KeyIt KeyIt;
     436
     437    /// The value type of the iterator.
     438    typedef typename Map::Value Value;
     439    /// The reference type of the iterator.
     440    typedef typename Map::Reference Reference;
     441    /// The pointer type of the iterator.
     442    typedef typename Map::Pointer Pointer;
     443
     444    /// The const value type of the iterator.
     445    typedef typename Map::ConstValue ConstValue;
     446    /// The const reference type of the iterator.
     447    typedef typename Map::ConstReference ConstReference;
     448    /// The pointer type of the iterator.
     449    typedef typename Map::ConstPointer ConstPointer;
    450450
    451451  private:
     
    482482
    483483    /// The dereferencing operator of the iterator.
    484     ConstReferenceType operator*() const {
     484    ConstReference operator*() const {
    485485      return (*map)[Base::it];
    486486    }
    487487
    488488    /// The arrow operator of the iterator.
    489     ConstPointerType operator->() const {
     489    ConstPointer operator->() const {
    490490      return &(operator*());
    491491    }
     
    495495    typedef std::input_iterator_tag iterator_category;
    496496    typedef int difference_type;
    497     typedef ValueType value_type;
    498     typedef ConstReferenceType reference;
    499     typedef ConstPointerType pointer;
     497    typedef Value value_type;
     498    typedef ConstReference reference;
     499    typedef ConstPointer pointer;
    500500  };
    501501
     
    512512
    513513    /// The key type of the iterator.
    514     typedef typename Map::KeyType KeyType;
    515     /// The iterator to iterate on the keys.
    516     typedef typename Map::KeyIt KeyIt;
    517 
    518 
    519     /// The value type of the iterator.
    520     typedef typename Map::ValueType ValueType;
    521     /// The reference type of the iterator.
    522     typedef typename Map::ReferenceType ReferenceType;
    523     /// The pointer type of the iterator.
    524     typedef typename Map::PointerType PointerType;
    525 
    526     /// The const value type of the iterator.
    527     typedef typename Map::ConstValueType ConstValueType;
    528     /// The const reference type of the iterator.
    529     typedef typename Map::ConstReferenceType ConstReferenceType;
    530     /// The pointer type of the iterator.
    531     typedef typename Map::ConstPointerType ConstPointerType;
     514    typedef typename Map::Key Key;
     515    /// The iterator to iterate on the keys.
     516    typedef typename Map::KeyIt KeyIt;
     517
     518
     519    /// The value type of the iterator.
     520    typedef typename Map::Value Value;
     521    /// The reference type of the iterator.
     522    typedef typename Map::Reference Reference;
     523    /// The pointer type of the iterator.
     524    typedef typename Map::Pointer Pointer;
     525
     526    /// The const value type of the iterator.
     527    typedef typename Map::ConstValue ConstValue;
     528    /// The const reference type of the iterator.
     529    typedef typename Map::ConstReference ConstReference;
     530    /// The pointer type of the iterator.
     531    typedef typename Map::ConstPointer ConstPointer;
    532532
    533533    /// The map initialized const key set.
     
    549549  public:
    550550    // STL  compatibility typedefs.
    551     typedef ValueType value_type;
     551    typedef Value value_type;
    552552    typedef ConstIterator const_iterator;
    553     typedef ConstReferenceType const_reference;
    554     typedef ConstPointerType const_pointer;
     553    typedef ConstReference const_reference;
     554    typedef ConstPointer const_pointer;
    555555    typedef int difference_type;
    556556  };
     
    568568
    569569    /// The key type of the iterator.
    570     typedef typename Map::KeyType KeyType;
    571     /// The iterator to iterate on the keys.
    572     typedef typename Map::KeyIt KeyIt;
    573 
    574 
    575     /// The value type of the iterator.
    576     typedef typename Map::ValueType ValueType;
    577     /// The reference type of the iterator.
    578     typedef typename Map::ReferenceType ReferenceType;
    579     /// The pointer type of the iterator.
    580     typedef typename Map::PointerType PointerType;
    581 
    582     /// The const value type of the iterator.
    583     typedef typename Map::ConstValueType ConstValueType;
    584     /// The const reference type of the iterator.
    585     typedef typename Map::ConstReferenceType ConstReferenceType;
    586     /// The pointer type of the iterator.
    587     typedef typename Map::ConstPointerType ConstPointerType;
     570    typedef typename Map::Key Key;
     571    /// The iterator to iterate on the keys.
     572    typedef typename Map::KeyIt KeyIt;
     573
     574
     575    /// The value type of the iterator.
     576    typedef typename Map::Value Value;
     577    /// The reference type of the iterator.
     578    typedef typename Map::Reference Reference;
     579    /// The pointer type of the iterator.
     580    typedef typename Map::Pointer Pointer;
     581
     582    /// The const value type of the iterator.
     583    typedef typename Map::ConstValue ConstValue;
     584    /// The const reference type of the iterator.
     585    typedef typename Map::ConstReference ConstReference;
     586    /// The pointer type of the iterator.
     587    typedef typename Map::ConstPointer ConstPointer;
    588588
    589589    /// The map initialized const value set.
     
    605605  public:
    606606    // STL  compatibility typedefs.
    607     typedef ValueType value_type;
     607    typedef Value value_type;
    608608    typedef ConstIterator const_iterator;
    609     typedef ConstReferenceType const_reference;
    610     typedef ConstPointerType const_pointer;
     609    typedef ConstReference const_reference;
     610    typedef ConstPointer const_pointer;
    611611    typedef int difference_type;
    612612  };
     
    625625
    626626    /// The key type of the iterator.
    627     typedef typename Map::KeyType KeyType;
    628     /// The iterator to iterate on the keys.
    629     typedef typename Map::KeyIt KeyIt;
    630 
    631 
    632     /// The value type of the iterator.
    633     typedef typename Map::ValueType ValueType;
    634     /// The reference type of the iterator.
    635     typedef typename Map::ReferenceType ReferenceType;
    636     /// The pointer type of the iterator.
    637     typedef typename Map::PointerType PointerType;
    638 
    639     /// The const value type of the iterator.
    640     typedef typename Map::ConstValueType ConstValueType;
    641     /// The const reference type of the iterator.
    642     typedef typename Map::ConstReferenceType ConstReferenceType;
    643     /// The pointer type of the iterator.
    644     typedef typename Map::ConstPointerType ConstPointerType;
     627    typedef typename Map::Key Key;
     628    /// The iterator to iterate on the keys.
     629    typedef typename Map::KeyIt KeyIt;
     630
     631
     632    /// The value type of the iterator.
     633    typedef typename Map::Value Value;
     634    /// The reference type of the iterator.
     635    typedef typename Map::Reference Reference;
     636    /// The pointer type of the iterator.
     637    typedef typename Map::Pointer Pointer;
     638
     639    /// The const value type of the iterator.
     640    typedef typename Map::ConstValue ConstValue;
     641    /// The const reference type of the iterator.
     642    typedef typename Map::ConstReference ConstReference;
     643    /// The pointer type of the iterator.
     644    typedef typename Map::ConstPointer ConstPointer;
    645645
    646646    /// The map initialized value set.
     
    675675  public:
    676676    // STL  compatibility typedefs.
    677     typedef ValueType value_type;
     677    typedef Value value_type;
    678678    typedef Iterator iterator;
    679679    typedef ConstIterator const_iterator;
    680     typedef ReferenceType reference;
    681     typedef ConstReferenceType const_reference;
    682     typedef PointerType pointer;
    683     typedef ConstPointerType const_pointer;
     680    typedef Reference reference;
     681    typedef ConstReference const_reference;
     682    typedef Pointer pointer;
     683    typedef ConstPointer const_pointer;
    684684    typedef int difference_type;
    685685
  • src/lemon/maps.h

    r977 r987  
    3737  public:
    3838    ///\e
    39     typedef K KeyType;
     39    typedef K Key;
    4040    ///\e
    41     typedef T ValueType;
     41    typedef T Value;
    4242  };
    4343
     
    109109
    110110  /// This is essentially a wrapper for \c std::map. With addition that
    111   /// you can specify a default value different from \c ValueType() .
     111  /// you can specify a default value different from \c Value() .
    112112  ///
    113113  /// \todo Provide allocator parameter...
    114   template <typename Key, typename T, typename Compare = std::less<Key> >
    115   class StdMap : public std::map<Key,T,Compare> {
    116     typedef std::map<Key,T,Compare> parent;
     114  template <typename K, typename T, typename Compare = std::less<K> >
     115  class StdMap : public std::map<K,T,Compare> {
     116    typedef std::map<K,T,Compare> parent;
    117117    T v;
    118118    typedef typename parent::value_type PairType;
    119119
    120120  public:
    121     typedef Key KeyType;
    122     typedef T ValueType;
    123     typedef T& ReferenceType;
    124     typedef const T& ConstReferenceType;
     121    typedef K Key;
     122    typedef T Value;
     123    typedef T& Reference;
     124    typedef const T& ConstReference;
    125125
    126126
     
    144144    }
    145145
    146     ReferenceType operator[](const Key &k) {
     146    Reference operator[](const Key &k) {
    147147      return insert(PairType(k,v)).first -> second;
    148148    }
    149     ConstReferenceType operator[](const Key &k) const {
     149    ConstReference operator[](const Key &k) const {
    150150      typename parent::iterator i = lower_bound(k);
    151151      if (i == parent::end() || parent::key_comp()(k, (*i).first))
  • src/lemon/min_cost_flow.h

    r986 r987  
    6060  class MinCostFlow {
    6161
    62     typedef typename LengthMap::ValueType Length;
     62    typedef typename LengthMap::Value Length;
    6363
    6464    //Warning: this should be integer type
    65     typedef typename CapacityMap::ValueType Capacity;
     65    typedef typename CapacityMap::Value Capacity;
    6666   
    6767    typedef typename Graph::Node Node;
     
    9595      const NodeMap &pot;
    9696    public :
    97       typedef typename LengthMap::KeyType KeyType;
    98       typedef typename LengthMap::ValueType ValueType;
     97      typedef typename LengthMap::Key Key;
     98      typedef typename LengthMap::Value Value;
    9999
    100100      ModLengthMap(const ResGW& _g,
     
    102102        g(_g), /*rev(_rev),*/ length(_length), pot(_pot) { }
    103103       
    104       ValueType operator[](typename ResGW::Edge e) const {     
     104      Value operator[](typename ResGW::Edge e) const {     
    105105        if (g.forward(e))
    106106          return  length[e]-(pot[g.target(e)]-pot[g.source(e)]);   
  • src/lemon/suurballe.h

    r986 r987  
    5959
    6060
    61     typedef typename LengthMap::ValueType Length;
     61    typedef typename LengthMap::Value Length;
    6262   
    6363    typedef typename Graph::Node Node;
  • src/lemon/vector_map.h

    r980 r987  
    5454    typedef _Graph Graph;
    5555    /// The key type of the map.
    56     typedef _Item KeyType;
     56    typedef _Item Key;
    5757    /// The id map type of the map.
    5858    typedef AlterationObserverRegistry<_Item> Registry;
     
    7272  public:
    7373
    74     /// The value type of the map.
    75     typedef Value ValueType;
    7674    /// The reference type of the map;
    77     typedef typename Container::reference ReferenceType;
     75    typedef typename Container::reference Reference;
    7876    /// The pointer type of the map;
    79     typedef typename Container::pointer PointerType;
     77    typedef typename Container::pointer Pointer;
    8078
    8179    /// The const value type of the map.
    82     typedef const Value ConstValueType;
     80    typedef const Value ConstValue;
    8381    /// The const reference type of the map;
    84     typedef typename Container::const_reference ConstReferenceType;
     82    typedef typename Container::const_reference ConstReference;
    8583    /// The pointer type of the map;
    86     typedef typename Container::const_pointer ConstPointerType;
     84    typedef typename Container::const_pointer ConstPointer;
    8785
    8886    /// Constructor to attach the new map into the registry.
     
    151149    /// actual items of the graph.
    152150     
    153     ReferenceType operator[](const KeyType& key) {
     151    Reference operator[](const Key& key) {
    154152      return container[graph->id(key)];
    155153    }
     
    160158    /// actual items of the graph.
    161159     
    162     ConstReferenceType operator[](const KeyType& key) const {
     160    ConstReference operator[](const Key& key) const {
    163161      return container[graph->id(key)];
    164162    }
     
    170168    ///
    171169     
    172     void set(const KeyType& key, const ValueType& value) {
     170    void set(const Key& key, const Value& value) {
    173171      (*this)[key] = value;
    174172    }
     
    179177    /// and it overrides the add() member function of the observer base.
    180178     
    181     void add(const KeyType& key) {
     179    void add(const Key& key) {
    182180      int id = graph->id(key);
    183181      if (id >= (int)container.size()) {
     
    190188    /// Erase a key from the map. It called by the observer registry
    191189    /// and it overrides the erase() member function of the observer base.     
    192     void erase(const KeyType&) {}
     190    void erase(const Key&) {}
    193191
    194192    /// Buildes the map.
  • src/lemon/xy.h

    r967 r987  
    5151    public:
    5252
    53       typedef T ValueType;
     53      typedef T Value;
    5454
    5555      T x,y;     
  • src/test/sym_graph_test.h

    r986 r987  
    9696        {
    9797          //Check the typedef's
    98           typename Graph::template SymEdgeMap<int>::ValueType val;
     98          typename Graph::template SymEdgeMap<int>::Value val;
    9999          val = 1;
    100           typename Graph::template SymEdgeMap<int>::KeyType key;
     100          typename Graph::template SymEdgeMap<int>::Key key;
    101101          key = typename Graph::SymEdgeIt(G);
    102102        }
     
    119119        {
    120120          //Check the typedef's
    121           typename Graph::template SymEdgeMap<bool>::ValueType val;
     121          typename Graph::template SymEdgeMap<bool>::Value val;
    122122          val=true;
    123           typename Graph::template SymEdgeMap<bool>::KeyType key;
     123          typename Graph::template SymEdgeMap<bool>::Key key;
    124124          key= typename Graph::SymEdgeIt(G);
    125125        }
  • src/work/alpar/boolmap_iter.cc

    r986 r987  
    1414  typedef typename GG::Edge Edge;
    1515 
    16   typedef Edge KeyType;
    17   typedef bool ValueType;
     16  typedef Edge Key;
     17  typedef bool Value;
    1818 
    1919  friend class RefType;
     
    6868    RefType(BoolIterEdgeMap &_M,Edge _e) : M(_M), e(_e) { }
    6969   
    70     operator ValueType() const
     70    operator Value() const
    7171    {
    7272      return M.isTrue(e);
    7373     
    7474    }
    75     ValueType operator = (ValueType v) const
     75    Value operator = (Value v) const
    7676    {
    7777      if(v) M.setTrue(e);
  • src/work/alpar/dijkstra.h

    r986 r987  
    4747    typedef LM LengthMap;
    4848    //The type of the length of the edges.
    49     typedef typename LM::ValueType ValueType;
     49    typedef typename LM::Value Value;
    5050    ///The heap type used by Dijkstra algorithm.
    5151
     
    5555    ///\sa Dijkstra
    5656    typedef BinHeap<typename Graph::Node,
    57                     typename LM::ValueType,
     57                    typename LM::Value,
    5858                    typename GR::template NodeMap<int>,
    59                     std::less<ValueType> > Heap;
     59                    std::less<Value> > Heap;
    6060
    6161    ///\brief The type of the map that stores the last
     
    9191    ///It must meet the \ref concept::WriteMap "WriteMap" concept.
    9292    ///
    93     typedef typename Graph::template NodeMap<typename LM::ValueType> DistMap;
     93    typedef typename Graph::template NodeMap<typename LM::Value> DistMap;
    9494    ///Instantiates a DistMap.
    9595 
     
    110110  ///
    111111  ///The type of the length is determined by the
    112   ///\ref concept::ReadMap::ValueType "ValueType" of the length map.
     112  ///\ref concept::ReadMap::Value "Value" of the length map.
    113113  ///
    114114  ///It is also possible to change the underlying priority heap.
     
    159159   
    160160    ///The type of the length of the edges.
    161     typedef typename TR::LengthMap::ValueType ValueType;
     161    typedef typename TR::LengthMap::Value Value;
    162162    ///The type of the map that stores the edge lengths.
    163163    typedef typename TR::LengthMap LengthMap;
     
    388388       
    389389        Node v=heap.top();
    390         ValueType oldvalue=heap[v];
     390        Value oldvalue=heap[v];
    391391        heap.pop();
    392392        distance->set(v, oldvalue);
     
    421421    ///\warning If node \c v in unreachable from the root the return value
    422422    ///of this funcion is undefined.
    423     ValueType dist(Node v) const { return (*distance)[v]; }
     423    Value dist(Node v) const { return (*distance)[v]; }
    424424
    425425    ///Returns the 'previous edge' of the shortest path tree.
     
    498498    typedef typename TR::LengthMap LengthMap;
    499499    ///The type of the length of the edges.
    500     typedef typename LengthMap::ValueType ValueType;
     500    typedef typename LengthMap::Value Value;
    501501    ///\brief The type of the map that stores the last
    502502    ///edges of the shortest paths.
  • src/work/alpar/f_ed_ka.h

    r986 r987  
    1414namespace lemon {
    1515  template <typename Graph, typename FlowMap, typename CapacityMap>
    16   typename FlowMap::ValueType maxFlow(Graph &G,
     16  typename FlowMap::Value maxFlow(Graph &G,
    1717                                      FlowMap &f,
    1818                                      CapacityMap &c,
     
    2626    typedef typename Graph::OutEdgeIt OutEdgeIt;
    2727    typedef typename Graph::InEdgeIt InEdgeIt;
    28     typedef typename FlowMap::ValueType T;
     28    typedef typename FlowMap::Value T;
    2929   
    3030    T flow_val = 0;
  • src/work/alpar/rw_nonref_map.cc

    r986 r987  
    1111  typedef typename GG::Edge Edge;
    1212 
    13   typedef Edge KeyType;
    14   typedef TT ValueType;
     13  typedef Edge Key;
     14  typedef TT Value;
    1515 
    1616  class RefType
     
    2121    RefType(Graph &_G,Edge _e) : G(_G), e(_e) { }
    2222   
    23     operator ValueType() const
     23    operator Value() const
    2424    {
    25       ValueType tmp;
     25      Value tmp;
    2626      std::cout << G.id(G.source(e)) << "->"
    2727                << G.id(G.target(e)) << ": ";
     
    2929      return tmp;
    3030    }
    31     ValueType operator = (ValueType v) const
     31    Value operator = (Value v) const
    3232    {
    3333      std::cout << G.id(G.source(e)) << "->"
     
    4848{
    4949public:
    50   typedef K KeyType;
    51   typedef T ValueType;
     50  typedef K Key;
     51  typedef T Value;
    5252 
    5353  class RefType
    5454  {
    55     ValueType val;
     55    Value val;
    5656  public:
    57     RefType(ValueType v) : val(v) { }   
    58     operator ValueType() const { return val; }
    59     ValueType operator = (ValueType v) const { return val; }
     57    RefType(Value v) : val(v) { }   
     58    operator Value() const { return val; }
     59    Value operator = (Value v) const { return val; }
    6060  };
    6161 
    6262private:
    63   ValueType val;
     63  Value val;
    6464public:
    65   NullMap(ValueType v) : val(v) { }
    66   RefType operator[] (KeyType e) const { return RefType(v);} 
     65  NullMap(Value v) : val(v) { }
     66  RefType operator[] (Key e) const { return RefType(v);} 
    6767};
    6868
  • src/work/athos/mincostflow.h

    r986 r987  
    4444  class MinCostFlow {
    4545
    46     typedef typename CostMap::ValueType Cost;
    47 
    48 
    49     typedef typename SupplyDemandMap::ValueType SupplyDemand;
     46    typedef typename CostMap::Value Cost;
     47
     48
     49    typedef typename SupplyDemandMap::Value SupplyDemand;
    5050   
    5151    typedef typename Graph::Node Node;
     
    6969      const NodeMap &pot;
    7070    public :
    71       typedef typename CostMap::KeyType KeyType;
    72       typedef typename CostMap::ValueType ValueType;
     71      typedef typename CostMap::Key Key;
     72      typedef typename CostMap::Value Value;
    7373       
    74       ValueType operator[](typename ResGraph::Edge e) const {     
     74      Value operator[](typename ResGraph::Edge e) const {     
    7575        if (res_graph.forward(e))
    7676          return  ol[e]-(pot[res_graph.target(e)]-pot[res_graph.source(e)]);   
  • src/work/athos/old/minlengthpaths.h

    r986 r987  
    3131  class MinLengthPaths {
    3232
    33     typedef typename LengthMap::ValueType Length;
     33    typedef typename LengthMap::Value Length;
    3434   
    3535    typedef typename Graph::Node Node;
     
    5050      const NodeMap &pot;
    5151    public :
    52       typedef typename LengthMap::KeyType KeyType;
    53       typedef typename LengthMap::ValueType ValueType;
    54        
    55       ValueType operator[](typename ResGraphType::Edge e) const {     
     52      typedef typename LengthMap::Key Key;
     53      typedef typename LengthMap::Value Value;
     54       
     55      Value operator[](typename ResGraphType::Edge e) const {     
    5656        //if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){
    5757        //  std::cout<<"Negative length!!"<<std::endl;
  • src/work/athos/union_find.h

    r921 r987  
    1616namespace lemon {
    1717 
    18   template <typename KeyType, typename KeyIntMap>
     18  template <typename Key, typename KeyIntMap>
    1919    class UnionFind {
    2020    KeyIntMap& pointmap;
     
    3535   
    3636    //Give a component of one point to the structure
    37     int addPoint(KeyType u){
     37    int addPoint(Key u){
    3838      int _index = container.size();
    3939      VectorElementType buf(_index,1);
     
    4444   
    4545    //Finds the big boss of u
    46     int find(KeyType u){
     46    int find(Key u){
    4747      if (pointmap.get(u)==-1){
    4848        int whoami = addPoint(u);
     
    6262
    6363    //Finds u and v in the structures and merges the comopnents, if not equal
    64     bool findAndMerge(KeyType u,KeyType v){
     64    bool findAndMerge(Key u,Key v){
    6565      int bu = find(u);
    6666      int bv = find(v);
  • src/work/deba/dijkstra.h

    r921 r987  
    2222  ///so it is easy to change it to any kind of length.
    2323  ///
    24   ///The type of the length is determined by the \c ValueType of the length map.
     24  ///The type of the length is determined by the \c Value of the length map.
    2525  ///
    2626  ///It is also possible to change the underlying priority heap.
     
    6060   
    6161    ///The type of the length of the edges.
    62     typedef typename LM::ValueType ValueType;
     62    typedef typename LM::Value Value;
    6363    ///The type of the map that stores the edge lengths.
    6464    typedef LM LengthMap;
     
    7070    typedef typename Graph::template NodeMap<Node> PredNodeMap;
    7171    ///The type of the map that stores the dists of the nodes.
    72     typedef typename Graph::template NodeMap<ValueType> DistMap;
     72    typedef typename Graph::template NodeMap<Value> DistMap;
    7373
    7474  private:
     
    217217      typename GR::template NodeMap<int> heap_map(*G,-1);
    218218     
    219       typedef Heap<Node, ValueType, typename GR::template NodeMap<int>,
    220       std::less<ValueType> >
     219      typedef Heap<Node, Value, typename GR::template NodeMap<int>,
     220      std::less<Value> >
    221221      HeapType;
    222222     
     
    228228       
    229229        Node v=heap.top();
    230         ValueType oldvalue=heap[v];
     230        Value oldvalue=heap[v];
    231231        heap.pop();
    232232        distance->set(v, oldvalue);
     
    262262    ///\warning If node \c v in unreachable from the root the return value
    263263    ///of this funcion is undefined.
    264     ValueType dist(Node v) const { return (*distance)[v]; }
     264    Value dist(Node v) const { return (*distance)[v]; }
    265265
    266266    ///Returns the 'previous edge' of the shortest path tree.
  • src/work/klao/iter_map.h

    r921 r987  
    2626  public:
    2727
    28     typedef typename KeyIntMap::KeyType KeyType;
    29     typedef Val ValueType;
     28    typedef typename KeyIntMap::Key Key;
     29    typedef Val Value;
    3030
    31     typedef typename std::vector<KeyType>::const_iterator iterator;
     31    typedef typename std::vector<Key>::const_iterator iterator;
    3232
    3333  protected:
    3434    KeyIntMap &base;
    35     std::vector<KeyType> data;
     35    std::vector<Key> data;
    3636    size_t bounds[N];
    3737    Val def_val;
     
    5656      if(m != n) {
    5757        size_t orig_a = a;
    58         KeyType orig_key = data[a];
     58        Key orig_key = data[a];
    5959        while(m > n) {
    6060          --m;
     
    8181    }
    8282
    83     Val operator[](const KeyType& k) const {
     83    Val operator[](const Key& k) const {
    8484      return find(base[k]);
    8585    }
    8686
    87     void set(const KeyType& k, Val n) {
     87    void set(const Key& k, Val n) {
    8888      // FIXME: range check?
    8989      size_t a = base[k];
     
    9696    }
    9797
    98     void insert(const KeyType& k, Val n) {
     98    void insert(const Key& k, Val n) {
    9999      data.push_back(k);
    100100      base.set(k, move(bounds[N-1]++, N-1, n));
     
    103103    /// This func is not very usable, but necessary to implement
    104104    /// dynamic map behaviour.
    105     void remove(const KeyType& k) {
     105    void remove(const Key& k) {
    106106      size_t a = base[k];
    107107      if(a < bounds[N-1]) {
     
    131131
    132132    /// For use as an iterator...
    133     KeyType& first(KeyType &k, Val n) {
     133    Key& first(Key &k, Val n) {
    134134      size_t i = (n ? bounds[n-1] : 0);
    135135      if( i < bounds[n] ) {
     
    143143
    144144    /// For use as an iterator...
    145     KeyType& next(KeyType &k) {
     145    Key& next(Key &k) {
    146146      size_t i = base[k];
    147147      uint8_t n = find(i);
  • src/work/marci/augmenting_flow.h

    r986 r987  
    113113      int* number_of_augmentations;
    114114    public:
    115       typedef Node KeyType;
    116       typedef bool ValueType;
     115      typedef Node Key;
     116      typedef bool Value;
    117117      TrickyReachedMap(IntMap& _map, int& _number_of_augmentations) :
    118118        map(&_map), number_of_augmentations(&_number_of_augmentations) { }
  • src/work/marci/bfs_mm.h

    r986 r987  
    141141    /// Guess what?
    142142    /// \deprecated
    143     typename ReachedMap::ValueType reached(const Node& n) const {
     143    typename ReachedMap::Value reached(const Node& n) const {
    144144      return (*reached_map)[n];
    145145    }
     
    243243    /// Guess what?
    244244    /// \deprecated
    245     typename PredMap::ValueType pred(const Node& n) const {
     245    typename PredMap::Value pred(const Node& n) const {
    246246      return (*pred_map)[n];
    247247    }
     
    251251    /// Guess what?
    252252    /// \deprecated
    253     typename PredNodeMap::ValueType predNode(const Node& n) const {
     253    typename PredNodeMap::Value predNode(const Node& n) const {
    254254      return (*pred_node_map)[n];
    255255    }
     
    259259    /// Guess what?
    260260    /// \deprecated
    261     typename DistMap::ValueType dist(const Node& n) const {
     261    typename DistMap::Value dist(const Node& n) const {
    262262      return (*dist_map)[n];
    263263    }
  • src/work/marci/bipartite_graph_wrapper.h

    r986 r987  
    795795    template<typename NM> class NodeMapWrapper {
    796796    public:
    797       typedef Node KeyType;
    798       typedef typename NM::ValueType ValueType;
     797      typedef Node Key;
     798      typedef typename NM::Value Value;
    799799    protected:
    800800      NM* nm;
    801       ValueType* s_value, t_value;
    802     public:
    803       NodeMapWrapper(NM& _nm, ValueType& _s_value, ValueType& _t_value) :
     801      Value* s_value, t_value;
     802    public:
     803      NodeMapWrapper(NM& _nm, Value& _s_value, Value& _t_value) :
    804804        nm(&_nm), s_value(&_s_value), t_value(&_t_value) { }
    805       ValueType operator[](const Node& n) const {
     805      Value operator[](const Node& n) const {
    806806        switch (n.getSpec()) {
    807807        case 0:
     
    814814        }
    815815      }
    816       void set(const Node& n, ValueType t) {
     816      void set(const Node& n, Value t) {
    817817        switch (n.getSpec()) {
    818818        case 0:
     
    874874    class EdgeMapWrapper {
    875875    public:
    876       typedef Edge KeyType;
    877       typedef typename EM::ValueType ValueType;
     876      typedef Edge Key;
     877      typedef typename EM::Value Value;
    878878    protected:
    879879      EM* em;
     
    881881    public:
    882882      EdgeMapWrapper(EM& _em, NM& _nm) : em(&_em), nm(&_nm) { }
    883       ValueType operator[](const Edge& e) const {
     883      Value operator[](const Edge& e) const {
    884884        switch (e.getSpec()) {
    885885        case 0:
     
    892892        }
    893893      }
    894       void set(const Edge& e, ValueType t) {
     894      void set(const Edge& e, Value t) {
    895895        switch (e.getSpec()) {
    896896        case 0:
  • src/work/marci/experiment/list_graph.h

    r986 r987  
    3939      std::vector<T> container;
    4040    public:
    41       typedef T ValueType;
    42       typedef Node KeyType;
     41      typedef T Value;
     42      typedef Node Key;
    4343      NodeMap(const ListGraph& _G) : G(_G), container(G.node_id) { }
    4444      NodeMap(const ListGraph& _G, T a) :
     
    6060      std::vector<T> container;
    6161    public:
    62       typedef T ValueType;
    63       typedef Edge KeyType;
     62      typedef T Value;
     63      typedef Edge Key;
    6464      EdgeMap(const ListGraph& _G) : G(_G), container(G.edge_id) { }
    6565      EdgeMap(const ListGraph& _G, T a) :
  • src/work/marci/graph_concept.h

    r986 r987  
    168168    {
    169169    public:
    170       typedef T ValueType;
    171       typedef Node KeyType;
     170      typedef T Value;
     171      typedef Node Key;
    172172
    173173      NodeMap(const GraphConcept& g) { }
     
    206206    {
    207207    public:
    208       typedef T ValueType;
    209       typedef Edge KeyType;
     208      typedef T Value;
     209      typedef Edge Key;
    210210
    211211      EdgeMap(const GraphConcept& g) {}
  • src/work/marci/leda/leda_graph_wrapper.h

    r986 r987  
    262262      leda_node_map<T> leda_stuff;
    263263    public:
    264       typedef T ValueType;
    265       typedef Node KeyType;
     264      typedef T Value;
     265      typedef Node Key;
    266266
    267267      NodeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
     
    282282      leda_edge_map<T> leda_stuff;
    283283    public:
    284       typedef T ValueType;
    285       typedef Edge KeyType;
     284      typedef T Value;
     285      typedef Edge Key;
    286286
    287287      EdgeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {}
     
    304304      leda_node_array<T>* leda_stuff;
    305305    public:
    306       typedef T ValueType;
    307       typedef Node KeyType;
     306      typedef T Value;
     307      typedef Node Key;
    308308
    309309      NodeMapWrapper(leda_node_array<T>& _leda_stuff) :
     
    326326      leda_edge_array<T>* leda_stuff;
    327327    public:
    328       typedef T ValueType;
    329       typedef Edge KeyType;
     328      typedef T Value;
     329      typedef Edge Key;
    330330
    331331      EdgeMapWrapper(leda_edge_array<T>& _leda_stuff) :
  • src/work/peter/edgepathgraph.h

    r986 r987  
    307307    {
    308308    public:
    309       typedef T ValueType;
    310       typedef Node KeyType;
     309      typedef T Value;
     310      typedef Node Key;
    311311
    312312      NodeMap(const EdgePathGraph &) {}
     
    345345    {
    346346    public:
    347       typedef T ValueType;
    348       typedef Edge KeyType;
     347      typedef T Value;
     348      typedef Edge Key;
    349349
    350350      EdgeMap(const EdgePathGraph &) {}
  • src/work/peter/hierarchygraph.h

    r986 r987  
    434434    {
    435435    public:
    436       typedef T ValueType;
    437       typedef Node KeyType;
     436      typedef T Value;
     437      typedef Node Key;
    438438
    439439      NodeMap (const HierarchyGraph &)
     
    490490    {
    491491    public:
    492       typedef T ValueType;
    493       typedef Edge KeyType;
     492      typedef T Value;
     493      typedef Edge Key;
    494494
    495495      EdgeMap (const HierarchyGraph &)
  • src/work/sage_graph.h

    r986 r987  
    3939      std::vector<T> container;
    4040    public:
    41       typedef T ValueType;
    42       typedef Node KeyType;
     41      typedef T Value;
     42      typedef Node Key;
    4343      NodeMap(const SageGraph& _G) : G(_G), container(G.node_id) { }
    4444      NodeMap(const SageGraph& _G, T a) :
     
    6060      std::vector<T> container;
    6161    public:
    62       typedef T ValueType;
    63       typedef Edge KeyType;
     62      typedef T Value;
     63      typedef Edge Key;
    6464      EdgeMap(const SageGraph& _G) : G(_G), container(G.edge_id) { }
    6565      EdgeMap(const SageGraph& _G, T a) :
Note: See TracChangeset for help on using the changeset viewer.