diff -r 2b45f64f6377 -r 5c7f270f8e25 lemon/graph_utils.h --- a/lemon/graph_utils.h Tue Jul 12 21:45:39 2005 +0000 +++ b/lemon/graph_utils.h Wed Jul 13 13:16:57 2005 +0000 @@ -749,6 +749,18 @@ public: + /// \brief Swaps the position of the two items in the map. + /// + /// Swaps the position of the two items in the map. + void swap(const Item& p, const Item& q) { + int pi = Map::operator[](p); + int qi = Map::operator[](q); + Map::set(p, qi); + invMap[qi] = p; + Map::set(q, pi); + invMap[pi] = q; + } + /// \brief Gives back the \e descriptor of the item. /// /// Gives back the mutable and unique \e descriptor of the map. @@ -790,7 +802,7 @@ /// \brief Size of the map. /// /// Returns the size of the map. - unsigned size() const { + int size() const { return inverted.invMap.size(); }