test/max_matching_test.cc
changeset 593 7ac52d6a268e
parent 590 b61354458b59
     1.1 --- a/test/max_matching_test.cc	Wed Apr 15 12:01:14 2009 +0200
     1.2 +++ b/test/max_matching_test.cc	Fri Apr 17 09:54:14 2009 +0200
     1.3 @@ -138,13 +138,17 @@
     1.4    const_mat_test.matchingSize();
     1.5    const_mat_test.matching(e);
     1.6    const_mat_test.matching(n);
     1.7 +  const MaxMatching<Graph>::MatchingMap& mmap =
     1.8 +    const_mat_test.matchingMap();
     1.9 +  e = mmap[n];
    1.10    const_mat_test.mate(n);
    1.11  
    1.12    MaxMatching<Graph>::Status stat = 
    1.13 -    const_mat_test.decomposition(n);
    1.14 +    const_mat_test.status(n);
    1.15 +  const MaxMatching<Graph>::StatusMap& smap =
    1.16 +    const_mat_test.statusMap();
    1.17 +  stat = smap[n];
    1.18    const_mat_test.barrier(n);
    1.19 -  
    1.20 -  ignore_unused_variable_warning(stat);
    1.21  }
    1.22  
    1.23  void checkMaxWeightedMatchingCompile()
    1.24 @@ -167,10 +171,13 @@
    1.25    mat_test.start();
    1.26    mat_test.run();
    1.27    
    1.28 -  const_mat_test.matchingValue();
    1.29 +  const_mat_test.matchingWeight();
    1.30    const_mat_test.matchingSize();
    1.31    const_mat_test.matching(e);
    1.32    const_mat_test.matching(n);
    1.33 +  const MaxWeightedMatching<Graph>::MatchingMap& mmap =
    1.34 +    const_mat_test.matchingMap();
    1.35 +  e = mmap[n];
    1.36    const_mat_test.mate(n);
    1.37    
    1.38    int k = 0;
    1.39 @@ -201,9 +208,12 @@
    1.40    mat_test.start();
    1.41    mat_test.run();
    1.42    
    1.43 -  const_mat_test.matchingValue();
    1.44 +  const_mat_test.matchingWeight();
    1.45    const_mat_test.matching(e);
    1.46    const_mat_test.matching(n);
    1.47 +  const MaxWeightedPerfectMatching<Graph>::MatchingMap& mmap =
    1.48 +    const_mat_test.matchingMap();
    1.49 +  e = mmap[n];
    1.50    const_mat_test.mate(n);
    1.51    
    1.52    int k = 0;
    1.53 @@ -224,9 +234,9 @@
    1.54    int barrier_num = 0;
    1.55  
    1.56    for (NodeIt n(graph); n != INVALID; ++n) {
    1.57 -    check(mm.decomposition(n) == MaxMatching<SmartGraph>::EVEN ||
    1.58 +    check(mm.status(n) == MaxMatching<SmartGraph>::EVEN ||
    1.59            mm.matching(n) != INVALID, "Wrong Gallai-Edmonds decomposition");
    1.60 -    if (mm.decomposition(n) == MaxMatching<SmartGraph>::ODD) {
    1.61 +    if (mm.status(n) == MaxMatching<SmartGraph>::ODD) {
    1.62        ++barrier_num;
    1.63      } else {
    1.64        comp.insert(n);
    1.65 @@ -239,16 +249,16 @@
    1.66        check(e == mm.matching(graph.v(e)), "Wrong matching");
    1.67        ++num;
    1.68      }
    1.69 -    check(mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
    1.70 -          mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
    1.71 +    check(mm.status(graph.u(e)) != MaxMatching<SmartGraph>::EVEN ||
    1.72 +          mm.status(graph.v(e)) != MaxMatching<SmartGraph>::MATCHED,
    1.73            "Wrong Gallai-Edmonds decomposition");
    1.74  
    1.75 -    check(mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
    1.76 -          mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
    1.77 +    check(mm.status(graph.v(e)) != MaxMatching<SmartGraph>::EVEN ||
    1.78 +          mm.status(graph.u(e)) != MaxMatching<SmartGraph>::MATCHED,
    1.79            "Wrong Gallai-Edmonds decomposition");
    1.80  
    1.81 -    if (mm.decomposition(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
    1.82 -        mm.decomposition(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
    1.83 +    if (mm.status(graph.u(e)) != MaxMatching<SmartGraph>::ODD &&
    1.84 +        mm.status(graph.v(e)) != MaxMatching<SmartGraph>::ODD) {
    1.85        comp.join(graph.u(e), graph.v(e));
    1.86      }
    1.87    }
    1.88 @@ -256,7 +266,7 @@
    1.89    std::set<int> comp_root;
    1.90    int odd_comp_num = 0;
    1.91    for (NodeIt n(graph); n != INVALID; ++n) {
    1.92 -    if (mm.decomposition(n) != MaxMatching<SmartGraph>::ODD) {
    1.93 +    if (mm.status(n) != MaxMatching<SmartGraph>::ODD) {
    1.94        int root = comp.find(n);
    1.95        if (comp_root.find(root) == comp_root.end()) {
    1.96          comp_root.insert(root);