# HG changeset patch # User alpar # Date 1100365630 0 # Node ID 87f7c54892df4e1b60e673ebed5bacf5c4aff3e4 # Parent e997802b855ce873e201a5cd0e9c23a8128e807d Naming changes: - ValueType -> Value - KeyType -> Key - ReferenceType ->Reference - PointerType -> Pointer diff -r e997802b855c -r 87f7c54892df ChangeLog --- a/ChangeLog Sat Nov 13 12:53:28 2004 +0000 +++ b/ChangeLog Sat Nov 13 17:07:10 2004 +0000 @@ -1,3 +1,9 @@ + * ValueType -> Value, KeyType -> Key, ReferenceType ->Reference, + PointerType -> Pointer + * target() -> target(), source() -> source() + * Graph factory + * Right include paths in documentation + 2004-09-30 Alpar Juttner * Version 0.2 released diff -r e997802b855c -r 87f7c54892df doc/maps.dox --- a/doc/maps.dox Sat Nov 13 12:53:28 2004 +0000 +++ b/doc/maps.dox Sat Nov 13 17:07:10 2004 +0000 @@ -9,8 +9,8 @@ typedef's to determine the types of keys and values, like this: \code - typedef Edge KeyType; - typedef double ValueType; + typedef Edge Key; + typedef double Value; \endcode A map can \e readable (ReadMap, for short), \e writable (WriteMap) or both @@ -52,7 +52,7 @@ length[e]=3.5; \endcode - Writable maps have -a member function \c set(KeyType,const ValueType &) +a member function \c set(Key,const Value &) for this purpose. \code length.set(e,3.5); @@ -82,9 +82,9 @@ \code struct MyMap { - typedef double ValueType; - typedef Graph::Edge KeyType; - double operator[](KeyType e) const { return M_PI;} + typedef double Value; + typedef Graph::Edge Key; + double operator[](Key e) const { return M_PI;} }; \endcode @@ -95,7 +95,7 @@ \code struct MyMap : public MapBase { - ValueType operator[](KeyType e) const { return M_PI;} + Value operator[](Key e) const { return M_PI;} }; \endcode @@ -111,7 +111,7 @@ const Graph::NodeMap &pot; public: - ValueType operator[](KeyType e) const { + Value operator[](Key e) const { return orig_len.get(e)-pot.get(G.target(e))-pot.get(G.source(e)); } diff -r e997802b855c -r 87f7c54892df src/lemon/array_map.h --- a/src/lemon/array_map.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/array_map.h Sat Nov 13 17:07:10 2004 +0000 @@ -38,7 +38,7 @@ * the container functionality. * * The template parameter is the MapRegistry that the maps - * will belong to and the ValueType. + * will belong to and the Value. */ template Registry; @@ -60,8 +60,6 @@ /// The iterator to iterate on the keys. typedef _ItemIt KeyIt; - typedef _Value Value; - /// The MapBase of the Map which imlements the core regisitry function. typedef typename Registry::ObserverBase Parent; @@ -69,18 +67,18 @@ public: /// The value type of the map. - typedef Value ValueType; + typedef _Value Value; /// The reference type of the map; - typedef Value& ReferenceType; + typedef Value& Reference; /// The pointer type of the map; - typedef Value* PointerType; + typedef Value* Pointer; /// The const value type of the map. - typedef const Value ConstValueType; + typedef const Value ConstValue; /// The const reference type of the map; - typedef const Value& ConstReferenceType; + typedef const Value& ConstReference; /// The pointer type of the map; - typedef const Value* ConstPointerType; + typedef const Value* ConstPointer; private: @@ -172,7 +170,7 @@ * The subscript operator. The map can be subscripted by the * actual keys of the graph. */ - ReferenceType operator[](const KeyType& key) { + Reference operator[](const Key& key) { int id = graph->id(key); return values[id]; } @@ -181,7 +179,7 @@ * The const subscript operator. The map can be subscripted by the * actual keys of the graph. */ - ConstReferenceType operator[](const KeyType& key) const { + ConstReference operator[](const Key& key) const { int id = graph->id(key); return values[id]; } @@ -189,13 +187,13 @@ /** Setter function of the map. Equivalent with map[key] = val. * This is a compatibility feature with the not dereferable maps. */ - void set(const KeyType& key, const ValueType& val) { + void set(const Key& key, const Value& val) { (*this)[key] = val; } /** Add a new key to the map. It called by the map registry. */ - void add(const KeyType& key) { + void add(const Key& key) { int id = graph->id(key); if (id >= capacity) { int new_capacity = (capacity == 0 ? 1 : capacity); @@ -219,7 +217,7 @@ /** Erase a key from the map. It called by the map registry. */ - void erase(const KeyType& key) { + void erase(const Key& key) { int id = graph->id(key); allocator.destroy(&(values[id])); } @@ -321,13 +319,13 @@ // // STL compatibility typedefs. // typedef Iterator iterator; // typedef ConstIterator const_iterator; -// typedef typename Iterator::PairValueType value_type; -// typedef typename Iterator::KeyType key_type; -// typedef typename Iterator::ValueType data_type; -// typedef typename Iterator::PairReferenceType reference; -// typedef typename Iterator::PairPointerType pointer; -// typedef typename ConstIterator::PairReferenceType const_reference; -// typedef typename ConstIterator::PairPointerType const_pointer; +// typedef typename Iterator::PairValue value_type; +// typedef typename Iterator::Key key_type; +// typedef typename Iterator::Value data_type; +// typedef typename Iterator::PairReference reference; +// typedef typename Iterator::PairPointer pointer; +// typedef typename ConstIterator::PairReference const_reference; +// typedef typename ConstIterator::PairPointer const_pointer; // typedef int difference_type; }; diff -r e997802b855c -r 87f7c54892df src/lemon/concept/graph.h --- a/src/lemon/concept/graph.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/concept/graph.h Sat Nov 13 17:07:10 2004 +0000 @@ -567,9 +567,9 @@ // em=cm; //Copy to more complex type // { // //Check the typedef's -// typename Graph::template NodeMap::ValueType val; +// typename Graph::template NodeMap::Value val; // val=1; -// typename Graph::template NodeMap::KeyType key; +// typename Graph::template NodeMap::Key key; // key = typename Graph::NodeIt(G); // } // } @@ -591,9 +591,9 @@ // { // //Check the typedef's -// typename Graph::template NodeMap::ValueType val; +// typename Graph::template NodeMap::Value val; // val=true; -// typename Graph::template NodeMap::KeyType key; +// typename Graph::template NodeMap::Key key; // key= typename Graph::NodeIt(G); // } // } @@ -614,9 +614,9 @@ // dm=cm; //Copy from another type // { // //Check the typedef's -// typename Graph::template EdgeMap::ValueType val; +// typename Graph::template EdgeMap::Value val; // val=1; -// typename Graph::template EdgeMap::KeyType key; +// typename Graph::template EdgeMap::Key key; // key= typename Graph::EdgeIt(G); // } // } @@ -637,9 +637,9 @@ // m=dm; //Copy to another type // { // //Check the typedef's -// typename Graph::template EdgeMap::ValueType val; +// typename Graph::template EdgeMap::Value val; // val=true; -// typename Graph::template EdgeMap::KeyType key; +// typename Graph::template EdgeMap::Key key; // key= typename Graph::EdgeIt(G); // } // } diff -r e997802b855c -r 87f7c54892df src/lemon/concept/graph_component.h --- a/src/lemon/concept/graph_component.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/concept/graph_component.h Sat Nov 13 17:07:10 2004 +0000 @@ -677,22 +677,22 @@ typedef BaseGraphComponent::Node Node; typedef BaseGraphComponent::Edge Edge; - template - class NodeMap : public ReferenceMap { + template + class NodeMap : public ReferenceMap { public: NodeMap(const Graph&) {} - NodeMap(const Graph&, const Value&) {} + NodeMap(const Graph&, const _Value&) {} NodeMap(const NodeMap&) {} NodeMap& operator=(const NodeMap&) { return *this;} }; - template - class EdgeMap : public ReferenceMap { + template + class EdgeMap : public ReferenceMap { public: EdgeMap(const Graph&) {} - EdgeMap(const Graph&, const Value&) {} + EdgeMap(const Graph&, const _Value&) {} EdgeMap(const EdgeMap&) {} EdgeMap& operator=(const EdgeMap&) { return *this;} diff -r e997802b855c -r 87f7c54892df src/lemon/concept/maps.h --- a/src/lemon/concept/maps.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/concept/maps.h Sat Nov 13 17:07:10 2004 +0000 @@ -36,12 +36,12 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; /// Returns the value associated with a key. - ValueType operator[](const KeyType &k) const {return ValueType();} + Value operator[](const Key &k) const {return Value();} ///Default constructor ReadMap() {} @@ -54,12 +54,12 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; /// Sets the value associated with a key. - void set(const KeyType &k,const ValueType &t) {} + void set(const Key &k,const Value &t) {} ///Default constructor WriteMap() {} @@ -72,14 +72,14 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; /// Returns the value associated with a key. - ValueType operator[](const KeyType &k) const {return ValueType();} + Value operator[](const Key &k) const {return Value();} /// Sets the value associated with a key. - void set(const KeyType &k,const ValueType &t) {} + void set(const Key &k,const Value &t) {} ///Default constructor ReadWriteMap() {} @@ -92,24 +92,24 @@ { public: /// Map's key type. - typedef K KeyType; + typedef K Key; /// Map's value type. (The type of objects associated with the keys). - typedef T ValueType; + typedef T Value; protected: - ValueType tmp; + Value tmp; public: - typedef ValueType& ReferenceType; + typedef Value& Reference; /// Map's const reference type. - typedef const ValueType& ConstReferenceType; + typedef const Value& ConstReference; ///Returns a reference to the value associated to a key. - ReferenceType operator[](const KeyType &i) { return tmp; } + Reference operator[](const Key &i) { return tmp; } ///Returns a const reference to the value associated to a key. - ConstReferenceType operator[](const KeyType &i) const + ConstReference operator[](const Key &i) const { return tmp; } /// Sets the value associated with a key. - void set(const KeyType &k,const ValueType &t) { operator[](k)=t; } + void set(const Key &k,const Value &t) { operator[](k)=t; } ///Default constructor ReferenceMap() {} @@ -149,15 +149,15 @@ template struct ReadMapConcept { - typedef typename ReadMap::KeyType KeyType; - typedef typename ReadMap::ValueType ValueType; + typedef typename ReadMap::Key Key; + typedef typename ReadMap::Value Value; void constraints() { // No constraints for constructor. - // What are the requirement for the ValueType? + // What are the requirement for the Value? // CopyConstructible? Assignable? None of these? - ValueType v = m[k]; + Value v = m[k]; v = m[k]; // FIXME: @@ -165,13 +165,13 @@ } ReadMap m; - KeyType k; + Key k; }; template struct WriteMapConcept { - typedef typename WriteMap::KeyType KeyType; - typedef typename WriteMap::ValueType ValueType; + typedef typename WriteMap::Key Key; + typedef typename WriteMap::Value Value; void constraints() { // No constraints for constructor. @@ -180,8 +180,8 @@ } WriteMap m; - KeyType k; - ValueType v; + Key k; + Value v; }; template @@ -194,12 +194,12 @@ template struct ReferenceMapConcept { - typedef typename ReferenceMap::KeyType KeyType; - typedef typename ReferenceMap::ValueType ValueType; - typedef typename ReferenceMap::ReferenceType ReferenceType; + typedef typename ReferenceMap::Key Key; + typedef typename ReferenceMap::Value Value; + typedef typename ReferenceMap::Reference Reference; // What for is this? - typedef typename ReferenceMap::ConstReferenceType ConstReferenceType; + typedef typename ReferenceMap::ConstReference ConstReference; void constraints() { function_requires< ReadWriteMapConcept >(); @@ -207,13 +207,13 @@ m[k] = v; // Or should we require real reference? // Like this: - // ValueType &vv = m[k]; + // Value &vv = m[k]; // ignore_unused_variable_warning(vv); } ReferenceMap m; - KeyType k; - ValueType v; + Key k; + Value v; }; /// \todo GraphMapConceptCheck @@ -235,7 +235,7 @@ } const GraphMap &c; const Graph &g; - const typename GraphMap::ValueType &t; + const typename GraphMap::Value &t; }; diff -r e997802b855c -r 87f7c54892df src/lemon/default_map.h --- a/src/lemon/default_map.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/default_map.h Sat Nov 13 17:07:10 2004 +0000 @@ -33,11 +33,11 @@ /** The ArrayMap template class is graph map structure what * automatically updates the map when a key is added to or erased from - * the map. This map uses the VectorMap if the ValueType is a primitive + * the map. This map uses the VectorMap if the Value is a primitive * type and the ArrayMap for the other cases. * * The template parameter is the MapRegistry that the maps - * will belong to and the ValueType. + * will belong to and the Value. */ @@ -147,10 +147,10 @@ typedef DefaultMap<_Graph, _Item, _ItemIt, _Value> Map; typedef typename Parent::Graph Graph; - typedef typename Parent::ValueType ValueType; + typedef typename Parent::Value Value; DefaultMap(const Graph& _g) : Parent(_g) {} - DefaultMap(const Graph& _g, const ValueType& _v) : Parent(_g, _v) {} + DefaultMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {} }; @@ -180,11 +180,11 @@ typedef DefaultMap Parent; //typedef typename Parent::Graph Graph; - typedef typename Parent::ValueType ValueType; + typedef typename Parent::Value Value; NodeMap(const Graph& _g) : Parent(_g) {} - NodeMap(const Graph& _g, const ValueType& _v) + NodeMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {} }; @@ -200,11 +200,11 @@ typedef DefaultMap Parent; //typedef typename Parent::Graph Graph; - typedef typename Parent::ValueType ValueType; + typedef typename Parent::Value Value; EdgeMap(const Graph& _g) : Parent(_g) {} - EdgeMap(const Graph& _g, const ValueType& _v) + EdgeMap(const Graph& _g, const Value& _v) : Parent(_g, _v) {} }; diff -r e997802b855c -r 87f7c54892df src/lemon/dijkstra.h --- a/src/lemon/dijkstra.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/dijkstra.h Sat Nov 13 17:07:10 2004 +0000 @@ -37,7 +37,7 @@ ///so it is easy to change it to any kind of length. /// ///The type of the length is determined by the - ///\ref concept::ReadMap::ValueType "ValueType" of the length map. + ///\ref concept::ReadMap::Value "Value" of the length map. /// ///It is also possible to change the underlying priority heap. /// @@ -81,7 +81,7 @@ typedef typename Graph::OutEdgeIt OutEdgeIt; ///The type of the length of the edges. - typedef typename LM::ValueType ValueType; + typedef typename LM::Value Value; ///The type of the map that stores the edge lengths. typedef LM LengthMap; ///\brief The type of the map that stores the last @@ -91,7 +91,7 @@ ///nodes of the shortest paths. typedef typename Graph::template NodeMap PredNodeMap; ///The type of the map that stores the dists of the nodes. - typedef typename Graph::template NodeMap DistMap; + typedef typename Graph::template NodeMap DistMap; private: /// Pointer to the underlying graph. @@ -237,8 +237,8 @@ typename GR::template NodeMap heap_map(*G,-1); - typedef Heap, - std::less > + typedef Heap, + std::less > HeapType; HeapType heap(heap_map); @@ -248,7 +248,7 @@ while ( !heap.empty() ) { Node v=heap.top(); - ValueType oldvalue=heap[v]; + Value oldvalue=heap[v]; heap.pop(); distance->set(v, oldvalue); @@ -281,7 +281,7 @@ ///\pre \ref run() must be called before using this function. ///\warning If node \c v in unreachable from the root the return value ///of this funcion is undefined. - ValueType dist(Node v) const { return (*distance)[v]; } + Value dist(Node v) const { return (*distance)[v]; } ///Returns the 'previous edge' of the shortest path tree. diff -r e997802b855c -r 87f7c54892df src/lemon/dimacs.h --- a/src/lemon/dimacs.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/dimacs.h Sat Nov 13 17:07:10 2004 +0000 @@ -50,8 +50,8 @@ typename Graph::Node &s, typename Graph::Node &t, CostMap& cost) { g.clear(); - typename CapacityMap::ValueType _cap; - typename CostMap::ValueType _cost; + typename CapacityMap::Value _cap; + typename CostMap::Value _cost; char d; std::string problem; char c; diff -r e997802b855c -r 87f7c54892df src/lemon/graph_wrapper.h --- a/src/lemon/graph_wrapper.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/graph_wrapper.h Sat Nov 13 17:07:10 2004 +0000 @@ -1121,8 +1121,8 @@ template friend class EdgeMap; typename Graph::template EdgeMap forward_map, backward_map; public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap(const SubBidirGraphWrapper& g) : @@ -1150,7 +1150,7 @@ backward_map.set(e, a); } - typename Graph::template EdgeMap::ConstReferenceType + typename Graph::template EdgeMap::ConstReference operator[](Edge e) const { if (!e.backward) return forward_map[e]; @@ -1158,7 +1158,7 @@ return backward_map[e]; } - typename Graph::template EdgeMap::ReferenceType + typename Graph::template EdgeMap::Reference operator[](Edge e) { if (!e.backward) return forward_map[e]; @@ -1345,8 +1345,8 @@ protected: const ResGraphWrapper* res_graph; public: - typedef Number ValueType; - typedef Edge KeyType; + typedef Number Value; + typedef Edge Key; ResCap(const ResGraphWrapper& _res_graph) : res_graph(&_res_graph) { } Number operator[](const Edge& e) const { diff -r e997802b855c -r 87f7c54892df src/lemon/kruskal.h --- a/src/lemon/kruskal.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/kruskal.h Sat Nov 13 17:07:10 2004 +0000 @@ -112,12 +112,12 @@ class NonConstMapWr { const Map &m; public: - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; NonConstMapWr(const Map &_m) : m(_m) {} - template - void set(KeyType const& k, ValueType const &v) const { m.set(k,v); } + template + void set(Key const& k, Value const &v) const { m.set(k,v); } }; template @@ -150,11 +150,11 @@ template class KruskalMapInput : public std::vector< std::pair > { + typename Map::Value> > { public: typedef std::vector< std::pair > Parent; + typename Map::Value> > Parent; typedef typename Parent::value_type value_type; private: @@ -235,19 +235,19 @@ /// map and the output is a sequence of the tree edges, a special /// wrapper function exists: \ref kruskalEdgeMap_IteratorOut(). /// - /// \warning Not a regular property map, as it doesn't know its KeyType + /// \warning Not a regular property map, as it doesn't know its Key template class KruskalSequenceOutput { mutable Iterator it; public: - typedef bool ValueType; + typedef bool Value; KruskalSequenceOutput(Iterator const &_it) : it(_it) {} - template - void set(KeyType const& k, bool v) const { if(v) {*it=k; ++it;} } + template + void set(Key const& k, bool v) const { if(v) {*it=k; ++it;} } }; template @@ -287,7 +287,7 @@ template inline - typename IN::ValueType + typename IN::Value kruskalEdgeMap(GR const& G, IN const& in, RET &out) { @@ -332,7 +332,7 @@ template inline - typename IN::ValueType + typename IN::Value kruskalEdgeMap_IteratorOut(const GR& G, const IN& in, RET out) diff -r e997802b855c -r 87f7c54892df src/lemon/map_defines.h --- a/src/lemon/map_defines.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/map_defines.h Sat Nov 13 17:07:10 2004 +0000 @@ -51,13 +51,13 @@ * supports this feature it should be fixed. */ #define CREATE_NODE_MAP(DynMap) \ -template \ -class NodeMap : public DynMap { \ +template \ +class NodeMap : public DynMap { \ public: \ -typedef DynMap Parent; \ +typedef DynMap Parent; \ NodeMap(const typename Parent::Graph& g) \ : Parent(g, g.node_maps) {} \ -NodeMap(const typename Parent::Graph& g, const Value& v) \ +NodeMap(const typename Parent::Graph& g, const _Value& v) \ : Parent(g, g.node_maps, v) {} \ NodeMap(const NodeMap& copy) : Parent(static_cast(copy)) {} \ template \ @@ -81,14 +81,14 @@ * supports this feature it should be fixed. */ #define CREATE_EDGE_MAP(DynMap) \ -template \ -class EdgeMap : public DynMap { \ +template \ +class EdgeMap : public DynMap { \ public: \ -typedef DynMap Parent; \ +typedef DynMap Parent; \ \ EdgeMap(const typename Parent::Graph& g) \ : Parent(g, g.edge_maps) {} \ -EdgeMap(const typename Parent::Graph& g, const Value& v) \ +EdgeMap(const typename Parent::Graph& g, const _Value& v) \ : Parent(g, g.edge_maps, v) {} \ EdgeMap(const EdgeMap& copy) : Parent(static_cast(copy)) {} \ template \ @@ -125,14 +125,14 @@ * supports this feature it should be fixed. */ #define CREATE_SYM_EDGE_MAP(DynMap) \ -template \ -class SymEdgeMap : public DynMap { \ +template \ +class SymEdgeMap : public DynMap { \ public: \ -typedef DynMap Parent; \ +typedef DynMap Parent; \ \ SymEdgeMap(const typename Parent::Graph& g) \ : Parent(g, g.sym_edge_maps) {} \ -SymEdgeMap(const typename Parent::Graph& g, const Value& v) \ +SymEdgeMap(const typename Parent::Graph& g, const _Value& v) \ : Parent(g, g.sym_edge_maps, v) {} \ SymEdgeMap(const SymEdgeMap& copy) \ : Parent(static_cast(copy)) {} \ @@ -153,15 +153,15 @@ /** This is a macro to import an node map into a graph class. */ #define IMPORT_NODE_MAP(From, from, To, to) \ -template \ -class NodeMap : public From::template NodeMap { \ +template \ +class NodeMap : public From::template NodeMap<_Value> { \ \ public: \ -typedef typename From::template NodeMap Parent; \ +typedef typename From::template NodeMap<_Value> Parent; \ \ NodeMap(const To& to) \ : Parent(static_cast(from)) { } \ -NodeMap(const To& to, const Value& value) \ +NodeMap(const To& to, const _Value& value) \ : Parent(static_cast(from), value) { } \ NodeMap(const NodeMap& copy) \ : Parent(static_cast(copy)) {} \ @@ -182,15 +182,15 @@ /** This is a macro to import an edge map into a graph class. */ #define IMPORT_EDGE_MAP(From, from, To, to) \ -template \ -class EdgeMap : public From::template EdgeMap { \ +template \ +class EdgeMap : public From::template EdgeMap<_Value> { \ \ public: \ -typedef typename From::template EdgeMap Parent; \ +typedef typename From::template EdgeMap<_Value> Parent; \ \ EdgeMap(const To& to) \ : Parent(static_cast(from)) { } \ -EdgeMap(const To& to, const Value& value) \ +EdgeMap(const To& to, const _Value& value) \ : Parent(static_cast(from), value) { } \ EdgeMap(const EdgeMap& copy) \ : Parent(static_cast(copy)) {} \ diff -r e997802b855c -r 87f7c54892df src/lemon/map_iterator.h --- a/src/lemon/map_iterator.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/map_iterator.h Sat Nov 13 17:07:10 2004 +0000 @@ -41,23 +41,23 @@ public: /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; protected: @@ -104,33 +104,33 @@ typedef MapIteratorBase Base; /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; public: /// The value type of the iterator. - typedef extended_pair PairValueType; + typedef extended_pair PairValue; /// The reference type of the iterator. - typedef extended_pair PairReferenceType; + typedef extended_pair PairReference; /// Default constructor. MapIterator() {} @@ -140,24 +140,24 @@ MapIterator(Map& pmap, const KeyIt& pit) : Base(pit), map(&pmap) {} /// Dereference operator for the iterator. - PairReferenceType operator*() { - return PairReferenceType(Base::it, (*map)[Base::it]); + PairReference operator*() { + return PairReference(Base::it, (*map)[Base::it]); } /// The pointer type of the iterator. - class PairPointerType { + class PairPointer { friend class MapIterator; private: - PairReferenceType data; - PairPointerType(const KeyType& key, ReferenceType val) + PairReference data; + PairPointer(const Key& key, Reference val) : data(key, val) {} public: - PairReferenceType* operator->() {return &data;} + PairReference* operator->() {return &data;} }; /// Arrow operator for the iterator. - PairPointerType operator->() { - return PairPointerType(Base::it, ((*map)[Base::it])); + PairPointer operator->() { + return PairPointer(Base::it, ((*map)[Base::it])); } /// The pre increment operator of the iterator. @@ -180,9 +180,9 @@ // STL compatibility typedefs. typedef std::forward_iterator_tag iterator_category; typedef int difference_type; - typedef PairValueType value_type; - typedef PairReferenceType reference; - typedef PairPointerType pointer; + typedef PairValue value_type; + typedef PairReference reference; + typedef PairPointer pointer; }; /** Compatible iterator with the stl maps' iterators. @@ -197,23 +197,23 @@ typedef MapIteratorBase Base; /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; public: @@ -232,32 +232,32 @@ } /// The value type of the iterator. - typedef extended_pair PairValueType; + typedef extended_pair PairValue; /// The reference type of map. - typedef extended_pair PairReferenceType; + typedef extended_pair PairReference; /// Dereference operator for the iterator. - PairReferenceType operator*() { - return PairReferenceType(Base::it, (*map)[Base::it]); + PairReference operator*() { + return PairReference(Base::it, (*map)[Base::it]); } /// The pointer type of the iterator. - class PairPointerType { + class PairPointer { friend class MapConstIterator; private: - PairReferenceType data; - PairPointerType(const KeyType& key, ConstReferenceType val) + PairReference data; + PairPointer(const Key& key, ConstReference val) : data(key, val) {} public: - PairReferenceType* operator->() {return &data;} + PairReference* operator->() {return &data;} }; /// Arrow operator for the iterator. - PairPointerType operator->() { - return PairPointerType(Base::it, (*map)[Base::it]); + PairPointer operator->() { + return PairPointer(Base::it, (*map)[Base::it]); } /// The pre increment operator of the iterator. @@ -280,9 +280,9 @@ // STL compatibility typedefs. typedef std::input_iterator_tag iterator_category; typedef int difference_type; - typedef PairValueType value_type; - typedef PairReferenceType reference; - typedef PairPointerType pointer; + typedef PairValue value_type; + typedef PairReference reference; + typedef PairPointer pointer; }; /** The class makes the KeyIt to an stl compatible iterator @@ -297,7 +297,7 @@ typedef MapIteratorBase Base; /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; @@ -323,17 +323,17 @@ } /// The dereferencing operator of the iterator. - KeyType operator*() const { - return static_cast(Base::it); + Key operator*() const { + return static_cast(Base::it); } public: // STL compatibility typedefs. typedef std::input_iterator_tag iterator_category; typedef int difference_type; - typedef KeyType value_type; - typedef const KeyType& reference; - typedef const KeyType* pointer; + typedef Key value_type; + typedef const Key& reference; + typedef const Key* pointer; }; template class MapConstValueIterator; @@ -352,24 +352,24 @@ typedef MapIteratorBase Base; /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; private: @@ -399,12 +399,12 @@ } /// The dereferencing operator of the iterator. - ReferenceType operator*() const { + Reference operator*() const { return (*map)[Base::it]; } /// The arrow operator of the iterator. - PointerType operator->() const { + Pointer operator->() const { return &(operator*()); } @@ -412,9 +412,9 @@ // STL compatibility typedefs. typedef std::forward_iterator_tag iterator_category; typedef int difference_type; - typedef ValueType value_type; - typedef ReferenceType reference; - typedef PointerType pointer; + typedef Value value_type; + typedef Reference reference; + typedef Pointer pointer; }; /** MapValueIterator creates an stl compatible iterator @@ -430,23 +430,23 @@ typedef MapIteratorBase Base; /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; private: @@ -481,12 +481,12 @@ } /// The dereferencing operator of the iterator. - ConstReferenceType operator*() const { + ConstReference operator*() const { return (*map)[Base::it]; } /// The arrow operator of the iterator. - ConstPointerType operator->() const { + ConstPointer operator->() const { return &(operator*()); } @@ -494,9 +494,9 @@ // STL compatibility typedefs. typedef std::input_iterator_tag iterator_category; typedef int difference_type; - typedef ValueType value_type; - typedef ConstReferenceType reference; - typedef ConstPointerType pointer; + typedef Value value_type; + typedef ConstReference reference; + typedef ConstPointer pointer; }; @@ -511,24 +511,24 @@ public: /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; /// The map initialized const key set. MapConstKeySet(const Map& pmap) : map(&pmap) {} @@ -548,10 +548,10 @@ public: // STL compatibility typedefs. - typedef ValueType value_type; + typedef Value value_type; typedef ConstIterator const_iterator; - typedef ConstReferenceType const_reference; - typedef ConstPointerType const_pointer; + typedef ConstReference const_reference; + typedef ConstPointer const_pointer; typedef int difference_type; }; @@ -567,24 +567,24 @@ public: /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; /// The map initialized const value set. MapConstValueSet(const Map& pmap) : map(&pmap) {} @@ -604,10 +604,10 @@ public: // STL compatibility typedefs. - typedef ValueType value_type; + typedef Value value_type; typedef ConstIterator const_iterator; - typedef ConstReferenceType const_reference; - typedef ConstPointerType const_pointer; + typedef ConstReference const_reference; + typedef ConstPointer const_pointer; typedef int difference_type; }; @@ -624,24 +624,24 @@ public: /// The key type of the iterator. - typedef typename Map::KeyType KeyType; + typedef typename Map::Key Key; /// The iterator to iterate on the keys. typedef typename Map::KeyIt KeyIt; /// The value type of the iterator. - typedef typename Map::ValueType ValueType; + typedef typename Map::Value Value; /// The reference type of the iterator. - typedef typename Map::ReferenceType ReferenceType; + typedef typename Map::Reference Reference; /// The pointer type of the iterator. - typedef typename Map::PointerType PointerType; + typedef typename Map::Pointer Pointer; /// The const value type of the iterator. - typedef typename Map::ConstValueType ConstValueType; + typedef typename Map::ConstValue ConstValue; /// The const reference type of the iterator. - typedef typename Map::ConstReferenceType ConstReferenceType; + typedef typename Map::ConstReference ConstReference; /// The pointer type of the iterator. - typedef typename Map::ConstPointerType ConstPointerType; + typedef typename Map::ConstPointer ConstPointer; /// The map initialized value set. MapValueSet(Map& pmap) : map(&pmap) {} @@ -674,13 +674,13 @@ public: // STL compatibility typedefs. - typedef ValueType value_type; + typedef Value value_type; typedef Iterator iterator; typedef ConstIterator const_iterator; - typedef ReferenceType reference; - typedef ConstReferenceType const_reference; - typedef PointerType pointer; - typedef ConstPointerType const_pointer; + typedef Reference reference; + typedef ConstReference const_reference; + typedef Pointer pointer; + typedef ConstPointer const_pointer; typedef int difference_type; }; diff -r e997802b855c -r 87f7c54892df src/lemon/maps.h --- a/src/lemon/maps.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/maps.h Sat Nov 13 17:07:10 2004 +0000 @@ -36,9 +36,9 @@ { public: ///\e - typedef K KeyType; + typedef K Key; ///\e - typedef T ValueType; + typedef T Value; }; /// Null map. (a.k.a. DoNothingMap) @@ -108,20 +108,20 @@ /// \c std::map wrapper /// This is essentially a wrapper for \c std::map. With addition that - /// you can specify a default value different from \c ValueType() . + /// you can specify a default value different from \c Value() . /// /// \todo Provide allocator parameter... - template > - class StdMap : public std::map { - typedef std::map parent; + template > + class StdMap : public std::map { + typedef std::map parent; T v; typedef typename parent::value_type PairType; public: - typedef Key KeyType; - typedef T ValueType; - typedef T& ReferenceType; - typedef const T& ConstReferenceType; + typedef K Key; + typedef T Value; + typedef T& Reference; + typedef const T& ConstReference; StdMap() : v() {} @@ -143,10 +143,10 @@ //FIXME; } - ReferenceType operator[](const Key &k) { + Reference operator[](const Key &k) { return insert(PairType(k,v)).first -> second; } - ConstReferenceType operator[](const Key &k) const { + ConstReference operator[](const Key &k) const { typename parent::iterator i = lower_bound(k); if (i == parent::end() || parent::key_comp()(k, (*i).first)) return v; diff -r e997802b855c -r 87f7c54892df src/lemon/min_cost_flow.h --- a/src/lemon/min_cost_flow.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/min_cost_flow.h Sat Nov 13 17:07:10 2004 +0000 @@ -59,10 +59,10 @@ template class MinCostFlow { - typedef typename LengthMap::ValueType Length; + typedef typename LengthMap::Value Length; //Warning: this should be integer type - typedef typename CapacityMap::ValueType Capacity; + typedef typename CapacityMap::Value Capacity; typedef typename Graph::Node Node; typedef typename Graph::NodeIt NodeIt; @@ -94,14 +94,14 @@ const LengthMap &length; const NodeMap &pot; public : - typedef typename LengthMap::KeyType KeyType; - typedef typename LengthMap::ValueType ValueType; + typedef typename LengthMap::Key Key; + typedef typename LengthMap::Value Value; ModLengthMap(const ResGW& _g, const LengthMap &_length, const NodeMap &_pot) : g(_g), /*rev(_rev),*/ length(_length), pot(_pot) { } - ValueType operator[](typename ResGW::Edge e) const { + Value operator[](typename ResGW::Edge e) const { if (g.forward(e)) return length[e]-(pot[g.target(e)]-pot[g.source(e)]); else diff -r e997802b855c -r 87f7c54892df src/lemon/suurballe.h --- a/src/lemon/suurballe.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/suurballe.h Sat Nov 13 17:07:10 2004 +0000 @@ -58,7 +58,7 @@ class Suurballe{ - typedef typename LengthMap::ValueType Length; + typedef typename LengthMap::Value Length; typedef typename Graph::Node Node; typedef typename Graph::NodeIt NodeIt; diff -r e997802b855c -r 87f7c54892df src/lemon/vector_map.h --- a/src/lemon/vector_map.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/vector_map.h Sat Nov 13 17:07:10 2004 +0000 @@ -53,7 +53,7 @@ /// The graph type of the map. typedef _Graph Graph; /// The key type of the map. - typedef _Item KeyType; + typedef _Item Key; /// The id map type of the map. typedef AlterationObserverRegistry<_Item> Registry; /// The value type of the map. @@ -71,19 +71,17 @@ public: - /// The value type of the map. - typedef Value ValueType; /// The reference type of the map; - typedef typename Container::reference ReferenceType; + typedef typename Container::reference Reference; /// The pointer type of the map; - typedef typename Container::pointer PointerType; + typedef typename Container::pointer Pointer; /// The const value type of the map. - typedef const Value ConstValueType; + typedef const Value ConstValue; /// The const reference type of the map; - typedef typename Container::const_reference ConstReferenceType; + typedef typename Container::const_reference ConstReference; /// The pointer type of the map; - typedef typename Container::const_pointer ConstPointerType; + typedef typename Container::const_pointer ConstPointer; /// Constructor to attach the new map into the registry. @@ -150,7 +148,7 @@ /// The subscript operator. The map can be subscripted by the /// actual items of the graph. - ReferenceType operator[](const KeyType& key) { + Reference operator[](const Key& key) { return container[graph->id(key)]; } @@ -159,7 +157,7 @@ /// The const subscript operator. The map can be subscripted by the /// actual items of the graph. - ConstReferenceType operator[](const KeyType& key) const { + ConstReference operator[](const Key& key) const { return container[graph->id(key)]; } @@ -169,7 +167,7 @@ /// It the same as operator[](key) = value expression. /// - void set(const KeyType& key, const ValueType& value) { + void set(const Key& key, const Value& value) { (*this)[key] = value; } @@ -178,7 +176,7 @@ /// It adds a new key to the map. It called by the observer registry /// and it overrides the add() member function of the observer base. - void add(const KeyType& key) { + void add(const Key& key) { int id = graph->id(key); if (id >= (int)container.size()) { container.resize(id + 1); @@ -189,7 +187,7 @@ /// Erase a key from the map. It called by the observer registry /// and it overrides the erase() member function of the observer base. - void erase(const KeyType&) {} + void erase(const Key&) {} /// Buildes the map. diff -r e997802b855c -r 87f7c54892df src/lemon/xy.h --- a/src/lemon/xy.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/lemon/xy.h Sat Nov 13 17:07:10 2004 +0000 @@ -50,7 +50,7 @@ public: - typedef T ValueType; + typedef T Value; T x,y; diff -r e997802b855c -r 87f7c54892df src/test/sym_graph_test.h --- a/src/test/sym_graph_test.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/test/sym_graph_test.h Sat Nov 13 17:07:10 2004 +0000 @@ -95,9 +95,9 @@ dm=cm; //Copy from another type { //Check the typedef's - typename Graph::template SymEdgeMap::ValueType val; + typename Graph::template SymEdgeMap::Value val; val = 1; - typename Graph::template SymEdgeMap::KeyType key; + typename Graph::template SymEdgeMap::Key key; key = typename Graph::SymEdgeIt(G); } } @@ -118,9 +118,9 @@ m=dm; //Copy to another type { //Check the typedef's - typename Graph::template SymEdgeMap::ValueType val; + typename Graph::template SymEdgeMap::Value val; val=true; - typename Graph::template SymEdgeMap::KeyType key; + typename Graph::template SymEdgeMap::Key key; key= typename Graph::SymEdgeIt(G); } } diff -r e997802b855c -r 87f7c54892df src/work/alpar/boolmap_iter.cc --- a/src/work/alpar/boolmap_iter.cc Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/alpar/boolmap_iter.cc Sat Nov 13 17:07:10 2004 +0000 @@ -13,8 +13,8 @@ typedef GG Graph; typedef typename GG::Edge Edge; - typedef Edge KeyType; - typedef bool ValueType; + typedef Edge Key; + typedef bool Value; friend class RefType; friend class FalseIterator; @@ -67,12 +67,12 @@ public: RefType(BoolIterEdgeMap &_M,Edge _e) : M(_M), e(_e) { } - operator ValueType() const + operator Value() const { return M.isTrue(e); } - ValueType operator = (ValueType v) const + Value operator = (Value v) const { if(v) M.setTrue(e); else M.setFalse(e); diff -r e997802b855c -r 87f7c54892df src/work/alpar/dijkstra.h --- a/src/work/alpar/dijkstra.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/alpar/dijkstra.h Sat Nov 13 17:07:10 2004 +0000 @@ -46,7 +46,7 @@ /// typedef LM LengthMap; //The type of the length of the edges. - typedef typename LM::ValueType ValueType; + typedef typename LM::Value Value; ///The heap type used by Dijkstra algorithm. ///The heap type used by Dijkstra algorithm. @@ -54,9 +54,9 @@ ///\sa BinHeap ///\sa Dijkstra typedef BinHeap, - std::less > Heap; + std::less > Heap; ///\brief The type of the map that stores the last ///edges of the shortest paths. @@ -90,7 +90,7 @@ ///It must meet the \ref concept::WriteMap "WriteMap" concept. /// - typedef typename Graph::template NodeMap DistMap; + typedef typename Graph::template NodeMap DistMap; ///Instantiates a DistMap. ///\todo Please document... @@ -109,7 +109,7 @@ ///so it is easy to change it to any kind of length. /// ///The type of the length is determined by the - ///\ref concept::ReadMap::ValueType "ValueType" of the length map. + ///\ref concept::ReadMap::Value "Value" of the length map. /// ///It is also possible to change the underlying priority heap. /// @@ -158,7 +158,7 @@ typedef typename Graph::OutEdgeIt OutEdgeIt; ///The type of the length of the edges. - typedef typename TR::LengthMap::ValueType ValueType; + typedef typename TR::LengthMap::Value Value; ///The type of the map that stores the edge lengths. typedef typename TR::LengthMap LengthMap; ///\brief The type of the map that stores the last @@ -387,7 +387,7 @@ while ( !heap.empty() ) { Node v=heap.top(); - ValueType oldvalue=heap[v]; + Value oldvalue=heap[v]; heap.pop(); distance->set(v, oldvalue); @@ -420,7 +420,7 @@ ///\pre \ref run() must be called before using this function. ///\warning If node \c v in unreachable from the root the return value ///of this funcion is undefined. - ValueType dist(Node v) const { return (*distance)[v]; } + Value dist(Node v) const { return (*distance)[v]; } ///Returns the 'previous edge' of the shortest path tree. @@ -497,7 +497,7 @@ ///The type of the map that stores the edge lengths. typedef typename TR::LengthMap LengthMap; ///The type of the length of the edges. - typedef typename LengthMap::ValueType ValueType; + typedef typename LengthMap::Value Value; ///\brief The type of the map that stores the last ///edges of the shortest paths. typedef typename TR::PredMap PredMap; diff -r e997802b855c -r 87f7c54892df src/work/alpar/f_ed_ka.h --- a/src/work/alpar/f_ed_ka.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/alpar/f_ed_ka.h Sat Nov 13 17:07:10 2004 +0000 @@ -13,7 +13,7 @@ namespace lemon { template - typename FlowMap::ValueType maxFlow(Graph &G, + typename FlowMap::Value maxFlow(Graph &G, FlowMap &f, CapacityMap &c, typename Graph::NodeIt s, @@ -25,7 +25,7 @@ typedef typename Graph::EachEdgeIt EachEdgeIt; typedef typename Graph::OutEdgeIt OutEdgeIt; typedef typename Graph::InEdgeIt InEdgeIt; - typedef typename FlowMap::ValueType T; + typedef typename FlowMap::Value T; T flow_val = 0; T aug_val; diff -r e997802b855c -r 87f7c54892df src/work/alpar/rw_nonref_map.cc --- a/src/work/alpar/rw_nonref_map.cc Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/alpar/rw_nonref_map.cc Sat Nov 13 17:07:10 2004 +0000 @@ -10,8 +10,8 @@ typedef GG Graph; typedef typename GG::Edge Edge; - typedef Edge KeyType; - typedef TT ValueType; + typedef Edge Key; + typedef TT Value; class RefType { @@ -20,15 +20,15 @@ public: RefType(Graph &_G,Edge _e) : G(_G), e(_e) { } - operator ValueType() const + operator Value() const { - ValueType tmp; + Value tmp; std::cout << G.id(G.source(e)) << "->" << G.id(G.target(e)) << ": "; std::cin >> tmp; return tmp; } - ValueType operator = (ValueType v) const + Value operator = (Value v) const { std::cout << G.id(G.source(e)) << "->" << G.id(G.target(e)) << ": " << v << '\n'; @@ -47,23 +47,23 @@ class NullMap { public: - typedef K KeyType; - typedef T ValueType; + typedef K Key; + typedef T Value; class RefType { - ValueType val; + Value val; public: - RefType(ValueType v) : val(v) { } - operator ValueType() const { return val; } - ValueType operator = (ValueType v) const { return val; } + RefType(Value v) : val(v) { } + operator Value() const { return val; } + Value operator = (Value v) const { return val; } }; private: - ValueType val; + Value val; public: - NullMap(ValueType v) : val(v) { } - RefType operator[] (KeyType e) const { return RefType(v);} + NullMap(Value v) : val(v) { } + RefType operator[] (Key e) const { return RefType(v);} }; int main() diff -r e997802b855c -r 87f7c54892df src/work/athos/mincostflow.h --- a/src/work/athos/mincostflow.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/athos/mincostflow.h Sat Nov 13 17:07:10 2004 +0000 @@ -43,10 +43,10 @@ template class MinCostFlow { - typedef typename CostMap::ValueType Cost; + typedef typename CostMap::Value Cost; - typedef typename SupplyDemandMap::ValueType SupplyDemand; + typedef typename SupplyDemandMap::Value SupplyDemand; typedef typename Graph::Node Node; typedef typename Graph::NodeIt NodeIt; @@ -68,10 +68,10 @@ const CostMap &ol; const NodeMap &pot; public : - typedef typename CostMap::KeyType KeyType; - typedef typename CostMap::ValueType ValueType; + typedef typename CostMap::Key Key; + typedef typename CostMap::Value Value; - ValueType operator[](typename ResGraph::Edge e) const { + Value operator[](typename ResGraph::Edge e) const { if (res_graph.forward(e)) return ol[e]-(pot[res_graph.target(e)]-pot[res_graph.source(e)]); else diff -r e997802b855c -r 87f7c54892df src/work/athos/old/minlengthpaths.h --- a/src/work/athos/old/minlengthpaths.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/athos/old/minlengthpaths.h Sat Nov 13 17:07:10 2004 +0000 @@ -30,7 +30,7 @@ template class MinLengthPaths { - typedef typename LengthMap::ValueType Length; + typedef typename LengthMap::Value Length; typedef typename Graph::Node Node; typedef typename Graph::NodeIt NodeIt; @@ -49,10 +49,10 @@ const LengthMap &ol; const NodeMap &pot; public : - typedef typename LengthMap::KeyType KeyType; - typedef typename LengthMap::ValueType ValueType; + typedef typename LengthMap::Key Key; + typedef typename LengthMap::Value Value; - ValueType operator[](typename ResGraphType::Edge e) const { + Value operator[](typename ResGraphType::Edge e) const { //if ( (1-2*rev[e])*ol[e]-(pot[G.target(e)]-pot[G.source(e)] ) <0 ){ // std::cout<<"Negative length!!"< + template class UnionFind { KeyIntMap& pointmap; struct VectorElementType { @@ -34,7 +34,7 @@ } //Give a component of one point to the structure - int addPoint(KeyType u){ + int addPoint(Key u){ int _index = container.size(); VectorElementType buf(_index,1); container.push_back(buf); @@ -43,7 +43,7 @@ //Finds the big boss of u - int find(KeyType u){ + int find(Key u){ if (pointmap.get(u)==-1){ int whoami = addPoint(u); pointmap.set(u, whoami); @@ -61,7 +61,7 @@ } //Finds u and v in the structures and merges the comopnents, if not equal - bool findAndMerge(KeyType u,KeyType v){ + bool findAndMerge(Key u,Key v){ int bu = find(u); int bv = find(v); if (bu != bv){ diff -r e997802b855c -r 87f7c54892df src/work/deba/dijkstra.h --- a/src/work/deba/dijkstra.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/deba/dijkstra.h Sat Nov 13 17:07:10 2004 +0000 @@ -21,7 +21,7 @@ ///\ref ReadMap "readable map", ///so it is easy to change it to any kind of length. /// - ///The type of the length is determined by the \c ValueType of the length map. + ///The type of the length is determined by the \c Value of the length map. /// ///It is also possible to change the underlying priority heap. /// @@ -59,7 +59,7 @@ typedef typename Graph::OutEdgeIt OutEdgeIt; ///The type of the length of the edges. - typedef typename LM::ValueType ValueType; + typedef typename LM::Value Value; ///The type of the map that stores the edge lengths. typedef LM LengthMap; ///\brief The type of the map that stores the last @@ -69,7 +69,7 @@ ///nodes of the shortest paths. typedef typename Graph::template NodeMap PredNodeMap; ///The type of the map that stores the dists of the nodes. - typedef typename Graph::template NodeMap DistMap; + typedef typename Graph::template NodeMap DistMap; private: const Graph *G; @@ -216,8 +216,8 @@ typename GR::template NodeMap heap_map(*G,-1); - typedef Heap, - std::less > + typedef Heap, + std::less > HeapType; HeapType heap(heap_map); @@ -227,7 +227,7 @@ while ( !heap.empty() ) { Node v=heap.top(); - ValueType oldvalue=heap[v]; + Value oldvalue=heap[v]; heap.pop(); distance->set(v, oldvalue); @@ -261,7 +261,7 @@ ///\pre \ref run() must be called before using this function. ///\warning If node \c v in unreachable from the root the return value ///of this funcion is undefined. - ValueType dist(Node v) const { return (*distance)[v]; } + Value dist(Node v) const { return (*distance)[v]; } ///Returns the 'previous edge' of the shortest path tree. diff -r e997802b855c -r 87f7c54892df src/work/klao/iter_map.h --- a/src/work/klao/iter_map.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/klao/iter_map.h Sat Nov 13 17:07:10 2004 +0000 @@ -25,14 +25,14 @@ class IterableMap { public: - typedef typename KeyIntMap::KeyType KeyType; - typedef Val ValueType; + typedef typename KeyIntMap::Key Key; + typedef Val Value; - typedef typename std::vector::const_iterator iterator; + typedef typename std::vector::const_iterator iterator; protected: KeyIntMap &base; - std::vector data; + std::vector data; size_t bounds[N]; Val def_val; @@ -55,7 +55,7 @@ size_t move(size_t a, uint8_t m, uint8_t n) { if(m != n) { size_t orig_a = a; - KeyType orig_key = data[a]; + Key orig_key = data[a]; while(m > n) { --m; half_swap(a, bounds[m]++); @@ -80,11 +80,11 @@ // for(int i=0; i. template class NodeMapWrapper { public: - typedef Node KeyType; - typedef typename NM::ValueType ValueType; + typedef Node Key; + typedef typename NM::Value Value; protected: NM* nm; - ValueType* s_value, t_value; + Value* s_value, t_value; public: - NodeMapWrapper(NM& _nm, ValueType& _s_value, ValueType& _t_value) : + NodeMapWrapper(NM& _nm, Value& _s_value, Value& _t_value) : nm(&_nm), s_value(&_s_value), t_value(&_t_value) { } - ValueType operator[](const Node& n) const { + Value operator[](const Node& n) const { switch (n.getSpec()) { case 0: return (*nm)[n]; @@ -813,7 +813,7 @@ return *t_value; } } - void set(const Node& n, ValueType t) { + void set(const Node& n, Value t) { switch (n.getSpec()) { case 0: nm->set(n, t); @@ -873,14 +873,14 @@ template class EdgeMapWrapper { public: - typedef Edge KeyType; - typedef typename EM::ValueType ValueType; + typedef Edge Key; + typedef typename EM::Value Value; protected: EM* em; NM* nm; public: EdgeMapWrapper(EM& _em, NM& _nm) : em(&_em), nm(&_nm) { } - ValueType operator[](const Edge& e) const { + Value operator[](const Edge& e) const { switch (e.getSpec()) { case 0: return (*em)[e]; @@ -891,7 +891,7 @@ return (*nm)[e.getNode()]; } } - void set(const Edge& e, ValueType t) { + void set(const Edge& e, Value t) { switch (e.getSpec()) { case 0: em->set(e, t); diff -r e997802b855c -r 87f7c54892df src/work/marci/experiment/list_graph.h --- a/src/work/marci/experiment/list_graph.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/marci/experiment/list_graph.h Sat Nov 13 17:07:10 2004 +0000 @@ -38,8 +38,8 @@ const ListGraph& G; std::vector container; public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMap(const ListGraph& _G) : G(_G), container(G.node_id) { } NodeMap(const ListGraph& _G, T a) : G(_G), container(G.node_id, a) { } @@ -59,8 +59,8 @@ const ListGraph& G; std::vector container; public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap(const ListGraph& _G) : G(_G), container(G.edge_id) { } EdgeMap(const ListGraph& _G, T a) : G(_G), container(G.edge_id, a) { } diff -r e997802b855c -r 87f7c54892df src/work/marci/graph_concept.h --- a/src/work/marci/graph_concept.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/marci/graph_concept.h Sat Nov 13 17:07:10 2004 +0000 @@ -167,8 +167,8 @@ template class NodeMap { public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMap(const GraphConcept& g) { } NodeMap(const GraphConcept& g, T t) { } @@ -205,8 +205,8 @@ template class EdgeMap { public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap(const GraphConcept& g) {} EdgeMap(const GraphConcept& g, T t) {} diff -r e997802b855c -r 87f7c54892df src/work/marci/leda/leda_graph_wrapper.h --- a/src/work/marci/leda/leda_graph_wrapper.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/marci/leda/leda_graph_wrapper.h Sat Nov 13 17:07:10 2004 +0000 @@ -261,8 +261,8 @@ { leda_node_map leda_stuff; public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {} NodeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {} @@ -281,8 +281,8 @@ { leda_edge_map leda_stuff; public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap(const LedaGraphWrapper &G) : leda_stuff(*(G.l_graph)) {} EdgeMap(const LedaGraphWrapper &G, T t) : leda_stuff(*(G.l_graph), t) {} @@ -303,8 +303,8 @@ { leda_node_array* leda_stuff; public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMapWrapper(leda_node_array& _leda_stuff) : leda_stuff(&_leda_stuff) { } @@ -325,8 +325,8 @@ { leda_edge_array* leda_stuff; public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMapWrapper(leda_edge_array& _leda_stuff) : leda_stuff(_leda_stuff) { } diff -r e997802b855c -r 87f7c54892df src/work/peter/edgepathgraph.h --- a/src/work/peter/edgepathgraph.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/peter/edgepathgraph.h Sat Nov 13 17:07:10 2004 +0000 @@ -306,8 +306,8 @@ template class NodeMap { public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMap(const EdgePathGraph &) {} NodeMap(const EdgePathGraph &, T) {} @@ -344,8 +344,8 @@ template class EdgeMap { public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap(const EdgePathGraph &) {} EdgeMap(const EdgePathGraph &, T ) {} diff -r e997802b855c -r 87f7c54892df src/work/peter/hierarchygraph.h --- a/src/work/peter/hierarchygraph.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/peter/hierarchygraph.h Sat Nov 13 17:07:10 2004 +0000 @@ -433,8 +433,8 @@ template < class T > class NodeMap { public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMap (const HierarchyGraph &) { @@ -489,8 +489,8 @@ template < class T > class EdgeMap { public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap (const HierarchyGraph &) { diff -r e997802b855c -r 87f7c54892df src/work/sage_graph.h --- a/src/work/sage_graph.h Sat Nov 13 12:53:28 2004 +0000 +++ b/src/work/sage_graph.h Sat Nov 13 17:07:10 2004 +0000 @@ -38,8 +38,8 @@ const SageGraph& G; std::vector container; public: - typedef T ValueType; - typedef Node KeyType; + typedef T Value; + typedef Node Key; NodeMap(const SageGraph& _G) : G(_G), container(G.node_id) { } NodeMap(const SageGraph& _G, T a) : G(_G), container(G.node_id, a) { } @@ -59,8 +59,8 @@ const SageGraph& G; std::vector container; public: - typedef T ValueType; - typedef Edge KeyType; + typedef T Value; + typedef Edge Key; EdgeMap(const SageGraph& _G) : G(_G), container(G.edge_id) { } EdgeMap(const SageGraph& _G, T a) : G(_G), container(G.edge_id, a) { }