diff -r 7a096a6bf53a -r 19651a04d056 test/bipartite_matching_test.cc --- a/test/bipartite_matching_test.cc Sat Aug 11 16:34:41 2007 +0000 +++ b/test/bipartite_matching_test.cc Tue Aug 21 13:22:21 2007 +0000 @@ -136,15 +136,32 @@ } { - Graph::UEdgeMap mm(graph); + Graph::ANodeMap mm(graph); check(max_cardinality == maxBipartiteMatching(graph, mm), "WRONG MATCHING"); - for (ANodeIt it(graph); it != INVALID; ++it) { + for (BNodeIt it(graph); it != INVALID; ++it) { int num = 0; + for (IncEdgeIt jt(graph, it); jt != INVALID; ++jt) { - if (mm[jt]) ++num; + if (mm[graph.aNode(jt)] == jt) ++num; + } + check(num <= 1, "INVALID PRIMAL"); + } + } + + { + Graph::ANodeMap mm(graph); + + check(max_cardinality == prBipartiteMatching(graph, mm), + "WRONG MATCHING"); + + for (BNodeIt it(graph); it != INVALID; ++it) { + int num = 0; + + for (IncEdgeIt jt(graph, it); jt != INVALID; ++jt) { + if (mm[graph.aNode(jt)] == jt) ++num; } check(num <= 1, "INVALID PRIMAL"); }