COIN-OR::LEMON - Graph Library

Changeset 593:7ac52d6a268e in lemon-1.2 for test


Ignore:
Timestamp:
04/17/09 09:54:14 (11 years ago)
Author:
Peter Kovacs <kpeter@…>
Branch:
default
Phase:
public
Message:

Extend and modify the interface of matching algorithms (#265)

  • Rename decomposition() to status() in MaxMatching?.
  • Add a new query function statusMap() to MaxMatching?.
  • Add a new query function matchingMap() to all the three classes.
  • Rename matchingValue() to matchingWeight() in the weighted matching classes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/max_matching_test.cc

    r590 r593  
    139139  const_mat_test.matching(e);
    140140  const_mat_test.matching(n);
     141  const MaxMatching<Graph>::MatchingMap& mmap =
     142    const_mat_test.matchingMap();
     143  e = mmap[n];
    141144  const_mat_test.mate(n);
    142145
    143146  MaxMatching<Graph>::Status stat =
    144     const_mat_test.decomposition(n);
     147    const_mat_test.status(n);
     148  const MaxMatching<Graph>::StatusMap& smap =
     149    const_mat_test.statusMap();
     150  stat = smap[n];
    145151  const_mat_test.barrier(n);
    146  
    147   ignore_unused_variable_warning(stat);
    148152}
    149153
     
    168172  mat_test.run();
    169173 
    170   const_mat_test.matchingValue();
     174  const_mat_test.matchingWeight();
    171175  const_mat_test.matchingSize();
    172176  const_mat_test.matching(e);
    173177  const_mat_test.matching(n);
     178  const MaxWeightedMatching<Graph>::MatchingMap& mmap =
     179    const_mat_test.matchingMap();
     180  e = mmap[n];
    174181  const_mat_test.mate(n);
    175182 
     
    202209  mat_test.run();
    203210 
    204   const_mat_test.matchingValue();
     211  const_mat_test.matchingWeight();
    205212  const_mat_test.matching(e);
    206213  const_mat_test.matching(n);
     214  const MaxWeightedPerfectMatching<Graph>::MatchingMap& mmap =
     215    const_mat_test.matchingMap();
     216  e = mmap[n];
    207217  const_mat_test.mate(n);
    208218 
     
    225235
    226236  for (NodeIt n(graph); n != INVALID; ++n) {
    227     check(mm.decomposition(n) == MaxMatching<SmartGraph>::EVEN ||
     237    check(mm.status(n) == MaxMatching<SmartGraph>::EVEN ||
    228238          mm.matching(n) != INVALID, "Wrong Gallai-Edmonds decomposition");
    229     if (mm.decomposition(n) == MaxMatching<SmartGraph>::ODD) {
     239    if (mm.status(n) == MaxMatching<SmartGraph>::ODD) {
    230240      ++barrier_num;
    231241    } else {
     
    240250      ++num;
    241251    }
    242     check(mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
    243           mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
     252    check(mm.status(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
     253          mm.status(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
    244254          "Wrong Gallai-Edmonds decomposition");
    245255
    246     check(mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
    247           mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
     256    check(mm.status(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
     257          mm.status(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
    248258          "Wrong Gallai-Edmonds decomposition");
    249259
    250     if (mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
    251         mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
     260    if (mm.status(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
     261        mm.status(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
    252262      comp.join(graph.u(e), graph.v(e));
    253263    }
     
    257267  int odd_comp_num = 0;
    258268  for (NodeIt n(graph); n != INVALID; ++n) {
    259     if (mm.decomposition(n) != MaxMatching<SmartGraph>::ODD) {
     269    if (mm.status(n) != MaxMatching<SmartGraph>::ODD) {
    260270      int root = comp.find(n);
    261271      if (comp_root.find(root) == comp_root.end()) {
Note: See TracChangeset for help on using the changeset viewer.