Changeset 987:87f7c54892df in lemon-0.x
- Timestamp:
- 11/13/04 18:07:10 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
- 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 1 7 2004-09-30 Alpar Juttner <alpar@cs.elte.hu> 2 8 -
doc/maps.dox
r986 r987 10 10 11 11 \code 12 typedef Edge Key Type;13 typedef double Value Type;12 typedef Edge Key; 13 typedef double Value; 14 14 \endcode 15 15 … … 53 53 \endcode 54 54 - <em>Writable maps</em> have 55 a member function \c set(Key Type,const ValueType &)55 a member function \c set(Key,const Value &) 56 56 for this purpose. 57 57 \code … … 83 83 struct MyMap 84 84 { 85 typedef double Value Type;86 typedef Graph::Edge Key Type;87 double operator[](Key Typee) const { return M_PI;}85 typedef double Value; 86 typedef Graph::Edge Key; 87 double operator[](Key e) const { return M_PI;} 88 88 }; 89 89 \endcode … … 96 96 struct MyMap : public MapBase<Graph::Edge,double> 97 97 { 98 Value Type operator[](KeyTypee) const { return M_PI;}98 Value operator[](Key e) const { return M_PI;} 99 99 }; 100 100 \endcode … … 112 112 113 113 public: 114 Value Type operator[](KeyTypee) const {114 Value operator[](Key e) const { 115 115 return orig_len.get(e)-pot.get(G.target(e))-pot.get(G.source(e)); 116 116 } -
src/lemon/array_map.h
r980 r987 39 39 * 40 40 * The template parameter is the MapRegistry that the maps 41 * will belong to and the Value Type.41 * will belong to and the Value. 42 42 */ 43 43 … … 53 53 typedef _Graph Graph; 54 54 /// The key type of the maps. 55 typedef _Item Key Type;55 typedef _Item Key; 56 56 57 57 typedef AlterationObserverRegistry<_Item> Registry; … … 61 61 typedef _ItemIt KeyIt; 62 62 63 typedef _Value Value;64 65 63 /// The MapBase of the Map which imlements the core regisitry function. 66 64 typedef typename Registry::ObserverBase Parent; … … 70 68 71 69 /// The value type of the map. 72 typedef Value ValueType;70 typedef _Value Value; 73 71 /// The reference type of the map; 74 typedef Value& Reference Type;72 typedef Value& Reference; 75 73 /// The pointer type of the map; 76 typedef Value* Pointer Type;74 typedef Value* Pointer; 77 75 78 76 /// The const value type of the map. 79 typedef const Value ConstValue Type;77 typedef const Value ConstValue; 80 78 /// The const reference type of the map; 81 typedef const Value& ConstReference Type;79 typedef const Value& ConstReference; 82 80 /// The pointer type of the map; 83 typedef const Value* ConstPointer Type;81 typedef const Value* ConstPointer; 84 82 85 83 … … 173 171 * actual keys of the graph. 174 172 */ 175 Reference Type operator[](const KeyType& key) {173 Reference operator[](const Key& key) { 176 174 int id = graph->id(key); 177 175 return values[id]; … … 182 180 * actual keys of the graph. 183 181 */ 184 ConstReference Type operator[](const KeyType& key) const {182 ConstReference operator[](const Key& key) const { 185 183 int id = graph->id(key); 186 184 return values[id]; … … 190 188 * This is a compatibility feature with the not dereferable maps. 191 189 */ 192 void set(const Key Type& key, const ValueType& val) {190 void set(const Key& key, const Value& val) { 193 191 (*this)[key] = val; 194 192 } … … 196 194 /** Add a new key to the map. It called by the map registry. 197 195 */ 198 void add(const Key Type& key) {196 void add(const Key& key) { 199 197 int id = graph->id(key); 200 198 if (id >= capacity) { … … 220 218 /** Erase a key from the map. It called by the map registry. 221 219 */ 222 void erase(const Key Type& key) {220 void erase(const Key& key) { 223 221 int id = graph->id(key); 224 222 allocator.destroy(&(values[id])); … … 322 320 // typedef Iterator iterator; 323 321 // typedef ConstIterator const_iterator; 324 // typedef typename Iterator::PairValue Typevalue_type;325 // typedef typename Iterator::Key Typekey_type;326 // typedef typename Iterator::Value Typedata_type;327 // typedef typename Iterator::PairReference Typereference;328 // typedef typename Iterator::PairPointer Typepointer;329 // typedef typename ConstIterator::PairReference Typeconst_reference;330 // typedef typename ConstIterator::PairPointer Typeconst_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; 331 329 // typedef int difference_type; 332 330 }; -
src/lemon/concept/graph.h
r986 r987 568 568 // { 569 569 // //Check the typedef's 570 // typename Graph::template NodeMap<int>::Value Typeval;570 // typename Graph::template NodeMap<int>::Value val; 571 571 // val=1; 572 // typename Graph::template NodeMap<int>::Key Typekey;572 // typename Graph::template NodeMap<int>::Key key; 573 573 // key = typename Graph::NodeIt(G); 574 574 // } … … 592 592 // { 593 593 // //Check the typedef's 594 // typename Graph::template NodeMap<bool>::Value Typeval;594 // typename Graph::template NodeMap<bool>::Value val; 595 595 // val=true; 596 // typename Graph::template NodeMap<bool>::Key Typekey;596 // typename Graph::template NodeMap<bool>::Key key; 597 597 // key= typename Graph::NodeIt(G); 598 598 // } … … 615 615 // { 616 616 // //Check the typedef's 617 // typename Graph::template EdgeMap<int>::Value Typeval;617 // typename Graph::template EdgeMap<int>::Value val; 618 618 // val=1; 619 // typename Graph::template EdgeMap<int>::Key Typekey;619 // typename Graph::template EdgeMap<int>::Key key; 620 620 // key= typename Graph::EdgeIt(G); 621 621 // } … … 638 638 // { 639 639 // //Check the typedef's 640 // typename Graph::template EdgeMap<bool>::Value Typeval;640 // typename Graph::template EdgeMap<bool>::Value val; 641 641 // val=true; 642 // typename Graph::template EdgeMap<bool>::Key Typekey;642 // typename Graph::template EdgeMap<bool>::Key key; 643 643 // key= typename Graph::EdgeIt(G); 644 644 // } -
src/lemon/concept/graph_component.h
r986 r987 678 678 typedef BaseGraphComponent::Edge Edge; 679 679 680 template <typename Value>681 class NodeMap : public ReferenceMap<Node, Value> {680 template <typename _Value> 681 class NodeMap : public ReferenceMap<Node, _Value> { 682 682 public: 683 683 NodeMap(const Graph&) {} 684 NodeMap(const Graph&, const Value&) {}684 NodeMap(const Graph&, const _Value&) {} 685 685 NodeMap(const NodeMap&) {} 686 686 … … 689 689 }; 690 690 691 template <typename Value>692 class EdgeMap : public ReferenceMap<Edge, Value> {691 template <typename _Value> 692 class EdgeMap : public ReferenceMap<Edge, _Value> { 693 693 public: 694 694 EdgeMap(const Graph&) {} 695 EdgeMap(const Graph&, const Value&) {}695 EdgeMap(const Graph&, const _Value&) {} 696 696 EdgeMap(const EdgeMap&) {} 697 697 -
src/lemon/concept/maps.h
r959 r987 37 37 public: 38 38 /// Map's key type. 39 typedef K Key Type;40 /// Map's value type. (The type of objects associated with the keys). 41 typedef T Value Type;39 typedef K Key; 40 /// Map's value type. (The type of objects associated with the keys). 41 typedef T Value; 42 42 43 43 /// Returns the value associated with a key. 44 Value Type operator[](const KeyType &k) const {return ValueType();}44 Value operator[](const Key &k) const {return Value();} 45 45 46 46 ///Default constructor … … 55 55 public: 56 56 /// Map's key type. 57 typedef K Key Type;58 /// Map's value type. (The type of objects associated with the keys). 59 typedef T Value Type;57 typedef K Key; 58 /// Map's value type. (The type of objects associated with the keys). 59 typedef T Value; 60 60 61 61 /// Sets the value associated with a key. 62 void set(const Key Type &k,const ValueType &t) {}62 void set(const Key &k,const Value &t) {} 63 63 64 64 ///Default constructor … … 73 73 public: 74 74 /// Map's key type. 75 typedef K Key Type;76 /// Map's value type. (The type of objects associated with the keys). 77 typedef T Value Type;75 typedef K Key; 76 /// Map's value type. (The type of objects associated with the keys). 77 typedef T Value; 78 78 79 79 /// Returns the value associated with a key. 80 Value Type operator[](const KeyType &k) const {return ValueType();}80 Value operator[](const Key &k) const {return Value();} 81 81 /// Sets the value associated with a key. 82 void set(const Key Type &k,const ValueType &t) {}82 void set(const Key &k,const Value &t) {} 83 83 84 84 ///Default constructor … … 93 93 public: 94 94 /// Map's key type. 95 typedef K Key Type;96 /// Map's value type. (The type of objects associated with the keys). 97 typedef T Value Type;95 typedef K Key; 96 /// Map's value type. (The type of objects associated with the keys). 97 typedef T Value; 98 98 99 99 protected: 100 Value Typetmp;101 public: 102 typedef Value Type& ReferenceType;100 Value tmp; 101 public: 102 typedef Value& Reference; 103 103 /// Map's const reference type. 104 typedef const Value Type& ConstReferenceType;104 typedef const Value& ConstReference; 105 105 106 106 ///Returns a reference to the value associated to a key. 107 Reference Type operator[](const KeyType&i) { return tmp; }107 Reference operator[](const Key &i) { return tmp; } 108 108 ///Returns a const reference to the value associated to a key. 109 ConstReference Type operator[](const KeyType&i) const109 ConstReference operator[](const Key &i) const 110 110 { return tmp; } 111 111 /// Sets the value associated with a key. 112 void set(const Key Type &k,const ValueType &t) { operator[](k)=t; }112 void set(const Key &k,const Value &t) { operator[](k)=t; } 113 113 114 114 ///Default constructor … … 150 150 template<typename ReadMap> 151 151 struct ReadMapConcept { 152 typedef typename ReadMap::Key Type KeyType;153 typedef typename ReadMap::Value Type ValueType;152 typedef typename ReadMap::Key Key; 153 typedef typename ReadMap::Value Value; 154 154 155 155 void constraints() { 156 156 // No constraints for constructor. 157 157 158 // What are the requirement for the Value Type?158 // What are the requirement for the Value? 159 159 // CopyConstructible? Assignable? None of these? 160 Value Typev = m[k];160 Value v = m[k]; 161 161 v = m[k]; 162 162 … … 166 166 167 167 ReadMap m; 168 Key Typek;168 Key k; 169 169 }; 170 170 171 171 template<typename WriteMap> 172 172 struct WriteMapConcept { 173 typedef typename WriteMap::Key Type KeyType;174 typedef typename WriteMap::Value Type ValueType;173 typedef typename WriteMap::Key Key; 174 typedef typename WriteMap::Value Value; 175 175 176 176 void constraints() { … … 181 181 182 182 WriteMap m; 183 Key Typek;184 Value Typev;183 Key k; 184 Value v; 185 185 }; 186 186 … … 195 195 template<typename ReferenceMap> 196 196 struct ReferenceMapConcept { 197 typedef typename ReferenceMap::Key Type KeyType;198 typedef typename ReferenceMap::Value Type ValueType;199 typedef typename ReferenceMap::Reference Type ReferenceType;197 typedef typename ReferenceMap::Key Key; 198 typedef typename ReferenceMap::Value Value; 199 typedef typename ReferenceMap::Reference Reference; 200 200 201 201 // What for is this? 202 typedef typename ReferenceMap::ConstReference Type ConstReferenceType;202 typedef typename ReferenceMap::ConstReference ConstReference; 203 203 204 204 void constraints() { … … 208 208 // Or should we require real reference? 209 209 // Like this: 210 // Value Type&vv = m[k];210 // Value &vv = m[k]; 211 211 // ignore_unused_variable_warning(vv); 212 212 } 213 213 214 214 ReferenceMap m; 215 Key Typek;216 Value Typev;215 Key k; 216 Value v; 217 217 }; 218 218 … … 236 236 const GraphMap &c; 237 237 const Graph &g; 238 const typename GraphMap::Value Type&t;238 const typename GraphMap::Value &t; 239 239 }; 240 240 -
src/lemon/default_map.h
r980 r987 34 34 /** The ArrayMap template class is graph map structure what 35 35 * automatically updates the map when a key is added to or erased from 36 * the map. This map uses the VectorMap if the Value Typeis a primitive36 * the map. This map uses the VectorMap if the Value is a primitive 37 37 * type and the ArrayMap for the other cases. 38 38 * 39 39 * The template parameter is the MapRegistry that the maps 40 * will belong to and the Value Type.40 * will belong to and the Value. 41 41 */ 42 42 … … 148 148 149 149 typedef typename Parent::Graph Graph; 150 typedef typename Parent::Value Type ValueType;150 typedef typename Parent::Value Value; 151 151 152 152 DefaultMap(const Graph& _g) : Parent(_g) {} 153 DefaultMap(const Graph& _g, const Value Type& _v) : Parent(_g, _v) {}153 DefaultMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {} 154 154 }; 155 155 … … 181 181 182 182 //typedef typename Parent::Graph Graph; 183 typedef typename Parent::Value Type ValueType;183 typedef typename Parent::Value Value; 184 184 185 185 NodeMap(const Graph& _g) 186 186 : Parent(_g) {} 187 NodeMap(const Graph& _g, const Value Type& _v)187 NodeMap(const Graph& _g, const Value& _v) 188 188 : Parent(_g, _v) {} 189 189 … … 201 201 202 202 //typedef typename Parent::Graph Graph; 203 typedef typename Parent::Value Type ValueType;203 typedef typename Parent::Value Value; 204 204 205 205 EdgeMap(const Graph& _g) 206 206 : Parent(_g) {} 207 EdgeMap(const Graph& _g, const Value Type& _v)207 EdgeMap(const Graph& _g, const Value& _v) 208 208 : Parent(_g, _v) {} 209 209 -
src/lemon/dijkstra.h
r986 r987 38 38 /// 39 39 ///The type of the length is determined by the 40 ///\ref concept::ReadMap::Value Type "ValueType" of the length map.40 ///\ref concept::ReadMap::Value "Value" of the length map. 41 41 /// 42 42 ///It is also possible to change the underlying priority heap. … … 82 82 83 83 ///The type of the length of the edges. 84 typedef typename LM::Value Type ValueType;84 typedef typename LM::Value Value; 85 85 ///The type of the map that stores the edge lengths. 86 86 typedef LM LengthMap; … … 92 92 typedef typename Graph::template NodeMap<Node> PredNodeMap; 93 93 ///The type of the map that stores the dists of the nodes. 94 typedef typename Graph::template NodeMap<Value Type> DistMap;94 typedef typename Graph::template NodeMap<Value> DistMap; 95 95 96 96 private: … … 238 238 typename GR::template NodeMap<int> heap_map(*G,-1); 239 239 240 typedef Heap<Node, Value Type, typename GR::template NodeMap<int>,241 std::less<Value Type> >240 typedef Heap<Node, Value, typename GR::template NodeMap<int>, 241 std::less<Value> > 242 242 HeapType; 243 243 … … 249 249 250 250 Node v=heap.top(); 251 Value Typeoldvalue=heap[v];251 Value oldvalue=heap[v]; 252 252 heap.pop(); 253 253 distance->set(v, oldvalue); … … 282 282 ///\warning If node \c v in unreachable from the root the return value 283 283 ///of this funcion is undefined. 284 Value Typedist(Node v) const { return (*distance)[v]; }284 Value dist(Node v) const { return (*distance)[v]; } 285 285 286 286 ///Returns the 'previous edge' of the shortest path tree. -
src/lemon/dimacs.h
r986 r987 51 51 CostMap& cost) { 52 52 g.clear(); 53 typename CapacityMap::Value Type_cap;54 typename CostMap::Value Type_cost;53 typename CapacityMap::Value _cap; 54 typename CostMap::Value _cost; 55 55 char d; 56 56 std::string problem; -
src/lemon/graph_wrapper.h
r986 r987 1122 1122 typename Graph::template EdgeMap<T> forward_map, backward_map; 1123 1123 public: 1124 typedef T Value Type;1125 typedef Edge Key Type;1124 typedef T Value; 1125 typedef Edge Key; 1126 1126 1127 1127 EdgeMap(const SubBidirGraphWrapper<Graph, … … 1151 1151 } 1152 1152 1153 typename Graph::template EdgeMap<T>::ConstReference Type1153 typename Graph::template EdgeMap<T>::ConstReference 1154 1154 operator[](Edge e) const { 1155 1155 if (!e.backward) … … 1159 1159 } 1160 1160 1161 typename Graph::template EdgeMap<T>::Reference Type1161 typename Graph::template EdgeMap<T>::Reference 1162 1162 operator[](Edge e) { 1163 1163 if (!e.backward) … … 1346 1346 const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>* res_graph; 1347 1347 public: 1348 typedef Number Value Type;1349 typedef Edge Key Type;1348 typedef Number Value; 1349 typedef Edge Key; 1350 1350 ResCap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& 1351 1351 _res_graph) : res_graph(&_res_graph) { } -
src/lemon/kruskal.h
r986 r987 113 113 const Map &m; 114 114 public: 115 typedef typename Map::Value Type ValueType;115 typedef typename Map::Value Value; 116 116 117 117 NonConstMapWr(const Map &_m) : m(_m) {} 118 118 119 template<class Key Type>120 void set(Key Type 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); } 121 121 }; 122 122 … … 151 151 class KruskalMapInput 152 152 : public std::vector< std::pair<typename GR::Edge, 153 typename Map::Value Type> > {153 typename Map::Value> > { 154 154 155 155 public: 156 156 typedef std::vector< std::pair<typename GR::Edge, 157 typename Map::Value Type> > Parent;157 typename Map::Value> > Parent; 158 158 typedef typename Parent::value_type value_type; 159 159 … … 236 236 /// wrapper function exists: \ref kruskalEdgeMap_IteratorOut(). 237 237 /// 238 /// \warning Not a regular property map, as it doesn't know its Key Type238 /// \warning Not a regular property map, as it doesn't know its Key 239 239 240 240 template<class Iterator> … … 243 243 244 244 public: 245 typedef bool Value Type;245 typedef bool Value; 246 246 247 247 KruskalSequenceOutput(Iterator const &_it) : it(_it) {} 248 248 249 template<typename Key Type>250 void set(Key Typeconst& 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;} } 251 251 }; 252 252 … … 288 288 template <class GR, class IN, class RET> 289 289 inline 290 typename IN::Value Type290 typename IN::Value 291 291 kruskalEdgeMap(GR const& G, 292 292 IN const& in, … … 333 333 template <class GR, class IN, class RET> 334 334 inline 335 typename IN::Value Type335 typename IN::Value 336 336 kruskalEdgeMap_IteratorOut(const GR& G, 337 337 const IN& in, -
src/lemon/map_defines.h
r937 r987 52 52 */ 53 53 #define CREATE_NODE_MAP(DynMap) \ 54 template <typename Value> \55 class NodeMap : public DynMap<NodeMapRegistry, Value> { \56 public: \ 57 typedef DynMap<NodeMapRegistry, Value> Parent; \54 template <typename _Value> \ 55 class NodeMap : public DynMap<NodeMapRegistry, _Value> { \ 56 public: \ 57 typedef DynMap<NodeMapRegistry, _Value> Parent; \ 58 58 NodeMap(const typename Parent::Graph& g) \ 59 59 : Parent(g, g.node_maps) {} \ 60 NodeMap(const typename Parent::Graph& g, const Value& v) \60 NodeMap(const typename Parent::Graph& g, const _Value& v) \ 61 61 : Parent(g, g.node_maps, v) {} \ 62 62 NodeMap(const NodeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \ … … 82 82 */ 83 83 #define CREATE_EDGE_MAP(DynMap) \ 84 template <typename Value> \85 class EdgeMap : public DynMap<EdgeMapRegistry, Value> { \86 public: \ 87 typedef DynMap<EdgeMapRegistry, Value> Parent; \84 template <typename _Value> \ 85 class EdgeMap : public DynMap<EdgeMapRegistry, _Value> { \ 86 public: \ 87 typedef DynMap<EdgeMapRegistry, _Value> Parent; \ 88 88 \ 89 89 EdgeMap(const typename Parent::Graph& g) \ 90 90 : Parent(g, g.edge_maps) {} \ 91 EdgeMap(const typename Parent::Graph& g, const Value& v) \91 EdgeMap(const typename Parent::Graph& g, const _Value& v) \ 92 92 : Parent(g, g.edge_maps, v) {} \ 93 93 EdgeMap(const EdgeMap& copy) : Parent(static_cast<const Parent&>(copy)) {} \ … … 126 126 */ 127 127 #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; \128 template <typename _Value> \ 129 class SymEdgeMap : public DynMap<SymEdgeMapRegistry, _Value> { \ 130 public: \ 131 typedef DynMap<SymEdgeMapRegistry, _Value> Parent; \ 132 132 \ 133 133 SymEdgeMap(const typename Parent::Graph& g) \ 134 134 : Parent(g, g.sym_edge_maps) {} \ 135 SymEdgeMap(const typename Parent::Graph& g, const Value& v) \135 SymEdgeMap(const typename Parent::Graph& g, const _Value& v) \ 136 136 : Parent(g, g.sym_edge_maps, v) {} \ 137 137 SymEdgeMap(const SymEdgeMap& copy) \ … … 154 154 */ 155 155 #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; \156 template <typename _Value> \ 157 class NodeMap : public From::template NodeMap<_Value> { \ 158 \ 159 public: \ 160 typedef typename From::template NodeMap<_Value> Parent; \ 161 161 \ 162 162 NodeMap(const To& to) \ 163 163 : Parent(static_cast<const From&>(from)) { } \ 164 NodeMap(const To& to, const Value& value) \164 NodeMap(const To& to, const _Value& value) \ 165 165 : Parent(static_cast<const From&>(from), value) { } \ 166 166 NodeMap(const NodeMap& copy) \ … … 183 183 */ 184 184 #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; \185 template <typename _Value> \ 186 class EdgeMap : public From::template EdgeMap<_Value> { \ 187 \ 188 public: \ 189 typedef typename From::template EdgeMap<_Value> Parent; \ 190 190 \ 191 191 EdgeMap(const To& to) \ 192 192 : Parent(static_cast<const From&>(from)) { } \ 193 EdgeMap(const To& to, const Value& value) \193 EdgeMap(const To& to, const _Value& value) \ 194 194 : Parent(static_cast<const From&>(from), value) { } \ 195 195 EdgeMap(const EdgeMap& copy) \ -
src/lemon/map_iterator.h
r921 r987 42 42 43 43 /// The key type of the iterator. 44 typedef typename Map::Key Type 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::Value Type ValueType;50 /// The reference type of the iterator. 51 typedef typename Map::Reference Type ReferenceType;52 /// The pointer type of the iterator. 53 typedef typename Map::Pointer Type PointerType;54 55 /// The const value type of the iterator. 56 typedef typename Map::ConstValue Type ConstValueType;57 /// The const reference type of the iterator. 58 typedef typename Map::ConstReference Type ConstReferenceType;59 /// The pointer type of the iterator. 60 typedef typename Map::ConstPointer Type 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; 61 61 62 62 protected: … … 105 105 106 106 /// The key type of the iterator. 107 typedef typename Map::Key Type 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::Value Type ValueType;113 /// The reference type of the iterator. 114 typedef typename Map::Reference Type ReferenceType;115 /// The pointer type of the iterator. 116 typedef typename Map::Pointer Type PointerType;117 118 /// The const value type of the iterator. 119 typedef typename Map::ConstValue Type ConstValueType;120 /// The const reference type of the iterator. 121 typedef typename Map::ConstReference Type ConstReferenceType;122 /// The pointer type of the iterator. 123 typedef typename Map::ConstPointer Type 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; 124 124 125 125 public: 126 126 127 127 /// The value type of the iterator. 128 typedef extended_pair<Key Type, const KeyType&,129 Value Type, const ValueType&> PairValueType;128 typedef extended_pair<Key, const Key&, 129 Value, const Value&> PairValue; 130 130 131 131 /// The reference type of the iterator. 132 typedef extended_pair<const Key Type&, const KeyType&,133 Reference Type, ReferenceType> PairReferenceType;132 typedef extended_pair<const Key&, const Key&, 133 Reference, Reference> PairReference; 134 134 135 135 /// Default constructor. … … 141 141 142 142 /// Dereference operator for the iterator. 143 PairReference Typeoperator*() {144 return PairReference Type(Base::it, (*map)[Base::it]);145 } 146 147 /// The pointer type of the iterator. 148 class PairPointer Type{143 PairReference operator*() { 144 return PairReference(Base::it, (*map)[Base::it]); 145 } 146 147 /// The pointer type of the iterator. 148 class PairPointer { 149 149 friend class MapIterator; 150 150 private: 151 PairReference Typedata;152 PairPointer Type(const KeyType& key, ReferenceType val)151 PairReference data; 152 PairPointer(const Key& key, Reference val) 153 153 : data(key, val) {} 154 154 public: 155 PairReference Type* operator->() {return &data;}155 PairReference* operator->() {return &data;} 156 156 }; 157 157 158 158 /// Arrow operator for the iterator. 159 PairPointer Typeoperator->() {160 return PairPointer Type(Base::it, ((*map)[Base::it]));159 PairPointer operator->() { 160 return PairPointer(Base::it, ((*map)[Base::it])); 161 161 } 162 162 … … 181 181 typedef std::forward_iterator_tag iterator_category; 182 182 typedef int difference_type; 183 typedef PairValue Typevalue_type;184 typedef PairReference Typereference;185 typedef PairPointer Typepointer;183 typedef PairValue value_type; 184 typedef PairReference reference; 185 typedef PairPointer pointer; 186 186 }; 187 187 … … 198 198 199 199 /// The key type of the iterator. 200 typedef typename Map::Key Type 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::Value Type ValueType;206 /// The reference type of the iterator. 207 typedef typename Map::Reference Type ReferenceType;208 /// The pointer type of the iterator. 209 typedef typename Map::Pointer Type PointerType;210 211 /// The const value type of the iterator. 212 typedef typename Map::ConstValue Type ConstValueType;213 /// The const reference type of the iterator. 214 typedef typename Map::ConstReference Type ConstReferenceType;215 /// The pointer type of the iterator. 216 typedef typename Map::ConstPointer Type 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; 217 217 218 218 public: … … 233 233 234 234 /// The value type of the iterator. 235 typedef extended_pair<Key Type, const KeyType&,236 Value Type, const ValueType&> PairValueType;235 typedef extended_pair<Key, const Key&, 236 Value, const Value&> PairValue; 237 237 238 238 /// The reference type of map. 239 typedef extended_pair<const Key Type&, const KeyType&,240 ConstReference Type, ConstReferenceType> PairReferenceType;239 typedef extended_pair<const Key&, const Key&, 240 ConstReference, ConstReference> PairReference; 241 241 242 242 /// Dereference operator for the iterator. 243 PairReference Typeoperator*() {244 return PairReference Type(Base::it, (*map)[Base::it]);245 } 246 247 /// The pointer type of the iterator. 248 class PairPointer Type{243 PairReference operator*() { 244 return PairReference(Base::it, (*map)[Base::it]); 245 } 246 247 /// The pointer type of the iterator. 248 class PairPointer { 249 249 friend class MapConstIterator; 250 250 private: 251 PairReference Typedata;252 PairPointer Type(const KeyType& key, ConstReferenceType val)251 PairReference data; 252 PairPointer(const Key& key, ConstReference val) 253 253 : data(key, val) {} 254 254 public: 255 PairReference Type* operator->() {return &data;}255 PairReference* operator->() {return &data;} 256 256 }; 257 257 258 258 /// Arrow operator for the iterator. 259 PairPointer Typeoperator->() {260 return PairPointer Type(Base::it, (*map)[Base::it]);259 PairPointer operator->() { 260 return PairPointer(Base::it, (*map)[Base::it]); 261 261 } 262 262 … … 281 281 typedef std::input_iterator_tag iterator_category; 282 282 typedef int difference_type; 283 typedef PairValue Typevalue_type;284 typedef PairReference Typereference;285 typedef PairPointer Typepointer;283 typedef PairValue value_type; 284 typedef PairReference reference; 285 typedef PairPointer pointer; 286 286 }; 287 287 … … 298 298 299 299 /// The key type of the iterator. 300 typedef typename Map::Key Type KeyType;300 typedef typename Map::Key Key; 301 301 /// The iterator to iterate on the keys. 302 302 typedef typename Map::KeyIt KeyIt; … … 324 324 325 325 /// The dereferencing operator of the iterator. 326 Key Typeoperator*() const {327 return static_cast<Key Type>(Base::it);326 Key operator*() const { 327 return static_cast<Key>(Base::it); 328 328 } 329 329 … … 332 332 typedef std::input_iterator_tag iterator_category; 333 333 typedef int difference_type; 334 typedef Key Typevalue_type;335 typedef const Key Type& reference;336 typedef const Key Type* pointer;334 typedef Key value_type; 335 typedef const Key& reference; 336 typedef const Key* pointer; 337 337 }; 338 338 … … 353 353 354 354 /// The key type of the iterator. 355 typedef typename Map::Key Type 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::Value Type ValueType;362 /// The reference type of the iterator. 363 typedef typename Map::Reference Type ReferenceType;364 /// The pointer type of the iterator. 365 typedef typename Map::Pointer Type PointerType;366 367 /// The const value type of the iterator. 368 typedef typename Map::ConstValue Type ConstValueType;369 /// The const reference type of the iterator. 370 typedef typename Map::ConstReference Type ConstReferenceType;371 /// The pointer type of the iterator. 372 typedef typename Map::ConstPointer Type 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; 373 373 374 374 private: … … 400 400 401 401 /// The dereferencing operator of the iterator. 402 Reference Typeoperator*() const {402 Reference operator*() const { 403 403 return (*map)[Base::it]; 404 404 } 405 405 406 406 /// The arrow operator of the iterator. 407 Pointer Typeoperator->() const {407 Pointer operator->() const { 408 408 return &(operator*()); 409 409 } … … 413 413 typedef std::forward_iterator_tag iterator_category; 414 414 typedef int difference_type; 415 typedef Value Typevalue_type;416 typedef Reference Typereference;417 typedef Pointer Typepointer;415 typedef Value value_type; 416 typedef Reference reference; 417 typedef Pointer pointer; 418 418 }; 419 419 … … 431 431 432 432 /// The key type of the iterator. 433 typedef typename Map::Key Type 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::Value Type ValueType;439 /// The reference type of the iterator. 440 typedef typename Map::Reference Type ReferenceType;441 /// The pointer type of the iterator. 442 typedef typename Map::Pointer Type PointerType;443 444 /// The const value type of the iterator. 445 typedef typename Map::ConstValue Type ConstValueType;446 /// The const reference type of the iterator. 447 typedef typename Map::ConstReference Type ConstReferenceType;448 /// The pointer type of the iterator. 449 typedef typename Map::ConstPointer Type 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; 450 450 451 451 private: … … 482 482 483 483 /// The dereferencing operator of the iterator. 484 ConstReference Typeoperator*() const {484 ConstReference operator*() const { 485 485 return (*map)[Base::it]; 486 486 } 487 487 488 488 /// The arrow operator of the iterator. 489 ConstPointer Typeoperator->() const {489 ConstPointer operator->() const { 490 490 return &(operator*()); 491 491 } … … 495 495 typedef std::input_iterator_tag iterator_category; 496 496 typedef int difference_type; 497 typedef Value Typevalue_type;498 typedef ConstReference Typereference;499 typedef ConstPointer Typepointer;497 typedef Value value_type; 498 typedef ConstReference reference; 499 typedef ConstPointer pointer; 500 500 }; 501 501 … … 512 512 513 513 /// The key type of the iterator. 514 typedef typename Map::Key Type 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::Value Type ValueType;521 /// The reference type of the iterator. 522 typedef typename Map::Reference Type ReferenceType;523 /// The pointer type of the iterator. 524 typedef typename Map::Pointer Type PointerType;525 526 /// The const value type of the iterator. 527 typedef typename Map::ConstValue Type ConstValueType;528 /// The const reference type of the iterator. 529 typedef typename Map::ConstReference Type ConstReferenceType;530 /// The pointer type of the iterator. 531 typedef typename Map::ConstPointer Type 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; 532 532 533 533 /// The map initialized const key set. … … 549 549 public: 550 550 // STL compatibility typedefs. 551 typedef Value Typevalue_type;551 typedef Value value_type; 552 552 typedef ConstIterator const_iterator; 553 typedef ConstReference Typeconst_reference;554 typedef ConstPointer Typeconst_pointer;553 typedef ConstReference const_reference; 554 typedef ConstPointer const_pointer; 555 555 typedef int difference_type; 556 556 }; … … 568 568 569 569 /// The key type of the iterator. 570 typedef typename Map::Key Type 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::Value Type ValueType;577 /// The reference type of the iterator. 578 typedef typename Map::Reference Type ReferenceType;579 /// The pointer type of the iterator. 580 typedef typename Map::Pointer Type PointerType;581 582 /// The const value type of the iterator. 583 typedef typename Map::ConstValue Type ConstValueType;584 /// The const reference type of the iterator. 585 typedef typename Map::ConstReference Type ConstReferenceType;586 /// The pointer type of the iterator. 587 typedef typename Map::ConstPointer Type 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; 588 588 589 589 /// The map initialized const value set. … … 605 605 public: 606 606 // STL compatibility typedefs. 607 typedef Value Typevalue_type;607 typedef Value value_type; 608 608 typedef ConstIterator const_iterator; 609 typedef ConstReference Typeconst_reference;610 typedef ConstPointer Typeconst_pointer;609 typedef ConstReference const_reference; 610 typedef ConstPointer const_pointer; 611 611 typedef int difference_type; 612 612 }; … … 625 625 626 626 /// The key type of the iterator. 627 typedef typename Map::Key Type 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::Value Type ValueType;634 /// The reference type of the iterator. 635 typedef typename Map::Reference Type ReferenceType;636 /// The pointer type of the iterator. 637 typedef typename Map::Pointer Type PointerType;638 639 /// The const value type of the iterator. 640 typedef typename Map::ConstValue Type ConstValueType;641 /// The const reference type of the iterator. 642 typedef typename Map::ConstReference Type ConstReferenceType;643 /// The pointer type of the iterator. 644 typedef typename Map::ConstPointer Type 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; 645 645 646 646 /// The map initialized value set. … … 675 675 public: 676 676 // STL compatibility typedefs. 677 typedef Value Typevalue_type;677 typedef Value value_type; 678 678 typedef Iterator iterator; 679 679 typedef ConstIterator const_iterator; 680 typedef Reference Typereference;681 typedef ConstReference Typeconst_reference;682 typedef Pointer Typepointer;683 typedef ConstPointer Typeconst_pointer;680 typedef Reference reference; 681 typedef ConstReference const_reference; 682 typedef Pointer pointer; 683 typedef ConstPointer const_pointer; 684 684 typedef int difference_type; 685 685 -
src/lemon/maps.h
r977 r987 37 37 public: 38 38 ///\e 39 typedef K Key Type;39 typedef K Key; 40 40 ///\e 41 typedef T Value Type;41 typedef T Value; 42 42 }; 43 43 … … 109 109 110 110 /// This is essentially a wrapper for \c std::map. With addition that 111 /// you can specify a default value different from \c Value Type() .111 /// you can specify a default value different from \c Value() . 112 112 /// 113 113 /// \todo Provide allocator parameter... 114 template <typename K ey, typename T, typename Compare = std::less<Key> >115 class StdMap : public std::map<K ey,T,Compare> {116 typedef std::map<K ey,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; 117 117 T v; 118 118 typedef typename parent::value_type PairType; 119 119 120 120 public: 121 typedef K ey KeyType;122 typedef T Value Type;123 typedef T& Reference Type;124 typedef const T& ConstReference Type;121 typedef K Key; 122 typedef T Value; 123 typedef T& Reference; 124 typedef const T& ConstReference; 125 125 126 126 … … 144 144 } 145 145 146 Reference Typeoperator[](const Key &k) {146 Reference operator[](const Key &k) { 147 147 return insert(PairType(k,v)).first -> second; 148 148 } 149 ConstReference Typeoperator[](const Key &k) const {149 ConstReference operator[](const Key &k) const { 150 150 typename parent::iterator i = lower_bound(k); 151 151 if (i == parent::end() || parent::key_comp()(k, (*i).first)) -
src/lemon/min_cost_flow.h
r986 r987 60 60 class MinCostFlow { 61 61 62 typedef typename LengthMap::Value TypeLength;62 typedef typename LengthMap::Value Length; 63 63 64 64 //Warning: this should be integer type 65 typedef typename CapacityMap::Value TypeCapacity;65 typedef typename CapacityMap::Value Capacity; 66 66 67 67 typedef typename Graph::Node Node; … … 95 95 const NodeMap &pot; 96 96 public : 97 typedef typename LengthMap::Key Type KeyType;98 typedef typename LengthMap::Value Type ValueType;97 typedef typename LengthMap::Key Key; 98 typedef typename LengthMap::Value Value; 99 99 100 100 ModLengthMap(const ResGW& _g, … … 102 102 g(_g), /*rev(_rev),*/ length(_length), pot(_pot) { } 103 103 104 Value Typeoperator[](typename ResGW::Edge e) const {104 Value operator[](typename ResGW::Edge e) const { 105 105 if (g.forward(e)) 106 106 return length[e]-(pot[g.target(e)]-pot[g.source(e)]); -
src/lemon/suurballe.h
r986 r987 59 59 60 60 61 typedef typename LengthMap::Value TypeLength;61 typedef typename LengthMap::Value Length; 62 62 63 63 typedef typename Graph::Node Node; -
src/lemon/vector_map.h
r980 r987 54 54 typedef _Graph Graph; 55 55 /// The key type of the map. 56 typedef _Item Key Type;56 typedef _Item Key; 57 57 /// The id map type of the map. 58 58 typedef AlterationObserverRegistry<_Item> Registry; … … 72 72 public: 73 73 74 /// The value type of the map.75 typedef Value ValueType;76 74 /// The reference type of the map; 77 typedef typename Container::reference Reference Type;75 typedef typename Container::reference Reference; 78 76 /// The pointer type of the map; 79 typedef typename Container::pointer Pointer Type;77 typedef typename Container::pointer Pointer; 80 78 81 79 /// The const value type of the map. 82 typedef const Value ConstValue Type;80 typedef const Value ConstValue; 83 81 /// The const reference type of the map; 84 typedef typename Container::const_reference ConstReference Type;82 typedef typename Container::const_reference ConstReference; 85 83 /// The pointer type of the map; 86 typedef typename Container::const_pointer ConstPointer Type;84 typedef typename Container::const_pointer ConstPointer; 87 85 88 86 /// Constructor to attach the new map into the registry. … … 151 149 /// actual items of the graph. 152 150 153 Reference Type operator[](const KeyType& key) {151 Reference operator[](const Key& key) { 154 152 return container[graph->id(key)]; 155 153 } … … 160 158 /// actual items of the graph. 161 159 162 ConstReference Type operator[](const KeyType& key) const {160 ConstReference operator[](const Key& key) const { 163 161 return container[graph->id(key)]; 164 162 } … … 170 168 /// 171 169 172 void set(const Key Type& key, const ValueType& value) {170 void set(const Key& key, const Value& value) { 173 171 (*this)[key] = value; 174 172 } … … 179 177 /// and it overrides the add() member function of the observer base. 180 178 181 void add(const Key Type& key) {179 void add(const Key& key) { 182 180 int id = graph->id(key); 183 181 if (id >= (int)container.size()) { … … 190 188 /// Erase a key from the map. It called by the observer registry 191 189 /// and it overrides the erase() member function of the observer base. 192 void erase(const Key Type&) {}190 void erase(const Key&) {} 193 191 194 192 /// Buildes the map. -
src/lemon/xy.h
r967 r987 51 51 public: 52 52 53 typedef T Value Type;53 typedef T Value; 54 54 55 55 T x,y; -
src/test/sym_graph_test.h
r986 r987 96 96 { 97 97 //Check the typedef's 98 typename Graph::template SymEdgeMap<int>::Value Typeval;98 typename Graph::template SymEdgeMap<int>::Value val; 99 99 val = 1; 100 typename Graph::template SymEdgeMap<int>::Key Typekey;100 typename Graph::template SymEdgeMap<int>::Key key; 101 101 key = typename Graph::SymEdgeIt(G); 102 102 } … … 119 119 { 120 120 //Check the typedef's 121 typename Graph::template SymEdgeMap<bool>::Value Typeval;121 typename Graph::template SymEdgeMap<bool>::Value val; 122 122 val=true; 123 typename Graph::template SymEdgeMap<bool>::Key Typekey;123 typename Graph::template SymEdgeMap<bool>::Key key; 124 124 key= typename Graph::SymEdgeIt(G); 125 125 } -
src/work/alpar/boolmap_iter.cc
r986 r987 14 14 typedef typename GG::Edge Edge; 15 15 16 typedef Edge Key Type;17 typedef bool Value Type;16 typedef Edge Key; 17 typedef bool Value; 18 18 19 19 friend class RefType; … … 68 68 RefType(BoolIterEdgeMap &_M,Edge _e) : M(_M), e(_e) { } 69 69 70 operator Value Type() const70 operator Value() const 71 71 { 72 72 return M.isTrue(e); 73 73 74 74 } 75 Value Type operator = (ValueType v) const75 Value operator = (Value v) const 76 76 { 77 77 if(v) M.setTrue(e); -
src/work/alpar/dijkstra.h
r986 r987 47 47 typedef LM LengthMap; 48 48 //The type of the length of the edges. 49 typedef typename LM::Value Type ValueType;49 typedef typename LM::Value Value; 50 50 ///The heap type used by Dijkstra algorithm. 51 51 … … 55 55 ///\sa Dijkstra 56 56 typedef BinHeap<typename Graph::Node, 57 typename LM::Value Type,57 typename LM::Value, 58 58 typename GR::template NodeMap<int>, 59 std::less<Value Type> > Heap;59 std::less<Value> > Heap; 60 60 61 61 ///\brief The type of the map that stores the last … … 91 91 ///It must meet the \ref concept::WriteMap "WriteMap" concept. 92 92 /// 93 typedef typename Graph::template NodeMap<typename LM::Value Type> DistMap;93 typedef typename Graph::template NodeMap<typename LM::Value> DistMap; 94 94 ///Instantiates a DistMap. 95 95 … … 110 110 /// 111 111 ///The type of the length is determined by the 112 ///\ref concept::ReadMap::Value Type "ValueType" of the length map.112 ///\ref concept::ReadMap::Value "Value" of the length map. 113 113 /// 114 114 ///It is also possible to change the underlying priority heap. … … 159 159 160 160 ///The type of the length of the edges. 161 typedef typename TR::LengthMap::Value Type ValueType;161 typedef typename TR::LengthMap::Value Value; 162 162 ///The type of the map that stores the edge lengths. 163 163 typedef typename TR::LengthMap LengthMap; … … 388 388 389 389 Node v=heap.top(); 390 Value Typeoldvalue=heap[v];390 Value oldvalue=heap[v]; 391 391 heap.pop(); 392 392 distance->set(v, oldvalue); … … 421 421 ///\warning If node \c v in unreachable from the root the return value 422 422 ///of this funcion is undefined. 423 Value Typedist(Node v) const { return (*distance)[v]; }423 Value dist(Node v) const { return (*distance)[v]; } 424 424 425 425 ///Returns the 'previous edge' of the shortest path tree. … … 498 498 typedef typename TR::LengthMap LengthMap; 499 499 ///The type of the length of the edges. 500 typedef typename LengthMap::Value Type ValueType;500 typedef typename LengthMap::Value Value; 501 501 ///\brief The type of the map that stores the last 502 502 ///edges of the shortest paths. -
src/work/alpar/f_ed_ka.h
r986 r987 14 14 namespace lemon { 15 15 template <typename Graph, typename FlowMap, typename CapacityMap> 16 typename FlowMap::Value TypemaxFlow(Graph &G,16 typename FlowMap::Value maxFlow(Graph &G, 17 17 FlowMap &f, 18 18 CapacityMap &c, … … 26 26 typedef typename Graph::OutEdgeIt OutEdgeIt; 27 27 typedef typename Graph::InEdgeIt InEdgeIt; 28 typedef typename FlowMap::Value TypeT;28 typedef typename FlowMap::Value T; 29 29 30 30 T flow_val = 0; -
src/work/alpar/rw_nonref_map.cc
r986 r987 11 11 typedef typename GG::Edge Edge; 12 12 13 typedef Edge Key Type;14 typedef TT Value Type;13 typedef Edge Key; 14 typedef TT Value; 15 15 16 16 class RefType … … 21 21 RefType(Graph &_G,Edge _e) : G(_G), e(_e) { } 22 22 23 operator Value Type() const23 operator Value() const 24 24 { 25 Value Typetmp;25 Value tmp; 26 26 std::cout << G.id(G.source(e)) << "->" 27 27 << G.id(G.target(e)) << ": "; … … 29 29 return tmp; 30 30 } 31 Value Type operator = (ValueType v) const31 Value operator = (Value v) const 32 32 { 33 33 std::cout << G.id(G.source(e)) << "->" … … 48 48 { 49 49 public: 50 typedef K Key Type;51 typedef T Value Type;50 typedef K Key; 51 typedef T Value; 52 52 53 53 class RefType 54 54 { 55 Value Typeval;55 Value val; 56 56 public: 57 RefType(Value Typev) : val(v) { }58 operator Value Type() const { return val; }59 Value Type 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; } 60 60 }; 61 61 62 62 private: 63 Value Typeval;63 Value val; 64 64 public: 65 NullMap(Value Typev) : val(v) { }66 RefType operator[] (Key Typee) const { return RefType(v);}65 NullMap(Value v) : val(v) { } 66 RefType operator[] (Key e) const { return RefType(v);} 67 67 }; 68 68 -
src/work/athos/mincostflow.h
r986 r987 44 44 class MinCostFlow { 45 45 46 typedef typename CostMap::Value TypeCost;47 48 49 typedef typename SupplyDemandMap::Value TypeSupplyDemand;46 typedef typename CostMap::Value Cost; 47 48 49 typedef typename SupplyDemandMap::Value SupplyDemand; 50 50 51 51 typedef typename Graph::Node Node; … … 69 69 const NodeMap &pot; 70 70 public : 71 typedef typename CostMap::Key Type KeyType;72 typedef typename CostMap::Value Type ValueType;71 typedef typename CostMap::Key Key; 72 typedef typename CostMap::Value Value; 73 73 74 Value Typeoperator[](typename ResGraph::Edge e) const {74 Value operator[](typename ResGraph::Edge e) const { 75 75 if (res_graph.forward(e)) 76 76 return ol[e]-(pot[res_graph.target(e)]-pot[res_graph.source(e)]); -
src/work/athos/old/minlengthpaths.h
r986 r987 31 31 class MinLengthPaths { 32 32 33 typedef typename LengthMap::Value TypeLength;33 typedef typename LengthMap::Value Length; 34 34 35 35 typedef typename Graph::Node Node; … … 50 50 const NodeMap &pot; 51 51 public : 52 typedef typename LengthMap::Key Type KeyType;53 typedef typename LengthMap::Value Type ValueType;54 55 Value Typeoperator[](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 { 56 56 //if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){ 57 57 // std::cout<<"Negative length!!"<<std::endl; -
src/work/athos/union_find.h
r921 r987 16 16 namespace lemon { 17 17 18 template <typename Key Type, typename KeyIntMap>18 template <typename Key, typename KeyIntMap> 19 19 class UnionFind { 20 20 KeyIntMap& pointmap; … … 35 35 36 36 //Give a component of one point to the structure 37 int addPoint(Key Typeu){37 int addPoint(Key u){ 38 38 int _index = container.size(); 39 39 VectorElementType buf(_index,1); … … 44 44 45 45 //Finds the big boss of u 46 int find(Key Typeu){46 int find(Key u){ 47 47 if (pointmap.get(u)==-1){ 48 48 int whoami = addPoint(u); … … 62 62 63 63 //Finds u and v in the structures and merges the comopnents, if not equal 64 bool findAndMerge(Key Type u,KeyTypev){64 bool findAndMerge(Key u,Key v){ 65 65 int bu = find(u); 66 66 int bv = find(v); -
src/work/deba/dijkstra.h
r921 r987 22 22 ///so it is easy to change it to any kind of length. 23 23 /// 24 ///The type of the length is determined by the \c Value Typeof the length map.24 ///The type of the length is determined by the \c Value of the length map. 25 25 /// 26 26 ///It is also possible to change the underlying priority heap. … … 60 60 61 61 ///The type of the length of the edges. 62 typedef typename LM::Value Type ValueType;62 typedef typename LM::Value Value; 63 63 ///The type of the map that stores the edge lengths. 64 64 typedef LM LengthMap; … … 70 70 typedef typename Graph::template NodeMap<Node> PredNodeMap; 71 71 ///The type of the map that stores the dists of the nodes. 72 typedef typename Graph::template NodeMap<Value Type> DistMap;72 typedef typename Graph::template NodeMap<Value> DistMap; 73 73 74 74 private: … … 217 217 typename GR::template NodeMap<int> heap_map(*G,-1); 218 218 219 typedef Heap<Node, Value Type, typename GR::template NodeMap<int>,220 std::less<Value Type> >219 typedef Heap<Node, Value, typename GR::template NodeMap<int>, 220 std::less<Value> > 221 221 HeapType; 222 222 … … 228 228 229 229 Node v=heap.top(); 230 Value Typeoldvalue=heap[v];230 Value oldvalue=heap[v]; 231 231 heap.pop(); 232 232 distance->set(v, oldvalue); … … 262 262 ///\warning If node \c v in unreachable from the root the return value 263 263 ///of this funcion is undefined. 264 Value Typedist(Node v) const { return (*distance)[v]; }264 Value dist(Node v) const { return (*distance)[v]; } 265 265 266 266 ///Returns the 'previous edge' of the shortest path tree. -
src/work/klao/iter_map.h
r921 r987 26 26 public: 27 27 28 typedef typename KeyIntMap::Key Type KeyType;29 typedef Val Value Type;28 typedef typename KeyIntMap::Key Key; 29 typedef Val Value; 30 30 31 typedef typename std::vector<Key Type>::const_iterator iterator;31 typedef typename std::vector<Key>::const_iterator iterator; 32 32 33 33 protected: 34 34 KeyIntMap &base; 35 std::vector<Key Type> data;35 std::vector<Key> data; 36 36 size_t bounds[N]; 37 37 Val def_val; … … 56 56 if(m != n) { 57 57 size_t orig_a = a; 58 Key Typeorig_key = data[a];58 Key orig_key = data[a]; 59 59 while(m > n) { 60 60 --m; … … 81 81 } 82 82 83 Val operator[](const Key Type& k) const {83 Val operator[](const Key& k) const { 84 84 return find(base[k]); 85 85 } 86 86 87 void set(const Key Type& k, Val n) {87 void set(const Key& k, Val n) { 88 88 // FIXME: range check? 89 89 size_t a = base[k]; … … 96 96 } 97 97 98 void insert(const Key Type& k, Val n) {98 void insert(const Key& k, Val n) { 99 99 data.push_back(k); 100 100 base.set(k, move(bounds[N-1]++, N-1, n)); … … 103 103 /// This func is not very usable, but necessary to implement 104 104 /// dynamic map behaviour. 105 void remove(const Key Type& k) {105 void remove(const Key& k) { 106 106 size_t a = base[k]; 107 107 if(a < bounds[N-1]) { … … 131 131 132 132 /// For use as an iterator... 133 Key Type& first(KeyType&k, Val n) {133 Key& first(Key &k, Val n) { 134 134 size_t i = (n ? bounds[n-1] : 0); 135 135 if( i < bounds[n] ) { … … 143 143 144 144 /// For use as an iterator... 145 Key Type& next(KeyType&k) {145 Key& next(Key &k) { 146 146 size_t i = base[k]; 147 147 uint8_t n = find(i); -
src/work/marci/augmenting_flow.h
r986 r987 113 113 int* number_of_augmentations; 114 114 public: 115 typedef Node Key Type;116 typedef bool Value Type;115 typedef Node Key; 116 typedef bool Value; 117 117 TrickyReachedMap(IntMap& _map, int& _number_of_augmentations) : 118 118 map(&_map), number_of_augmentations(&_number_of_augmentations) { } -
src/work/marci/bfs_mm.h
r986 r987 141 141 /// Guess what? 142 142 /// \deprecated 143 typename ReachedMap::Value Typereached(const Node& n) const {143 typename ReachedMap::Value reached(const Node& n) const { 144 144 return (*reached_map)[n]; 145 145 } … … 243 243 /// Guess what? 244 244 /// \deprecated 245 typename PredMap::Value Typepred(const Node& n) const {245 typename PredMap::Value pred(const Node& n) const { 246 246 return (*pred_map)[n]; 247 247 } … … 251 251 /// Guess what? 252 252 /// \deprecated 253 typename PredNodeMap::Value TypepredNode(const Node& n) const {253 typename PredNodeMap::Value predNode(const Node& n) const { 254 254 return (*pred_node_map)[n]; 255 255 } … … 259 259 /// Guess what? 260 260 /// \deprecated 261 typename DistMap::Value Typedist(const Node& n) const {261 typename DistMap::Value dist(const Node& n) const { 262 262 return (*dist_map)[n]; 263 263 } -
src/work/marci/bipartite_graph_wrapper.h
r986 r987 795 795 template<typename NM> class NodeMapWrapper { 796 796 public: 797 typedef Node Key Type;798 typedef typename NM::Value Type ValueType;797 typedef Node Key; 798 typedef typename NM::Value Value; 799 799 protected: 800 800 NM* nm; 801 Value Type* s_value, t_value;802 public: 803 NodeMapWrapper(NM& _nm, Value Type& _s_value, ValueType& _t_value) :801 Value* s_value, t_value; 802 public: 803 NodeMapWrapper(NM& _nm, Value& _s_value, Value& _t_value) : 804 804 nm(&_nm), s_value(&_s_value), t_value(&_t_value) { } 805 Value Typeoperator[](const Node& n) const {805 Value operator[](const Node& n) const { 806 806 switch (n.getSpec()) { 807 807 case 0: … … 814 814 } 815 815 } 816 void set(const Node& n, Value Typet) {816 void set(const Node& n, Value t) { 817 817 switch (n.getSpec()) { 818 818 case 0: … … 874 874 class EdgeMapWrapper { 875 875 public: 876 typedef Edge Key Type;877 typedef typename EM::Value Type ValueType;876 typedef Edge Key; 877 typedef typename EM::Value Value; 878 878 protected: 879 879 EM* em; … … 881 881 public: 882 882 EdgeMapWrapper(EM& _em, NM& _nm) : em(&_em), nm(&_nm) { } 883 Value Typeoperator[](const Edge& e) const {883 Value operator[](const Edge& e) const { 884 884 switch (e.getSpec()) { 885 885 case 0: … … 892 892 } 893 893 } 894 void set(const Edge& e, Value Typet) {894 void set(const Edge& e, Value t) { 895 895 switch (e.getSpec()) { 896 896 case 0: -
src/work/marci/experiment/list_graph.h
r986 r987 39 39 std::vector<T> container; 40 40 public: 41 typedef T Value Type;42 typedef Node Key Type;41 typedef T Value; 42 typedef Node Key; 43 43 NodeMap(const ListGraph& _G) : G(_G), container(G.node_id) { } 44 44 NodeMap(const ListGraph& _G, T a) : … … 60 60 std::vector<T> container; 61 61 public: 62 typedef T Value Type;63 typedef Edge Key Type;62 typedef T Value; 63 typedef Edge Key; 64 64 EdgeMap(const ListGraph& _G) : G(_G), container(G.edge_id) { } 65 65 EdgeMap(const ListGraph& _G, T a) : -
src/work/marci/graph_concept.h
r986 r987 168 168 { 169 169 public: 170 typedef T Value Type;171 typedef Node Key Type;170 typedef T Value; 171 typedef Node Key; 172 172 173 173 NodeMap(const GraphConcept& g) { } … … 206 206 { 207 207 public: 208 typedef T Value Type;209 typedef Edge Key Type;208 typedef T Value; 209 typedef Edge Key; 210 210 211 211 EdgeMap(const GraphConcept& g) {} -
src/work/marci/leda/leda_graph_wrapper.h
r986 r987 262 262 leda_node_map<T> leda_stuff; 263 263 public: 264 typedef T Value Type;265 typedef Node Key Type;264 typedef T Value; 265 typedef Node Key; 266 266 267 267 NodeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {} … … 282 282 leda_edge_map<T> leda_stuff; 283 283 public: 284 typedef T Value Type;285 typedef Edge Key Type;284 typedef T Value; 285 typedef Edge Key; 286 286 287 287 EdgeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {} … … 304 304 leda_node_array<T>* leda_stuff; 305 305 public: 306 typedef T Value Type;307 typedef Node Key Type;306 typedef T Value; 307 typedef Node Key; 308 308 309 309 NodeMapWrapper(leda_node_array<T>& _leda_stuff) : … … 326 326 leda_edge_array<T>* leda_stuff; 327 327 public: 328 typedef T Value Type;329 typedef Edge Key Type;328 typedef T Value; 329 typedef Edge Key; 330 330 331 331 EdgeMapWrapper(leda_edge_array<T>& _leda_stuff) : -
src/work/peter/edgepathgraph.h
r986 r987 307 307 { 308 308 public: 309 typedef T Value Type;310 typedef Node Key Type;309 typedef T Value; 310 typedef Node Key; 311 311 312 312 NodeMap(const EdgePathGraph &) {} … … 345 345 { 346 346 public: 347 typedef T Value Type;348 typedef Edge Key Type;347 typedef T Value; 348 typedef Edge Key; 349 349 350 350 EdgeMap(const EdgePathGraph &) {} -
src/work/peter/hierarchygraph.h
r986 r987 434 434 { 435 435 public: 436 typedef T Value Type;437 typedef Node Key Type;436 typedef T Value; 437 typedef Node Key; 438 438 439 439 NodeMap (const HierarchyGraph &) … … 490 490 { 491 491 public: 492 typedef T Value Type;493 typedef Edge Key Type;492 typedef T Value; 493 typedef Edge Key; 494 494 495 495 EdgeMap (const HierarchyGraph &) -
src/work/sage_graph.h
r986 r987 39 39 std::vector<T> container; 40 40 public: 41 typedef T Value Type;42 typedef Node Key Type;41 typedef T Value; 42 typedef Node Key; 43 43 NodeMap(const SageGraph& _G) : G(_G), container(G.node_id) { } 44 44 NodeMap(const SageGraph& _G, T a) : … … 60 60 std::vector<T> container; 61 61 public: 62 typedef T Value Type;63 typedef Edge Key Type;62 typedef T Value; 63 typedef Edge Key; 64 64 EdgeMap(const SageGraph& _G) : G(_G), container(G.edge_id) { } 65 65 EdgeMap(const SageGraph& _G, T a) :
Note: See TracChangeset
for help on using the changeset viewer.