Changeset 987:87f7c54892df in lemon-0.x for src/work
- Timestamp:
- 11/13/04 18:07:10 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1377
- Location:
- src/work
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
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.