lemon/unionfind.h
branch1.0
changeset 354 1cc2818c03c0
parent 351 561be42c4b99
child 408 cf0c1b85618c
     1.1 --- a/lemon/unionfind.h	Sun Dec 21 00:15:08 2008 +0100
     1.2 +++ b/lemon/unionfind.h	Sun Dec 21 20:46:35 2008 +0100
     1.3 @@ -1177,7 +1177,8 @@
     1.4              int pd = nodes[jd].parent;
     1.5              if (nodes[nodes[jd].next].size < cmax) {
     1.6                pushLeft(nodes[jd].next, nodes[jd].left);
     1.7 -              if (nodes[jd].item == nodes[pd].item) {
     1.8 +              if (less(jd, nodes[jd].next) ||
     1.9 +                  nodes[jd].item == nodes[pd].item) {
    1.10                  nodes[nodes[jd].next].prio = nodes[jd].prio;
    1.11                  nodes[nodes[jd].next].item = nodes[jd].item;
    1.12                }
    1.13 @@ -1220,7 +1221,8 @@
    1.14              int pd = nodes[jd].parent;
    1.15              if (nodes[nodes[jd].prev].size < cmax) {
    1.16                pushRight(nodes[jd].prev, nodes[jd].right);
    1.17 -              if (nodes[jd].item == nodes[pd].item) {
    1.18 +              if (less(jd, nodes[jd].prev) ||
    1.19 +                  nodes[jd].item == nodes[pd].item) {
    1.20                  nodes[nodes[jd].prev].prio = nodes[jd].prio;
    1.21                  nodes[nodes[jd].prev].item = nodes[jd].item;
    1.22                }
    1.23 @@ -1253,11 +1255,6 @@
    1.24        return comp(nodes[id].prio, nodes[jd].prio);
    1.25      }
    1.26  
    1.27 -    bool equal(int id, int jd) const {
    1.28 -      return !less(id, jd) && !less(jd, id);
    1.29 -    }
    1.30 -
    1.31 -
    1.32    public:
    1.33  
    1.34      /// \brief Returns true when the given class is alive.