COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
03/04/10 15:20:59 (10 years ago)
Author:
Balazs Dezso <deba@…>
Branch:
default
Phase:
public
Message:

Uniforming primal scale to 2 (#314)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/fractional_matching_test.cc

    r869 r872  
    237237  check(pv == mfm.matchingSize(), "Wrong matching size");
    238238
     239  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
     240    check((e == mfm.matching(graph.u(e)) ? 1 : 0) +
     241          (e == mfm.matching(graph.v(e)) ? 1 : 0) ==
     242          mfm.matching(e), "Invalid matching");
     243  }
     244
    239245  SmartGraph::NodeMap<bool> processed(graph, false);
    240246  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
     
    284290      check(mfm.matching(n) != INVALID, "Invalid matching");
    285291      check(indeg == 1, "Invalid matching");
     292    }
     293    for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
     294      check((e == mfm.matching(graph.u(e)) ? 1 : 0) +
     295            (e == mfm.matching(graph.v(e)) ? 1 : 0) ==
     296            mfm.matching(e), "Invalid matching");
    286297    }
    287298  } else {
     
    338349  }
    339350
     351  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
     352    check((e == mwfm.matching(graph.u(e)) ? 1 : 0) +
     353          (e == mwfm.matching(graph.v(e)) ? 1 : 0) ==
     354          mwfm.matching(e), "Invalid matching");
     355  }
     356
    340357  int dv = 0;
    341358  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
     
    392409  }
    393410
     411  for (SmartGraph::EdgeIt e(graph); e != INVALID; ++e) {
     412    check((e == mwpfm.matching(graph.u(e)) ? 1 : 0) +
     413          (e == mwpfm.matching(graph.v(e)) ? 1 : 0) ==
     414          mwpfm.matching(e), "Invalid matching");
     415  }
     416
    394417  int dv = 0;
    395418  for (SmartGraph::NodeIt n(graph); n != INVALID; ++n) {
Note: See TracChangeset for help on using the changeset viewer.