1233 |
1233 |
1234 template <typename T> |
1234 template <typename T> |
1235 class EdgeMap { |
1235 class EdgeMap { |
1236 typename Graph::template EdgeMap<T> forward_map, backward_map; |
1236 typename Graph::template EdgeMap<T> forward_map, backward_map; |
1237 public: |
1237 public: |
|
1238 typedef T ValueType; |
|
1239 typedef Edge KeyType; |
1238 EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { } |
1240 EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G) : forward_map(*(_G.graph)), backward_map(*(_G.graph)) { } |
1239 EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G, T a) : forward_map(*(_G.graph), a), backward_map(*(_G.graph), a) { } |
1241 EdgeMap(const ResGraphWrapper<Graph, Number, CapacityMap, FlowMap>& _G, T a) : forward_map(*(_G.graph), a), backward_map(*(_G.graph), a) { } |
1240 void set(Edge e, T a) { |
1242 void set(Edge e, T a) { |
1241 if (!e.backward) |
1243 if (!e.backward) |
1242 forward_map.set(e.out, a); |
1244 forward_map.set(e/*.out*/, a); |
1243 else |
1245 else |
1244 backward_map.set(e.in, a); |
1246 backward_map.set(e/*.in*/, a); |
1245 } |
1247 } |
1246 T operator[](Edge e) const { |
1248 T operator[](Edge e) const { |
1247 if (!e.backward) |
1249 if (!e.backward) |
1248 return forward_map[e.out]; |
1250 return forward_map[e/*.out*/]; |
1249 else |
1251 else |
1250 return backward_map[e.in]; |
1252 return backward_map[e/*.in*/]; |
1251 } |
1253 } |
1252 // T get(Edge e) const { |
1254 // T get(Edge e) const { |
1253 // if (e.out_or_in) |
1255 // if (e.out_or_in) |
1254 // return forward_map.get(e.out); |
1256 // return forward_map.get(e.out); |
1255 // else |
1257 // else |