1.1 --- a/lemon/unionfind.h Thu Apr 19 15:14:34 2007 +0000
1.2 +++ b/lemon/unionfind.h Fri Apr 20 14:06:08 2007 +0000
1.3 @@ -101,6 +101,13 @@
1.4 return repIndex(index[a]);
1.5 }
1.6
1.7 + /// \brief Clears the union-find data structure
1.8 + ///
1.9 + /// Erase each item from the data structure.
1.10 + void clear() {
1.11 + items.clear();
1.12 + }
1.13 +
1.14 /// \brief Inserts a new element into the structure.
1.15 ///
1.16 /// This method inserts a new element into the data structure.
1.17 @@ -285,6 +292,14 @@
1.18 items.push_back(t);
1.19 }
1.20
1.21 + /// \brief Clears the union-find data structure
1.22 + ///
1.23 + /// Erase each item from the data structure.
1.24 + void clear() {
1.25 + items.clear();
1.26 + firstClass = -1;
1.27 + }
1.28 +
1.29 /// \brief Finds the leader of the component of the given element.
1.30 ///
1.31 /// The method returns the leader of the component of the given element.