diff -r 0a48b28c6683 -r 1248d23d6e93 lemon/unionfind.h --- a/lemon/unionfind.h Sun Mar 07 09:49:42 2010 +0000 +++ b/lemon/unionfind.h Wed Mar 17 10:23:17 2010 +0100 @@ -1288,6 +1288,15 @@ : index(_index), first_class(-1), first_free_class(-1), first_free_node(-1) {} + /// \brief Clears the union-find data structure + /// + /// Erase each item from the data structure. + void clear() { + nodes.clear(); + classes.clear(); + first_free_node = first_free_class = first_class = -1; + } + /// \brief Insert a new node into a new component. /// /// Insert a new node into a new component.