diff -r 4fd76139b69e -r 8c567e298d7f test/matching_test.cc --- a/test/matching_test.cc Sat Feb 17 23:44:32 2018 +0100 +++ b/test/matching_test.cc Sat Oct 27 13:00:48 2018 +0200 @@ -134,6 +134,9 @@ mat_test.startSparse(); mat_test.startDense(); mat_test.run(); + mat_test.startSparse(false); + mat_test.startDense(false); + mat_test.run(false); const_mat_test.matchingSize(); const_mat_test.matching(e); @@ -402,15 +405,83 @@ graphReader(graph, lgfs). edgeMap("weight", weight).run(); + int size; bool perfect; { MaxMatching mm(graph); mm.run(); checkMatching(graph, mm); + size = mm.matchingSize(); perfect = 2 * mm.matchingSize() == countNodes(graph); } { + MaxMatching mm(graph); + mm.init(); + mm.startSparse(); + checkMatching(graph, mm); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.init(); + mm.startDense(); + checkMatching(graph, mm); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.greedyInit(); + mm.startSparse(); + checkMatching(graph, mm); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.greedyInit(); + mm.startDense(); + checkMatching(graph, mm); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.run(false); + check(size == mm.matchingSize(), "Inconsistent max cardinality matching"); + } + + { + MaxMatching mm(graph); + mm.init(); + mm.startSparse(false); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.init(); + mm.startDense(false); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.greedyInit(); + mm.startSparse(false); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { + MaxMatching mm(graph); + mm.greedyInit(); + mm.startDense(false); + check(size == mm.matchingSize(), "Inconsistent matching size"); + } + + { MaxWeightedMatching mwm(graph, weight); mwm.run(); checkWeightedMatching(graph, weight, mwm);