COIN-OR::LEMON - Graph Library

Changeset 2386:81b47fc5c444 in lemon-0.x for lemon/bipartite_matching.h


Ignore:
Timestamp:
03/02/07 19:04:28 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3217
Message:

Hard Warning checking

  • based on the remark of the ZIB user
  • we do not use -Winline
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/bipartite_matching.h

    r2352 r2386  
    116116    /// It initalizes the data structures with an initial matching.
    117117    template <typename MatchingMap>
    118     void matchingInit(const MatchingMap& matching) {
     118    void matchingInit(const MatchingMap& mm) {
    119119      for (ANodeIt it(*graph); it != INVALID; ++it) {
    120120        anode_matching[it] = INVALID;
     
    125125      matching_size = 0;
    126126      for (UEdgeIt it(*graph); it != INVALID; ++it) {
    127         if (matching[it]) {
     127        if (mm[it]) {
    128128          ++matching_size;
    129129          anode_matching[graph->aNode(it)] = it;
     
    138138    /// \return %True when the given map contains really a matching.
    139139    template <typename MatchingMap>
    140     void checkedMatchingInit(const MatchingMap& matching) {
     140    void checkedMatchingInit(const MatchingMap& mm) {
    141141      for (ANodeIt it(*graph); it != INVALID; ++it) {
    142142        anode_matching[it] = INVALID;
     
    147147      matching_size = 0;
    148148      for (UEdgeIt it(*graph); it != INVALID; ++it) {
    149         if (matching[it]) {
     149        if (mm[it]) {
    150150          ++matching_size;
    151151          if (anode_matching[graph->aNode(it)] != INVALID) {
     
    188188      while (!success && !queue.empty()) {
    189189        std::vector<Node> newqueue;
    190         for (int i = 0; i < (int)queue.size(); ++i) {
     190        for (int i = 0; i < int(queue.size()); ++i) {
    191191          Node anode = queue[i];
    192192          for (IncEdgeIt jt(*graph, anode); jt != INVALID; ++jt) {
     
    214214        typename Graph::template ANodeMap<bool> aused(*graph, false);
    215215       
    216         for (int i = 0; i < (int)bqueue.size(); ++i) {
     216        for (int i = 0; i < int(bqueue.size()); ++i) {
    217217          Node bnode = bqueue[i];
    218218
     
    280280      while (!queue.empty()) {
    281281        std::vector<Node> newqueue;
    282         for (int i = 0; i < (int)queue.size(); ++i) {
     282        for (int i = 0; i < int(queue.size()); ++i) {
    283283          Node anode = queue[i];
    284284          for (IncEdgeIt jt(*graph, anode); jt != INVALID; ++jt) {
     
    364364      while (!queue.empty()) {
    365365        std::vector<Node> newqueue;
    366         for (int i = 0; i < (int)queue.size(); ++i) {
     366        for (int i = 0; i < int(queue.size()); ++i) {
    367367          Node anode = queue[i];
    368368          for (IncEdgeIt jt(*graph, anode); jt != INVALID; ++jt) {
     
    404404    /// \return The number of the matching edges.
    405405    template <typename MatchingMap>
    406     int quickMatching(MatchingMap& matching) const {
     406    int quickMatching(MatchingMap& mm) const {
    407407      for (ANodeIt it(*graph); it != INVALID; ++it) {
    408408        if (anode_matching[it] != INVALID) {
    409           matching[anode_matching[it]] = true;
     409          mm[anode_matching[it]] = true;
    410410        }
    411411      }
     
    418418    /// \return The number of the matching edges.
    419419    template <typename MatchingMap>
    420     int matching(MatchingMap& matching) const {
     420    int matching(MatchingMap& mm) const {
    421421      for (UEdgeIt it(*graph); it != INVALID; ++it) {
    422         matching[it] = it == anode_matching[graph->aNode(it)];
     422        mm[it] = it == anode_matching[graph->aNode(it)];
    423423      }
    424424      return matching_size;
     
    684684    /// automatically allocated map, of course.
    685685    /// \return \c (*this)
    686     MaxWeightedBipartiteMatching& heap(Heap& heap, HeapCrossRef &crossRef) {
     686    MaxWeightedBipartiteMatching& heap(Heap& hp, HeapCrossRef &cr) {
    687687      if(local_heap_cross_ref) {
    688688        delete _heap_cross_ref;
    689689        local_heap_cross_ref = false;
    690690      }
    691       _heap_cross_ref = &crossRef;
     691      _heap_cross_ref = &cr;
    692692      if(local_heap) {
    693693        delete _heap;
    694694        local_heap = false;
    695695      }
    696       _heap = &heap;
     696      _heap = &hp;
    697697      return *this;
    698698    }
     
    890890    /// for each edges.
    891891    template <typename PotentialMap>
    892     void potential(PotentialMap& potential) const {
    893       for (ANodeIt it(*graph); it != INVALID; ++it) {
    894         potential[it] = anode_potential[it];
     892    void potential(PotentialMap& pt) const {
     893      for (ANodeIt it(*graph); it != INVALID; ++it) {
     894        pt[it] = anode_potential[it];
    895895      }
    896896      for (BNodeIt it(*graph); it != INVALID; ++it) {
    897         potential[it] = bnode_potential[it];
     897        pt[it] = bnode_potential[it];
    898898      }
    899899    }
     
    905905    /// \return The number of the matching edges.
    906906    template <typename MatchingMap>
    907     int quickMatching(MatchingMap& matching) const {
     907    int quickMatching(MatchingMap& mm) const {
    908908      for (ANodeIt it(*graph); it != INVALID; ++it) {
    909909        if (anode_matching[it] != INVALID) {
    910           matching[anode_matching[it]] = true;
     910          mm[anode_matching[it]] = true;
    911911        }
    912912      }
     
    919919    /// \return The number of the matching edges.
    920920    template <typename MatchingMap>
    921     int matching(MatchingMap& matching) const {
     921    int matching(MatchingMap& mm) const {
    922922      for (UEdgeIt it(*graph); it != INVALID; ++it) {
    923         matching[it] = it == anode_matching[graph->aNode(it)];
     923        mm[it] = it == anode_matching[graph->aNode(it)];
    924924      }
    925925      return matching_size;
     
    12551255    /// automatically allocated map, of course.
    12561256    /// \return \c (*this)
    1257     MinCostMaxBipartiteMatching& heap(Heap& heap, HeapCrossRef &crossRef) {
     1257    MinCostMaxBipartiteMatching& heap(Heap& hp, HeapCrossRef &cr) {
    12581258      if(local_heap_cross_ref) {
    12591259        delete _heap_cross_ref;
    12601260        local_heap_cross_ref = false;
    12611261      }
    1262       _heap_cross_ref = &crossRef;
     1262      _heap_cross_ref = &cr;
    12631263      if(local_heap) {
    12641264        delete _heap;
    12651265        local_heap = false;
    12661266      }
    1267       _heap = &heap;
     1267      _heap = &hp;
    12681268      return *this;
    12691269    }
     
    14431443    /// for each edges.
    14441444    template <typename PotentialMap>
    1445     void potential(PotentialMap& potential) const {
    1446       for (ANodeIt it(*graph); it != INVALID; ++it) {
    1447         potential[it] = anode_potential[it];
     1445    void potential(PotentialMap& pt) const {
     1446      for (ANodeIt it(*graph); it != INVALID; ++it) {
     1447        pt[it] = anode_potential[it];
    14481448      }
    14491449      for (BNodeIt it(*graph); it != INVALID; ++it) {
    1450         potential[it] = bnode_potential[it];
     1450        pt[it] = bnode_potential[it];
    14511451      }
    14521452    }
     
    14581458    /// \return The number of the matching edges.
    14591459    template <typename MatchingMap>
    1460     int quickMatching(MatchingMap& matching) const {
     1460    int quickMatching(MatchingMap& mm) const {
    14611461      for (ANodeIt it(*graph); it != INVALID; ++it) {
    14621462        if (anode_matching[it] != INVALID) {
    1463           matching[anode_matching[it]] = true;
     1463          mm[anode_matching[it]] = true;
    14641464        }
    14651465      }
     
    14721472    /// \return The number of the matching edges.
    14731473    template <typename MatchingMap>
    1474     int matching(MatchingMap& matching) const {
     1474    int matching(MatchingMap& mm) const {
    14751475      for (UEdgeIt it(*graph); it != INVALID; ++it) {
    1476         matching[it] = it == anode_matching[graph->aNode(it)];
     1476        mm[it] = it == anode_matching[graph->aNode(it)];
    14771477      }
    14781478      return matching_size;
Note: See TracChangeset for help on using the changeset viewer.