1.1 --- a/lemon/unionfind.h Sun Mar 07 09:49:42 2010 +0000
1.2 +++ b/lemon/unionfind.h Wed Mar 17 10:23:17 2010 +0100
1.3 @@ -1288,6 +1288,15 @@
1.4 : index(_index), first_class(-1),
1.5 first_free_class(-1), first_free_node(-1) {}
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 + nodes.clear();
1.12 + classes.clear();
1.13 + first_free_node = first_free_class = first_class = -1;
1.14 + }
1.15 +
1.16 /// \brief Insert a new node into a new component.
1.17 ///
1.18 /// Insert a new node into a new component.