test/fractional_matching_test.cc
changeset 1079 5958cc5c0a98
parent 877 141f9c0db4a3
child 1085 a337a0dd3f75
equal deleted inserted replaced
2:25c29aa6adfb 3:a286ccfa5ca8
   340     if (mwfm.matching(n) != INVALID) {
   340     if (mwfm.matching(n) != INVALID) {
   341       check(mwfm.nodeValue(n) >= 0, "Invalid node value");
   341       check(mwfm.nodeValue(n) >= 0, "Invalid node value");
   342       check(indeg == 1, "Invalid matching");
   342       check(indeg == 1, "Invalid matching");
   343       pv += weight[mwfm.matching(n)];
   343       pv += weight[mwfm.matching(n)];
   344       SmartGraph::Node o = graph.target(mwfm.matching(n));
   344       SmartGraph::Node o = graph.target(mwfm.matching(n));
       
   345       ignore_unused_variable_warning(o);
   345     } else {
   346     } else {
   346       check(mwfm.nodeValue(n) == 0, "Invalid matching");
   347       check(mwfm.nodeValue(n) == 0, "Invalid matching");
   347       check(indeg == 0, "Invalid matching");
   348       check(indeg == 0, "Invalid matching");
   348     }
   349     }
   349   }
   350   }
   404     }
   405     }
   405     check(mwpfm.matching(n) != INVALID, "Invalid perfect matching");
   406     check(mwpfm.matching(n) != INVALID, "Invalid perfect matching");
   406     check(indeg == 1, "Invalid perfect matching");
   407     check(indeg == 1, "Invalid perfect matching");
   407     pv += weight[mwpfm.matching(n)];
   408     pv += weight[mwpfm.matching(n)];
   408     SmartGraph::Node o = graph.target(mwpfm.matching(n));
   409     SmartGraph::Node o = graph.target(mwpfm.matching(n));
       
   410     ignore_unused_variable_warning(o);
   409   }
   411   }
   410 
   412 
   411   for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
   413   for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
   412     check((e == mwpfm.matching(graph.u(e)) ? 1 : 0) +
   414     check((e == mwpfm.matching(graph.u(e)) ? 1 : 0) +
   413           (e == mwpfm.matching(graph.v(e)) ? 1 : 0) ==
   415           (e == mwpfm.matching(graph.v(e)) ? 1 : 0) ==