COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
08/21/07 15:22:21 (12 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3301
Message:

Query functions: aMatching and bMatching
Modified algorithm function interfaces
ANodeMap<UEdge> matching map
BNodeMap<bool> barrier map

Consistency between augmenting path and push-relabel algorithm

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/bipartite_matching_test.cc

    r2462 r2463  
    137137
    138138  {
    139     Graph::UEdgeMap<bool> mm(graph);
     139    Graph::ANodeMap<UEdge> mm(graph);
    140140
    141141    check(max_cardinality == maxBipartiteMatching(graph, mm),
    142142          "WRONG MATCHING");
    143143   
    144     for (ANodeIt it(graph); it != INVALID; ++it) {
    145       int num = 0;
    146       for (IncEdgeIt jt(graph, it); jt != INVALID; ++jt) {
    147         if (mm[jt]) ++num;
     144    for (BNodeIt it(graph); it != INVALID; ++it) {
     145      int num = 0;
     146     
     147      for (IncEdgeIt jt(graph, it); jt != INVALID; ++jt) {
     148        if (mm[graph.aNode(jt)] == jt) ++num;
     149      }
     150      check(num <= 1, "INVALID PRIMAL");
     151    }
     152  }
     153
     154  {
     155    Graph::ANodeMap<UEdge> mm(graph);
     156
     157    check(max_cardinality == prBipartiteMatching(graph, mm),
     158          "WRONG MATCHING");
     159   
     160    for (BNodeIt it(graph); it != INVALID; ++it) {
     161      int num = 0;
     162     
     163      for (IncEdgeIt jt(graph, it); jt != INVALID; ++jt) {
     164        if (mm[graph.aNode(jt)] == jt) ++num;
    148165      }
    149166      check(num <= 1, "INVALID PRIMAL");
Note: See TracChangeset for help on using the changeset viewer.