Changeset 259:509ba9f136d2 in lemon-0.x for src
- Timestamp:
- 03/29/04 18:00:00 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@364
- Location:
- src/work
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/edmonds_karp.h
r243 r259 1 1 // -*- c++ -*- 2 #ifndef EDMONDS_KARP_H3 #define EDMONDS_KARP_H2 #ifndef HUGO_EDMONDS_KARP_H 3 #define HUGO_EDMONDS_KARP_H 4 4 5 5 #include <algorithm> … … 1105 1105 } // namespace hugo 1106 1106 1107 #endif // EDMONDS_KARP_H1107 #endif //HUGO_EDMONDS_KARP_H -
src/work/marci/dimacs.h
r206 r259 1 1 // -*- c++ -*- 2 #ifndef DIMACS_H3 #define DIMACS_H2 #ifndef HUGO_DIMACS_H 3 #define HUGO_DIMACS_H 4 4 5 5 #include <iostream> … … 58 58 } //namespace hugo 59 59 60 #endif // DIMACS_H60 #endif //HUGO_DIMACS_H -
src/work/marci/graph_wrapper.h
r239 r259 1 1 // -*- c++ -*- 2 #ifndef GRAPH_WRAPPER_H3 #define GRAPH_WRAPPER_H2 #ifndef HUGO_GRAPH_WRAPPER_H 3 #define HUGO_GRAPH_WRAPPER_H 4 4 5 5 #include <invalid.h> … … 771 771 class ResGraphWrapper { 772 772 public: 773 typedef Graph BaseGraph;773 //typedef Graph BaseGraph; 774 774 typedef typename Graph::Node Node; 775 775 typedef typename Graph::NodeIt NodeIt; … … 778 778 typedef typename Graph::InEdgeIt OldInEdgeIt; 779 779 protected: 780 const Graph* graph; 780 //const Graph* graph; 781 typedef TrivGraphWrapper<const Graph> GraphWrapper; 782 GraphWrapper gw; 781 783 FlowMap* flow; 782 784 const CapacityMap* capacity; … … 785 787 ResGraphWrapper(const Graph& _G, FlowMap& _flow, 786 788 const CapacityMap& _capacity) : 787 g raph(&_G), flow(&_flow), capacity(&_capacity) { }788 789 void setGraph(const Graph& _graph) { graph = &_graph; }790 const Graph& getGraph() const { return (*graph); }789 gw(_G), flow(&_flow), capacity(&_capacity) { } 790 791 //void setGraph(const Graph& _graph) { graph = &_graph; } 792 //const Graph& getGraph() const { return (*graph); } 791 793 792 794 class Edge; … … 830 832 private: 831 833 OutEdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG, Node v) : Edge() { 832 resG.g raph->first(out, v);833 while( resG.g raph->valid(out) && !(resG.free(out)>0) ) { resG.graph->next(out); }834 if (!resG.g raph->valid(out)) {834 resG.gw.first(out, v); 835 while( resG.gw.valid(out) && !(resG.free(out)>0) ) { resG.gw.next(out); } 836 if (!resG.gw.valid(out)) { 835 837 out_or_in=0; 836 resG.g raph->first(in, v);837 while( resG.g raph->valid(in) && !(resG.free(in)>0) ) { resG.graph->next(in); }838 resG.gw.first(in, v); 839 while( resG.gw.valid(in) && !(resG.free(in)>0) ) { resG.gw.next(in); } 838 840 } 839 841 } … … 865 867 EdgeIt(const Invalid& i) : Edge(i) { } 866 868 EdgeIt(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& resG) : Edge() { 867 resG.g raph->first(v);868 if (resG.g raph->valid(v)) resG.graph->first(out, v); else out=OldOutEdgeIt(INVALID);869 while (resG.g raph->valid(out) && !(resG.free(out)>0) ) { resG.graph->next(out); }870 while (resG.g raph->valid(v) && !resG.graph->valid(out)) {871 resG.g raph->next(v);872 if (resG.g raph->valid(v)) resG.graph->first(out, v);873 while (resG.g raph->valid(out) && !(resG.free(out)>0) ) { resG.graph->next(out); }869 resG.gw.first(v); 870 if (resG.gw.valid(v)) resG.gw.first(out, v); else out=/*OldOutEdgeIt*/(INVALID); 871 while (resG.gw.valid(out) && !(resG.free(out)>0) ) { resG.gw.next(out); } 872 while (resG.gw.valid(v) && !resG.gw.valid(out)) { 873 resG.gw.next(v); 874 if (resG.gw.valid(v)) resG.gw.first(out, v); 875 while (resG.gw.valid(out) && !(resG.free(out)>0) ) { resG.gw.next(out); } 874 876 } 875 if (!resG.g raph->valid(out)) {877 if (!resG.gw.valid(out)) { 876 878 out_or_in=0; 877 resG.g raph->first(v);878 if (resG.g raph->valid(v)) resG.graph->first(in, v); else in=OldInEdgeIt(INVALID);879 while (resG.g raph->valid(in) && !(resG.free(in)>0) ) { resG.graph->next(in); }880 while (resG.g raph->valid(v) && !resG.graph->valid(in)) {881 resG.g raph->next(v);882 if (resG.g raph->valid(v)) resG.graph->first(in, v);883 while (resG.g raph->valid(in) && !(resG.free(in)>0) ) { resG.graph->next(in); }879 resG.gw.first(v); 880 if (resG.gw.valid(v)) resG.gw.first(in, v); else in=/*OldInEdgeIt*/(INVALID); 881 while (resG.gw.valid(in) && !(resG.free(in)>0) ) { resG.gw.next(in); } 882 while (resG.gw.valid(v) && !resG.gw.valid(in)) { 883 resG.gw.next(v); 884 if (resG.gw.valid(v)) resG.gw.first(in, v); 885 while (resG.gw.valid(in) && !(resG.free(in)>0) ) { resG.gw.next(in); } 884 886 } 885 887 } … … 918 920 }; 919 921 920 NodeIt& first(NodeIt& v) const { return g raph->first(v); }922 NodeIt& first(NodeIt& v) const { return gw.first(v); } 921 923 OutEdgeIt& first(OutEdgeIt& e, Node v) const { 922 924 e=OutEdgeIt(*this, v); … … 928 930 } 929 931 930 NodeIt& next(NodeIt& n) const { return g raph->next(n); }932 NodeIt& next(NodeIt& n) const { return gw.next(n); } 931 933 932 934 OutEdgeIt& next(OutEdgeIt& e) const { 933 935 if (e.out_or_in) { 934 Node v=g raph->aNode(e.out);935 g raph->next(e.out);936 while( g raph->valid(e.out) && !(free(e.out)>0) ) { graph->next(e.out); }937 if (!g raph->valid(e.out)) {936 Node v=gw.aNode(e.out); 937 gw.next(e.out); 938 while( gw.valid(e.out) && !(free(e.out)>0) ) { gw.next(e.out); } 939 if (!gw.valid(e.out)) { 938 940 e.out_or_in=0; 939 g raph->first(e.in, v);940 while( g raph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }941 gw.first(e.in, v); 942 while( gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 941 943 } 942 944 } else { 943 g raph->next(e.in);944 while( g raph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }945 gw.next(e.in); 946 while( gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 945 947 } 946 948 return e; … … 949 951 EdgeIt& next(EdgeIt& e) const { 950 952 if (e.out_or_in) { 951 g raph->next(e.out);952 while (g raph->valid(e.out) && !(free(e.out)>0) ) { graph->next(e.out); }953 while (g raph->valid(e.v) && !graph->valid(e.out)) {954 g raph->next(e.v);955 if (g raph->valid(e.v)) graph->first(e.out, e.v);956 while (g raph->valid(e.out) && !(free(e.out)>0) ) { graph->next(e.out); }953 gw.next(e.out); 954 while (gw.valid(e.out) && !(free(e.out)>0) ) { gw.next(e.out); } 955 while (gw.valid(e.v) && !gw.valid(e.out)) { 956 gw.next(e.v); 957 if (gw.valid(e.v)) gw.first(e.out, e.v); 958 while (gw.valid(e.out) && !(free(e.out)>0) ) { gw.next(e.out); } 957 959 } 958 if (!g raph->valid(e.out)) {960 if (!gw.valid(e.out)) { 959 961 e.out_or_in=0; 960 g raph->first(e.v);961 if (g raph->valid(e.v)) graph->first(e.in, e.v); else e.in=OldInEdgeIt(INVALID);962 while (g raph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }963 while (g raph->valid(e.v) && !graph->valid(e.in)) {964 g raph->next(e.v);965 if (g raph->valid(e.v)) graph->first(e.in, e.v);966 while (g raph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }962 gw.first(e.v); 963 if (gw.valid(e.v)) gw.first(e.in, e.v); else e.in=/*OldInEdgeIt*/(INVALID); 964 while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 965 while (gw.valid(e.v) && !gw.valid(e.in)) { 966 gw.next(e.v); 967 if (gw.valid(e.v)) gw.first(e.in, e.v); 968 while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 967 969 } 968 970 } 969 971 } else { 970 g raph->next(e.in);971 while (g raph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }972 while (g raph->valid(e.v) && !graph->valid(e.in)) {973 g raph->next(e.v);974 if (g raph->valid(e.v)) graph->first(e.in, e.v);975 while (g raph->valid(e.in) && !(free(e.in)>0) ) { graph->next(e.in); }972 gw.next(e.in); 973 while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 974 while (gw.valid(e.v) && !gw.valid(e.in)) { 975 gw.next(e.v); 976 if (gw.valid(e.v)) gw.first(e.in, e.v); 977 while (gw.valid(e.in) && !(free(e.in)>0) ) { gw.next(e.in); } 976 978 } 977 979 } … … 995 997 996 998 Node tail(Edge e) const { 997 return ((e.out_or_in) ? g raph->aNode(e.out) : graph->aNode(e.in)); }999 return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); } 998 1000 Node head(Edge e) const { 999 return ((e.out_or_in) ? g raph->bNode(e.out) : graph->bNode(e.in)); }1001 return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); } 1000 1002 1001 1003 Node aNode(OutEdgeIt e) const { 1002 return ((e.out_or_in) ? g raph->aNode(e.out) : graph->aNode(e.in)); }1004 return ((e.out_or_in) ? gw.aNode(e.out) : gw.aNode(e.in)); } 1003 1005 Node bNode(OutEdgeIt e) const { 1004 return ((e.out_or_in) ? g raph->bNode(e.out) : graph->bNode(e.in)); }1005 1006 int id(Node v) const { return g raph->id(v); }1007 1008 bool valid(Node n) const { return g raph->valid(n); }1006 return ((e.out_or_in) ? gw.bNode(e.out) : gw.bNode(e.in)); } 1007 1008 int id(Node v) const { return gw.id(v); } 1009 1010 bool valid(Node n) const { return gw.valid(n); } 1009 1011 bool valid(Edge e) const { 1010 return e.out_or_in ? g raph->valid(e.out) : graph->valid(e.in); }1012 return e.out_or_in ? gw.valid(e.out) : gw.valid(e.in); } 1011 1013 1012 1014 void augment(const Edge& e, Number a) const { … … 1032 1034 } 1033 1035 1034 template<typename T> class NodeMap : public Graph ::NodeMap<T> {1036 template<typename T> class NodeMap : public GraphWrapper::NodeMap<T> { 1035 1037 public: 1036 1038 NodeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) 1037 : Graph ::NodeMap<T>(_G.getGraph()) { }1039 : GraphWrapper::NodeMap<T>(_G.gw) { } 1038 1040 NodeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, 1039 T a) : Graph ::NodeMap<T>(_G.getGraph(), a) { }1041 T a) : GraphWrapper::NodeMap<T>(_G.gw, a) { } 1040 1042 }; 1041 1043 … … 1052 1054 template <typename T> 1053 1055 class EdgeMap { 1054 typename Graph ::EdgeMap<T> forward_map, backward_map;1055 public: 1056 EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) : forward_map(_G.g etGraph()), backward_map(_G.getGraph()) { }1057 EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, T a) : forward_map(_G.g etGraph(), a), backward_map(_G.getGraph(), a) { }1056 typename GraphWrapper::EdgeMap<T> forward_map, backward_map; 1057 public: 1058 EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G) : forward_map(_G.gw), backward_map(_G.gw) { } 1059 EdgeMap(const ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>& _G, T a) : forward_map(_G.gw, a), backward_map(_G.gw, a) { } 1058 1060 void set(Edge e, T a) { 1059 1061 if (e.out_or_in) … … 1128 1130 1129 1131 //template<typename I> I getNext(const I& i) const { 1130 // return g raph->getNext(i); }1131 //template<typename I> I& next(I &i) const { return g raph->next(i); }1132 // return gw.getNext(i); } 1133 //template<typename I> I& next(I &i) const { return gw.next(i); } 1132 1134 1133 1135 template< typename It > It first() const { … … 1137 1139 It e; first(e, v); return e; } 1138 1140 1139 //Node head(const Edge& e) const { return g raph->head(e); }1140 //Node tail(const Edge& e) const { return g raph->tail(e); }1141 //Node head(const Edge& e) const { return gw.head(e); } 1142 //Node tail(const Edge& e) const { return gw.tail(e); } 1141 1143 1142 1144 //template<typename I> bool valid(const I& i) const 1143 // { return g raph->valid(i); }1144 1145 //int nodeNum() const { return g raph->nodeNum(); }1146 //int edgeNum() const { return g raph->edgeNum(); }1145 // { return gw.valid(i); } 1146 1147 //int nodeNum() const { return gw.nodeNum(); } 1148 //int edgeNum() const { return gw.edgeNum(); } 1147 1149 1148 1150 //template<typename I> Node aNode(const I& e) const { 1149 // return g raph->aNode(e); }1151 // return gw.aNode(e); } 1150 1152 //template<typename I> Node bNode(const I& e) const { 1151 // return g raph->bNode(e); }1152 1153 //Node addNode() const { return g raph->addNode(); }1153 // return gw.bNode(e); } 1154 1155 //Node addNode() const { return gw.addNode(); } 1154 1156 //Edge addEdge(const Node& tail, const Node& head) const { 1155 // return g raph->addEdge(tail, head); }1157 // return gw.addEdge(tail, head); } 1156 1158 1157 1159 //void erase(const OutEdgeIt& e) { … … 1163 1165 first_out_edges.set(this->tail(e), f); 1164 1166 } 1165 //template<typename I> void erase(const I& i) const { g raph->erase(i); }1166 1167 //void clear() const { g raph->clear(); }1167 //template<typename I> void erase(const I& i) const { gw.erase(i); } 1168 1169 //void clear() const { gw.clear(); } 1168 1170 1169 1171 template<typename T> class NodeMap : public ResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::NodeMap<T> { … … 1210 1212 FilterGraphWrapper(const Graph& _G, FlowMap& _flow, 1211 1213 const CapacityMap& _capacity) : 1212 ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>(_G, _flow, _capacity), dist(*this, g raph->nodeNum()) {1214 ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>(_G, _flow, _capacity), dist(*this, gw.nodeNum()) { 1213 1215 } 1214 1216 … … 1249 1251 //Graph& getGraph() const { return (*graph); } 1250 1252 1251 //template<typename I> I& first(I& i) const { return g raph->first(i); }1253 //template<typename I> I& first(I& i) const { return gw.first(i); } 1252 1254 //template<typename I, typename P> I& first(I& i, const P& p) const { 1253 // return g raph->first(i, p); }1255 // return gw.first(i, p); } 1254 1256 1255 1257 //template<typename I> I getNext(const I& i) const { 1256 // return g raph->getNext(i); }1257 //template<typename I> I& next(I &i) const { return g raph->next(i); }1258 // return gw.getNext(i); } 1259 //template<typename I> I& next(I &i) const { return gw.next(i); } 1258 1260 1259 1261 template< typename It > It first() const { … … 1263 1265 It e; first(e, v); return e; } 1264 1266 1265 //Node head(const Edge& e) const { return g raph->head(e); }1266 //Node tail(const Edge& e) const { return g raph->tail(e); }1267 //Node head(const Edge& e) const { return gw.head(e); } 1268 //Node tail(const Edge& e) const { return gw.tail(e); } 1267 1269 1268 1270 //template<typename I> bool valid(const I& i) const 1269 // { return g raph->valid(i); }1271 // { return gw.valid(i); } 1270 1272 1271 1273 //template<typename I> void setInvalid(const I &i); 1272 //{ return g raph->setInvalid(i); }1273 1274 //int nodeNum() const { return g raph->nodeNum(); }1275 //int edgeNum() const { return g raph->edgeNum(); }1274 //{ return gw.setInvalid(i); } 1275 1276 //int nodeNum() const { return gw.nodeNum(); } 1277 //int edgeNum() const { return gw.edgeNum(); } 1276 1278 1277 1279 //template<typename I> Node aNode(const I& e) const { 1278 // return g raph->aNode(e); }1280 // return gw.aNode(e); } 1279 1281 //template<typename I> Node bNode(const I& e) const { 1280 // return g raph->bNode(e); }1281 1282 //Node addNode() const { return g raph->addNode(); }1282 // return gw.bNode(e); } 1283 1284 //Node addNode() const { return gw.addNode(); } 1283 1285 //Edge addEdge(const Node& tail, const Node& head) const { 1284 // return g raph->addEdge(tail, head); }1285 1286 //template<typename I> void erase(const I& i) const { g raph->erase(i); }1287 1288 //void clear() const { g raph->clear(); }1286 // return gw.addEdge(tail, head); } 1287 1288 //template<typename I> void erase(const I& i) const { gw.erase(i); } 1289 1290 //void clear() const { gw.clear(); } 1289 1291 1290 1292 template<typename T> class NodeMap : public ErasingResGraphWrapper<Graph, Number, FlowMap, CapacityMap>::NodeMap<T> { … … 1342 1344 // typedef typename Graph::EdgeIt EdgeIt; 1343 1345 1344 // int nodeNum() const { return g raph->nodeNum(); }1345 // int edgeNum() const { return g raph->edgeNum(); }1346 1347 // Node& first(Node& n) const { return g raph->first(n); }1346 // int nodeNum() const { return gw.nodeNum(); } 1347 // int edgeNum() const { return gw.edgeNum(); } 1348 1349 // Node& first(Node& n) const { return gw.first(n); } 1348 1350 1349 1351 // // Edge and SymEdge is missing!!!! … … 1354 1356 // { 1355 1357 // e.n=n; 1356 // g raph->first(e.o,n);1357 // while(g raph->valid(e.o) && fmap.get(e.o)>=himap.get(e.o))1358 // g raph->goNext(e.o);1359 // if(!g raph->valid(e.o)) {1360 // g raph->first(e.i,n);1361 // while(g raph->valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))1362 // g raph->goNext(e.i);1358 // gw.first(e.o,n); 1359 // while(gw.valid(e.o) && fmap.get(e.o)>=himap.get(e.o)) 1360 // gw.goNext(e.o); 1361 // if(!gw.valid(e.o)) { 1362 // gw.first(e.i,n); 1363 // while(gw.valid(e.i) && fmap.get(e.i)<=lomap.get(e.i)) 1364 // gw.goNext(e.i); 1363 1365 // } 1364 1366 // return e; … … 1367 1369 // OutEdgeIt &goNext(OutEdgeIt &e) 1368 1370 // { 1369 // if(g raph->valid(e.o)) {1370 // while(g raph->valid(e.o) && fmap.get(e.o)>=himap.get(e.o))1371 // g raph->goNext(e.o);1372 // if(g raph->valid(e.o)) return e;1373 // else g raph->first(e.i,e.n);1371 // if(gw.valid(e.o)) { 1372 // while(gw.valid(e.o) && fmap.get(e.o)>=himap.get(e.o)) 1373 // gw.goNext(e.o); 1374 // if(gw.valid(e.o)) return e; 1375 // else gw.first(e.i,e.n); 1374 1376 // } 1375 1377 // else { 1376 // while(g raph->valid(e.i) && fmap.get(e.i)<=lomap.get(e.i))1377 // g raph->goNext(e.i);1378 // while(gw.valid(e.i) && fmap.get(e.i)<=lomap.get(e.i)) 1379 // gw.goNext(e.i); 1378 1380 // return e; 1379 1381 // } … … 1381 1383 // OutEdgeIt Next(const OutEdgeIt &e) {OutEdgeIt t(e); return goNext(t);} 1382 1384 // */ 1383 // //bool valid(const OutEdgeIt e) { return g raph->valid(e.o)||graph->valid(e.i);}1385 // //bool valid(const OutEdgeIt e) { return gw.valid(e.o)||gw.valid(e.i);} 1384 1386 1385 1387 // //FIXME … … 1387 1389 // { 1388 1390 // e.n=n; 1389 // g raph->first(e.i,n);1390 // while(g raph->valid(e.i) && fmap.get(e.i)>=himap.get(e.i))1391 // g raph->goNext(e.i);1392 // if(!g raph->valid(e.i)) {1393 // g raph->first(e.o,n);1394 // while(g raph->valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))1395 // g raph->goNext(e.o);1391 // gw.first(e.i,n); 1392 // while(gw.valid(e.i) && fmap.get(e.i)>=himap.get(e.i)) 1393 // gw.goNext(e.i); 1394 // if(!gw.valid(e.i)) { 1395 // gw.first(e.o,n); 1396 // while(gw.valid(e.o) && fmap.get(e.o)<=lomap.get(e.o)) 1397 // gw.goNext(e.o); 1396 1398 // } 1397 1399 // return e; … … 1400 1402 // InEdgeIt &goNext(InEdgeIt &e) 1401 1403 // { 1402 // if(g raph->valid(e.i)) {1403 // while(g raph->valid(e.i) && fmap.get(e.i)>=himap.get(e.i))1404 // g raph->goNext(e.i);1405 // if(g raph->valid(e.i)) return e;1406 // else g raph->first(e.o,e.n);1404 // if(gw.valid(e.i)) { 1405 // while(gw.valid(e.i) && fmap.get(e.i)>=himap.get(e.i)) 1406 // gw.goNext(e.i); 1407 // if(gw.valid(e.i)) return e; 1408 // else gw.first(e.o,e.n); 1407 1409 // } 1408 1410 // else { 1409 // while(g raph->valid(e.o) && fmap.get(e.o)<=lomap.get(e.o))1410 // g raph->goNext(e.o);1411 // while(gw.valid(e.o) && fmap.get(e.o)<=lomap.get(e.o)) 1412 // gw.goNext(e.o); 1411 1413 // return e; 1412 1414 // } … … 1414 1416 // InEdgeIt Next(const InEdgeIt &e) {InEdgeIt t(e); return goNext(t);} 1415 1417 // */ 1416 // //bool valid(const InEdgeIt e) { return g raph->valid(e.i)||graph->valid(e.o);}1417 1418 // //template<typename I> I &goNext(I &i); { return g raph->goNext(i); }1419 // //template<typename I> I next(const I i); { return g raph->goNext(i); }1418 // //bool valid(const InEdgeIt e) { return gw.valid(e.i)||gw.valid(e.o);} 1419 1420 // //template<typename I> I &goNext(I &i); { return gw.goNext(i); } 1421 // //template<typename I> I next(const I i); { return gw.goNext(i); } 1420 1422 1421 1423 // template< typename It > It first() const { … … 1425 1427 // It e; first(e, v); return e; } 1426 1428 1427 // Node head(const Edge& e) const { return g raph->head(e); }1428 // Node tail(const Edge& e) const { return g raph->tail(e); }1429 // Node head(const Edge& e) const { return gw.head(e); } 1430 // Node tail(const Edge& e) const { return gw.tail(e); } 1429 1431 1430 1432 // template<typename I> Node aNode(const I& e) const { 1431 // return g raph->aNode(e); }1433 // return gw.aNode(e); } 1432 1434 // template<typename I> Node bNode(const I& e) const { 1433 // return g raph->bNode(e); }1435 // return gw.bNode(e); } 1434 1436 1435 1437 // //template<typename I> bool valid(const I i); 1436 // //{ return g raph->valid(i); }1438 // //{ return gw.valid(i); } 1437 1439 1438 1440 // //template<typename I> void setInvalid(const I &i); 1439 // //{ return g raph->setInvalid(i); }1440 1441 // Node addNode() { return g raph->addNode(); }1441 // //{ return gw.setInvalid(i); } 1442 1443 // Node addNode() { return gw.addNode(); } 1442 1444 // Edge addEdge(const Node& tail, const Node& head) { 1443 // return g raph->addEdge(tail, head); }1444 1445 // template<typename I> void erase(const I& i) { g raph->erase(i); }1446 1447 // void clear() { g raph->clear(); }1445 // return gw.addEdge(tail, head); } 1446 1447 // template<typename I> void erase(const I& i) { gw.erase(i); } 1448 1449 // void clear() { gw.clear(); } 1448 1450 1449 1451 // template<typename S> class NodeMap : public Graph::NodeMap<S> { }; … … 1459 1461 } //namespace hugo 1460 1462 1461 #endif // GRAPH_WRAPPER_H1462 1463 #endif //HUGO_GRAPH_WRAPPER_H 1464 -
src/work/marci/makefile
r196 r259 6 6 #LEDAROOT ?= /ledasrc/LEDA-4.1 7 7 BOOSTROOT ?= /home/marci/boost 8 INCLUDEDIRS ?= -I../../include -I.. -I. -I../{marci,jacint,alpar,klao,akos,athos} -I$(LEDAROOT)/incl -I$(BOOSTROOT) 8 INCLUDEDIRS ?= -I../../include -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT) 9 LEDAINCLUDE ?= -I$(LEDAROOT)/incl 9 10 CXXFLAGS = -g -O -W -Wall $(INCLUDEDIRS) -ansi -pedantic 10 11 11 LEDABINARIES = lg_vs_sg leda_graph_demo leda_bfs_dfs 12 BINARIES = edmonds_karp_demo max_bipartite_matching_demo12 LEDABINARIES = lg_vs_sg leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo 13 BINARIES = edmonds_karp_demo 13 14 #preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar preflow_demo_leda 14 15 … … 17 18 .depend dep depend: 18 19 -g++ $(INCLUDEDIRS) -M $(BINARIES:=.cc) > .depend #2>/dev/null 20 # -g++ $(INCLUDEDIRS) $(LEDAINCLUDE) -M $(LEDABINARIES:=.cc) >> .depend #2>/dev/null 19 21 20 22 … … 42 44 43 45 edmonds_karp_demo: 44 $(CXX3) $(CXXFLAGS) - g -I. -I.. -o edmonds_karp_demo edmonds_karp_demo.cc45 $(CXX3) $(CXXFLAGS) -g -pg -I. -I..-o edmonds_karp_demo_prof edmonds_karp_demo.cc46 $(CXX3) $(CXXFLAGS) -o edmonds_karp_demo edmonds_karp_demo.cc 47 # $(CXX3) $(CXXFLAGS) -pg -o edmonds_karp_demo_prof edmonds_karp_demo.cc 46 48 47 49 lg_vs_sg: -
src/work/marci/time_measure.h
r128 r259 1 1 // -*- c++ -*- 2 #ifndef TIME_MEASURE_H3 #define TIME_MEASURE_H2 #ifndef HUGO_TIME_MEASURE_H 3 #define HUGO_TIME_MEASURE_H 4 4 5 5 #include <sys/time.h> … … 128 128 } 129 129 130 #endif // TIME_MEASURE_H130 #endif //HUGO_TIME_MEASURE_H
Note: See TracChangeset
for help on using the changeset viewer.