COIN-OR::LEMON - Graph Library

Changeset 970:d216e1c8b3fa in lemon-1.2 for test/matching_test.cc


Ignore:
Timestamp:
11/28/12 11:54:43 (7 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
965:00f8d9f9920d (diff), 969:7e368d9b67f7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge #453 to branches >=1.2

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • test/matching_test.cc

    r877 r970  
    146146  MaxMatching<Graph>::Status stat =
    147147    const_mat_test.status(n);
     148  ignore_unused_variable_warning(stat);
    148149  const MaxMatching<Graph>::StatusMap& smap =
    149150    const_mat_test.statusMap();
  • test/matching_test.cc

    r969 r970  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2009
     5 * Copyright (C) 2003-2010
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    135135  mat_test.startDense();
    136136  mat_test.run();
    137  
     137
    138138  const_mat_test.matchingSize();
    139139  const_mat_test.matching(e);
     
    144144  const_mat_test.mate(n);
    145145
    146   MaxMatching<Graph>::Status stat = 
     146  MaxMatching<Graph>::Status stat =
    147147    const_mat_test.status(n);
    148148  ignore_unused_variable_warning(stat);
     
    172172  mat_test.start();
    173173  mat_test.run();
    174  
     174
    175175  const_mat_test.matchingWeight();
    176176  const_mat_test.matchingSize();
     
    181181  e = mmap[n];
    182182  const_mat_test.mate(n);
    183  
     183
    184184  int k = 0;
    185185  const_mat_test.dualValue();
     
    209209  mat_test.start();
    210210  mat_test.run();
    211  
     211
    212212  const_mat_test.matchingWeight();
    213213  const_mat_test.matching(e);
     
    217217  e = mmap[n];
    218218  const_mat_test.mate(n);
    219  
     219
    220220  int k = 0;
    221221  const_mat_test.dualValue();
     
    403403      edgeMap("weight", weight).run();
    404404
    405     MaxMatching<SmartGraph> mm(graph);
    406     mm.run();
    407     checkMatching(graph, mm);
    408 
    409     MaxWeightedMatching<SmartGraph> mwm(graph, weight);
    410     mwm.run();
    411     checkWeightedMatching(graph, weight, mwm);
    412 
    413     MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
    414     bool perfect = mwpm.run();
    415 
    416     check(perfect == (mm.matchingSize() * 2 == countNodes(graph)),
    417           "Perfect matching found");
    418 
    419     if (perfect) {
    420       checkWeightedPerfectMatching(graph, weight, mwpm);
     405    bool perfect;
     406    {
     407      MaxMatching<SmartGraph> mm(graph);
     408      mm.run();
     409      checkMatching(graph, mm);
     410      perfect = 2 * mm.matchingSize() == countNodes(graph);
     411    }
     412
     413    {
     414      MaxWeightedMatching<SmartGraph> mwm(graph, weight);
     415      mwm.run();
     416      checkWeightedMatching(graph, weight, mwm);
     417    }
     418
     419    {
     420      MaxWeightedMatching<SmartGraph> mwm(graph, weight);
     421      mwm.init();
     422      mwm.start();
     423      checkWeightedMatching(graph, weight, mwm);
     424    }
     425
     426    {
     427      MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
     428      bool result = mwpm.run();
     429
     430      check(result == perfect, "Perfect matching found");
     431      if (perfect) {
     432        checkWeightedPerfectMatching(graph, weight, mwpm);
     433      }
     434    }
     435
     436    {
     437      MaxWeightedPerfectMatching<SmartGraph> mwpm(graph, weight);
     438      mwpm.init();
     439      bool result = mwpm.start();
     440
     441      check(result == perfect, "Perfect matching found");
     442      if (perfect) {
     443        checkWeightedPerfectMatching(graph, weight, mwpm);
     444      }
    421445    }
    422446  }
Note: See TracChangeset for help on using the changeset viewer.