COIN-OR::LEMON - Graph Library

Changeset 1552:5c7f270f8e25 in lemon-0.x


Ignore:
Timestamp:
07/13/05 15:16:57 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2048
Message:

Swap function for DescriptorMap?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/graph_utils.h

    r1547 r1552  
    750750  public:
    751751
     752    /// \brief Swaps the position of the two items in the map.
     753    ///
     754    /// Swaps the position of the two items in the map.
     755    void swap(const Item& p, const Item& q) {
     756      int pi = Map::operator[](p);
     757      int qi = Map::operator[](q);
     758      Map::set(p, qi);
     759      invMap[qi] = p;
     760      Map::set(q, pi);
     761      invMap[pi] = q;
     762    }
     763
    752764    /// \brief Gives back the \e descriptor of the item.
    753765    ///
     
    791803      ///
    792804      /// Returns the size of the map.
    793       unsigned size() const {
     805      int size() const {
    794806        return inverted.invMap.size();
    795807      }
Note: See TracChangeset for help on using the changeset viewer.