Changeset 643:293551ad254f in lemon for test/gomory_hu_test.cc
- Timestamp:
- 04/15/09 09:37:51 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/gomory_hu_test.cc
r593 r643 3 3 #include "test_tools.h" 4 4 #include <lemon/smart_graph.h> 5 #include <lemon/concepts/graph.h> 6 #include <lemon/concepts/maps.h> 5 7 #include <lemon/lgf_reader.h> 6 8 #include <lemon/gomory_hu.h> … … 33 35 "target 3\n"; 34 36 37 void checkGomoryHuCompile() 38 { 39 typedef int Value; 40 typedef concepts::Graph Graph; 41 42 typedef Graph::Node Node; 43 typedef Graph::Edge Edge; 44 typedef concepts::ReadMap<Edge, Value> CapMap; 45 typedef concepts::ReadWriteMap<Node, bool> CutMap; 46 47 Graph g; 48 Node n; 49 CapMap cap; 50 CutMap cut; 51 Value v; 52 int d; 53 54 GomoryHu<Graph, CapMap> gh_test(g, cap); 55 const GomoryHu<Graph, CapMap>& 56 const_gh_test = gh_test; 57 58 gh_test.run(); 59 60 n = const_gh_test.predNode(n); 61 v = const_gh_test.predValue(n); 62 d = const_gh_test.rootDist(n); 63 v = const_gh_test.minCutValue(n, n); 64 v = const_gh_test.minCutMap(n, n, cut); 65 } 66 35 67 GRAPH_TYPEDEFS(Graph); 36 68 typedef Graph::EdgeMap<int> IntEdgeMap; … … 71 103 ght.minCutMap(u, v, cm); 72 104 check(pf.flowValue() == ght.minCutValue(u, v), "Wrong cut 1"); 73 check(cm[u] != cm[v], "Wrong cut 3");74 check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 2");105 check(cm[u] != cm[v], "Wrong cut 2"); 106 check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 3"); 75 107 76 108 int sum=0; … … 85 117 sum++; 86 118 check(sum == countNodes(graph), "Problem with MinCutNodeIt"); 87 88 119 } 89 120 }
Note: See TracChangeset
for help on using the changeset viewer.