diff -r a3402913cffe -r f63e87b9748e test/gomory_hu_test.cc --- a/test/gomory_hu_test.cc Sat Apr 18 21:54:30 2009 +0200 +++ b/test/gomory_hu_test.cc Tue Apr 21 10:34:49 2009 +0100 @@ -2,6 +2,8 @@ #include "test_tools.h" #include +#include +#include #include #include #include @@ -32,6 +34,36 @@ "source 0\n" "target 3\n"; +void checkGomoryHuCompile() +{ + typedef int Value; + typedef concepts::Graph Graph; + + typedef Graph::Node Node; + typedef Graph::Edge Edge; + typedef concepts::ReadMap CapMap; + typedef concepts::ReadWriteMap CutMap; + + Graph g; + Node n; + CapMap cap; + CutMap cut; + Value v; + int d; + + GomoryHu gh_test(g, cap); + const GomoryHu& + const_gh_test = gh_test; + + gh_test.run(); + + n = const_gh_test.predNode(n); + v = const_gh_test.predValue(n); + d = const_gh_test.rootDist(n); + v = const_gh_test.minCutValue(n, n); + v = const_gh_test.minCutMap(n, n, cut); +} + GRAPH_TYPEDEFS(Graph); typedef Graph::EdgeMap IntEdgeMap; typedef Graph::NodeMap BoolNodeMap; @@ -70,8 +102,8 @@ BoolNodeMap cm(graph); ght.minCutMap(u, v, cm); check(pf.flowValue() == ght.minCutValue(u, v), "Wrong cut 1"); - check(cm[u] != cm[v], "Wrong cut 3"); - check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 2"); + check(cm[u] != cm[v], "Wrong cut 2"); + check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 3"); int sum=0; for(GomoryHu::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a) @@ -84,7 +116,6 @@ for(GomoryHu::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n) sum++; check(sum == countNodes(graph), "Problem with MinCutNodeIt"); - } }