[Lemon-commits] [lemon_svn] marci: r1148 - in hugo/trunk/src: hugo test work/marci
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:43:32 CET 2006
Author: marci
Date: Tue Sep 14 12:09:24 2004
New Revision: 1148
Added:
hugo/trunk/src/test/graph_wrapper_test.cc
- copied, changed from r1137, /hugo/trunk/src/test/graph_test.cc
Modified:
hugo/trunk/src/hugo/graph_wrapper.h
hugo/trunk/src/hugo/preflow.h
hugo/trunk/src/work/marci/graph_wrapper_time.cc
hugo/trunk/src/work/marci/max_flow_demo.cc
Log:
Modified: hugo/trunk/src/hugo/graph_wrapper.h
==============================================================================
--- hugo/trunk/src/hugo/graph_wrapper.h (original)
+++ hugo/trunk/src/hugo/graph_wrapper.h Tue Sep 14 12:09:24 2004
@@ -229,6 +229,9 @@
public:
NodeMap(const GraphWrapper<Graph>& gw) : Parent(*(gw.graph)) { }
NodeMap(const GraphWrapper<Graph>& gw, T a) : Parent(*(gw.graph), a) { }
+// NodeMap(const NodeMap<T>& map) : Parent(map) { }
+// template<typename Map>
+// NodeMap(const Map& map) : Parent(map) { }
};
template<typename T> class EdgeMap : public Graph::template EdgeMap<T> {
@@ -236,6 +239,9 @@
public:
EdgeMap(const GraphWrapper<Graph>& gw) : Parent(*(gw.graph)) { }
EdgeMap(const GraphWrapper<Graph>& gw, T a) : Parent(*(gw.graph), a) { }
+// EdgeMap(const EdgeMap<T>& map) : Parent(map) { }
+// template<typename Map>
+// EdgeMap(const Map& map) : Parent(map) { }
};
};
Modified: hugo/trunk/src/hugo/preflow.h
==============================================================================
--- hugo/trunk/src/hugo/preflow.h (original)
+++ hugo/trunk/src/hugo/preflow.h Tue Sep 14 12:09:24 2004
@@ -344,7 +344,7 @@
///Sets \c M to the characteristic vector of a minimum value
///cut. This method can be called both after running \ref
///phase1 and \ref phase2. It is much faster after
- ///\ref phase1. \pre M should be a node map of bools. \pre
+ ///\ref phase1. \pre M should be a bool-valued node-map. \pre
///If \ref mincut is called after \ref phase2 then M should
///be initialized to false.
template<typename _CutMap>
Copied: hugo/trunk/src/test/graph_wrapper_test.cc (from r1137, /hugo/trunk/src/test/graph_test.cc)
==============================================================================
--- /hugo/trunk/src/test/graph_test.cc (original)
+++ hugo/trunk/src/test/graph_wrapper_test.cc Tue Sep 14 12:09:24 2004
@@ -3,6 +3,7 @@
#include<hugo/skeletons/graph.h>
#include<hugo/list_graph.h>
#include<hugo/full_graph.h>
+#include<hugo/graph_wrapper.h>
#include"test_tools.h"
#include"graph_test.h"
@@ -62,67 +63,70 @@
(skeleton::ErasableGraphSkeleton &);
//Compile SmartGraph
-template void checkCompileGraph<SmartGraph>(SmartGraph &);
-template void checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
+typedef SmartGraph Graph;
+typedef GraphWrapper<Graph> GW;
+template void checkCompileStaticGraph<GW>(GW &);
+//template void checkCompileGraphFindEdge<SmartGraph>(SmartGraph &);
//Compile SymSmartGraph
-template void checkCompileGraph<SymSmartGraph>(SymSmartGraph &);
-template void checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
-
-//Compile ListGraph
-template void checkCompileGraph<ListGraph>(ListGraph &);
-template void checkCompileErasableGraph<ListGraph>(ListGraph &);
-template void checkCompileGraphFindEdge<ListGraph>(ListGraph &);
-
-
-//Compile SymListGraph
-template void checkCompileGraph<SymListGraph>(SymListGraph &);
-template void checkCompileErasableGraph<SymListGraph>(SymListGraph &);
-template void checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
-
-//Compile FullGraph
-template void checkCompileStaticGraph<FullGraph>(FullGraph &);
-template void checkCompileGraphFindEdge<FullGraph>(FullGraph &);
-
-//Compile EdgeSet <ListGraph>
-template void checkCompileGraph<EdgeSet <ListGraph> >(EdgeSet <ListGraph> &);
-template void checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
-(EdgeSet <ListGraph> &);
-template void checkCompileGraphFindEdge<EdgeSet <ListGraph> >
-(EdgeSet <ListGraph> &);
-
-//Compile EdgeSet <NodeSet>
-template void checkCompileGraph<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
-template void checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
-(EdgeSet <NodeSet> &);
-template void checkCompileGraphFindEdge<EdgeSet <NodeSet> >
-(EdgeSet <NodeSet> &);
+typedef RevGraphWrapper<Graph> RevGW;
+template void checkCompileStaticGraph<RevGW>(RevGW &);
+//template void checkCompileGraphFindEdge<SymSmartGraph>(SymSmartGraph &);
+
+// //Compile ListGraph
+// template void checkCompileGraph<ListGraph>(ListGraph &);
+// template void checkCompileErasableGraph<ListGraph>(ListGraph &);
+// template void checkCompileGraphFindEdge<ListGraph>(ListGraph &);
+
+
+// //Compile SymListGraph
+// template void checkCompileGraph<SymListGraph>(SymListGraph &);
+// template void checkCompileErasableGraph<SymListGraph>(SymListGraph &);
+// template void checkCompileGraphFindEdge<SymListGraph>(SymListGraph &);
+
+// //Compile FullGraph
+// template void checkCompileStaticGraph<FullGraph>(FullGraph &);
+// template void checkCompileGraphFindEdge<FullGraph>(FullGraph &);
+
+// //Compile EdgeSet <ListGraph>
+// template void checkCompileGraph<EdgeSet <ListGraph> >(EdgeSet <ListGraph> &);
+// template void checkCompileGraphEraseEdge<EdgeSet <ListGraph> >
+// (EdgeSet <ListGraph> &);
+// template void checkCompileGraphFindEdge<EdgeSet <ListGraph> >
+// (EdgeSet <ListGraph> &);
+
+// //Compile EdgeSet <NodeSet>
+// template void checkCompileGraph<EdgeSet <NodeSet> >(EdgeSet <NodeSet> &);
+// template void checkCompileGraphEraseEdge<EdgeSet <NodeSet> >
+// (EdgeSet <NodeSet> &);
+// template void checkCompileGraphFindEdge<EdgeSet <NodeSet> >
+// (EdgeSet <NodeSet> &);
int main()
{
- {
- SmartGraph G;
- addPetersen(G);
- bidirPetersen(G);
- checkPetersen(G);
- }
- {
- ListGraph G;
- addPetersen(G);
- bidirPetersen(G);
- checkPetersen(G);
- }
- {
- SymSmartGraph G;
- addPetersen(G);
- checkPetersen(G);
- }
- {
- SymListGraph G;
- addPetersen(G);
- checkPetersen(G);
- }
+ // {
+// SmartGraph G;
+// addPetersen(G);
+// bidirPetersen(G);
+// checkPetersen(G);
+// }
+// {
+// ListGraph G;
+// addPetersen(G);
+// bidirPetersen(G);
+// checkPetersen(G);
+// }
+// {
+// SymSmartGraph G;
+// addPetersen(G);
+// checkPetersen(G);
+// }
+// {
+// SymListGraph G;
+// addPetersen(G);
+// checkPetersen(G);
+// }
///\file
///\todo map tests.
Modified: hugo/trunk/src/work/marci/graph_wrapper_time.cc
==============================================================================
--- hugo/trunk/src/work/marci/graph_wrapper_time.cc (original)
+++ hugo/trunk/src/work/marci/graph_wrapper_time.cc Tue Sep 14 12:09:24 2004
@@ -10,7 +10,7 @@
#include <hugo/invalid.h>
#include <hugo/time_measure.h>
#include <hugo/graph_wrapper.h>
-#include <hugo/max_flow.h>
+#include <hugo/preflow.h>
#include <hugo/dimacs.h>
#include <hugo/list_graph.h>
@@ -32,9 +32,9 @@
Timer ts;
ts.reset();
- typedef MaxFlow<Graph, int, FlowMap, FlowMap> MyMaxFlow;
- MyMaxFlow max_flow(g, s, t, cap, flow);
- max_flow.run(MyMaxFlow::NO_FLOW);
+ typedef Preflow<Graph, int, FlowMap, FlowMap> MyPreflow;
+ MyPreflow max_flow(g, s, t, cap, flow);
+ max_flow.run(MyPreflow::NO_FLOW);
cout << "flow value: " << max_flow.flowValue() << endl;
cout << ts << endl;
}
Modified: hugo/trunk/src/work/marci/max_flow_demo.cc
==============================================================================
--- hugo/trunk/src/work/marci/max_flow_demo.cc (original)
+++ hugo/trunk/src/work/marci/max_flow_demo.cc Tue Sep 14 12:09:24 2004
@@ -12,7 +12,7 @@
#include <hugo/dimacs.h>
#include <hugo/time_measure.h>
//#include <graph_wrapper.h>
-#include <hugo/max_flow.h>
+#include <hugo/preflow.h>
#include <augmenting_flow.h>
//#include <preflow_res.h>
#include <for_each_macros.h>
@@ -38,7 +38,7 @@
readDimacs(std::cin, g, cap, s, t);
Timer ts;
Graph::EdgeMap<int> flow(g); //0 flow
- MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
+ Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
max_flow_test(g, s, t, cap, flow);
AugmentingFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >
augmenting_flow_test(g, s, t, cap, flow);
@@ -51,7 +51,7 @@
max_flow_test.run();
std::cout << "elapsed time: " << ts << std::endl;
std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
- max_flow_test.actMinCut(cut);
+ max_flow_test.minCut(cut);
FOR_EACH_LOC(Graph::EdgeIt, e, g) {
if (cut[g.tail(e)] && !cut[g.head(e)] && !flow[e]==cap[e])
@@ -65,7 +65,7 @@
std::cout << "preflow ..." << std::endl;
FOR_EACH_LOC(Graph::EdgeIt, e, g) flow.set(e, 0);
ts.reset();
- max_flow_test.preflow(MaxFlow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW);
+ max_flow_test.preflow(Preflow<Graph, int, Graph::EdgeMap<int>, Graph::EdgeMap<int> >::GEN_FLOW);
std::cout << "elapsed time: " << ts << std::endl;
std::cout << "flow value: "<< max_flow_test.flowValue() << std::endl;
More information about the Lemon-commits
mailing list