Index: lemon/unionfind.h
===================================================================
--- lemon/unionfind.h	(revision 103)
+++ lemon/unionfind.h	(revision 209)
@@ -1,5 +1,5 @@
-/* -*- C++ -*-
+/* -*- mode: C++; indent-tabs-mode: nil; -*-
  *
- * This file is a part of LEMON, a generic C++ optimization library
+ * This file is a part of LEMON, a generic C++ optimization library.
  *
  * Copyright (C) 2003-2008
@@ -39,8 +39,8 @@
   /// \brief A \e Union-Find data structure implementation
   ///
-  /// The class implements the \e Union-Find data structure. 
+  /// The class implements the \e Union-Find data structure.
   /// The union operation uses rank heuristic, while
   /// the find operation uses path compression.
-  /// This is a very simple but efficient implementation, providing 
+  /// This is a very simple but efficient implementation, providing
   /// only four methods: join (union), find, insert and size.
   /// For more features see the \ref UnionFindEnum class.
@@ -51,5 +51,5 @@
   ///
   /// \pre You need to add all the elements by the \ref insert()
-  /// method.  
+  /// method.
   template <typename _ItemIntMap>
   class UnionFind {
@@ -112,5 +112,5 @@
     /// \brief Inserts a new element into the structure.
     ///
-    /// This method inserts a new element into the data structure. 
+    /// This method inserts a new element into the data structure.
     ///
     /// The method returns the index of the new component.
@@ -124,5 +124,5 @@
     /// \brief Joining the components of element \e a and element \e b.
     ///
-    /// This is the \e union operation of the Union-Find structure. 
+    /// This is the \e union operation of the Union-Find structure.
     /// Joins the component of element \e a and component of
     /// element \e b. If \e a and \e b are in the same component then
@@ -132,13 +132,13 @@
       int kb = repIndex(index[b]);
 
-      if ( ka == kb ) 
-	return false;
+      if ( ka == kb )
+        return false;
 
       if (items[ka] < items[kb]) {
-	items[ka] += items[kb];
-	items[kb] = ka;
+        items[ka] += items[kb];
+        items[kb] = ka;
       } else {
-	items[kb] += items[ka];
-	items[ka] = kb;
+        items[kb] += items[ka];
+        items[ka] = kb;
       }
       return true;
@@ -174,10 +174,10 @@
   class UnionFindEnum {
   public:
-    
+
     typedef _ItemIntMap ItemIntMap;
     typedef typename ItemIntMap::Key Item;
 
   private:
-    
+
     ItemIntMap& index;
 
@@ -203,5 +203,5 @@
       int next, prev;
     };
-    
+
     std::vector<ClassT> classes;
     int firstClass, firstFreeClass;
@@ -209,11 +209,11 @@
     int newClass() {
       if (firstFreeClass == -1) {
-	int cdx = classes.size();
-	classes.push_back(ClassT());
-	return cdx;
+        int cdx = classes.size();
+        classes.push_back(ClassT());
+        return cdx;
       } else {
-	int cdx = firstFreeClass;
-	firstFreeClass = classes[firstFreeClass].next;
-	return cdx;
+        int cdx = firstFreeClass;
+        firstFreeClass = classes[firstFreeClass].next;
+        return cdx;
       }
     }
@@ -221,11 +221,11 @@
     int newItem() {
       if (firstFreeItem == -1) {
-	int idx = items.size();
-	items.push_back(ItemT());
-	return idx;
+        int idx = items.size();
+        items.push_back(ItemT());
+        return idx;
       } else {
-	int idx = firstFreeItem;
-	firstFreeItem = items[firstFreeItem].next;
-	return idx;
+        int idx = firstFreeItem;
+        firstFreeItem = items[firstFreeItem].next;
+        return idx;
       }
     }
@@ -268,5 +268,5 @@
       items[items[idx].prev].next = items[idx].next;
       items[items[idx].next].prev = items[idx].prev;
-      
+
       items[idx].next = firstFreeItem;
       firstFreeItem = idx;
@@ -279,5 +279,5 @@
       items[ak].prev = items[bk].prev;
       items[bk].prev = tmp;
-        
+
     }
 
@@ -289,5 +289,5 @@
       classes[cls].prev = -1;
       firstClass = cls;
-    } 
+    }
 
     void unlaceClass(int cls) {
@@ -300,15 +300,15 @@
         classes[classes[cls].next].prev = classes[cls].prev;
       }
-      
+
       classes[cls].next = firstFreeClass;
       firstFreeClass = cls;
-    } 
+    }
 
   public:
 
-    UnionFindEnum(ItemIntMap& _index) 
-      : index(_index), items(), firstFreeItem(-1), 
-	firstClass(-1), firstFreeClass(-1) {}
-    
+    UnionFindEnum(ItemIntMap& _index)
+      : index(_index), items(), firstFreeItem(-1),
+        firstClass(-1), firstFreeClass(-1) {}
+
     /// \brief Inserts the given element into a new component.
     ///
@@ -333,5 +333,5 @@
 
       firstClass = cdx;
-      
+
       return cdx;
     }
@@ -340,5 +340,5 @@
     ///
     /// This methods inserts the element \e a into the component of the
-    /// element \e comp. 
+    /// element \e comp.
     void insert(const Item& item, int cls) {
       int rdx = classes[cls].firstItem;
@@ -373,5 +373,5 @@
     /// \brief Joining the component of element \e a and element \e b.
     ///
-    /// This is the \e union operation of the Union-Find structure. 
+    /// This is the \e union operation of the Union-Find structure.
     /// Joins the component of element \e a and component of
     /// element \e b. If \e a and \e b are in the same component then
@@ -383,5 +383,5 @@
 
       if (ak == bk) {
-	return -1;
+        return -1;
       }
 
@@ -392,13 +392,13 @@
 
       if (classes[acx].size > classes[bcx].size) {
-	classes[acx].size += classes[bcx].size;
-	items[bk].parent = ak;
+        classes[acx].size += classes[bcx].size;
+        items[bk].parent = ak;
         unlaceClass(bcx);
-	rcx = acx;
+        rcx = acx;
       } else {
-	classes[bcx].size += classes[acx].size;
-	items[ak].parent = bk;
+        classes[bcx].size += classes[acx].size;
+        items[ak].parent = bk;
         unlaceClass(acx);
-	rcx = bcx;
+        rcx = bcx;
       }
       spliceItems(ak, bk);
@@ -414,5 +414,5 @@
     }
 
-    /// \brief Splits up the component. 
+    /// \brief Splits up the component.
     ///
     /// Splitting the component into singleton components (component
@@ -424,13 +424,13 @@
         int next = items[idx].next;
 
-	singletonItem(idx);
-
-	int cdx = newClass();        
+        singletonItem(idx);
+
+        int cdx = newClass();
         items[idx].parent = ~cdx;
 
-	laceClass(cdx);
-	classes[cdx].size = 1;
-	classes[cdx].firstItem = idx;
-        
+        laceClass(cdx);
+        classes[cdx].size = 1;
+        classes[cdx].firstItem = idx;
+
         idx = next;
       }
@@ -440,5 +440,5 @@
 
       classes[~(items[idx].parent)].size = 1;
-      
+
     }
 
@@ -458,20 +458,20 @@
       int cdx = classIndex(idx);
       if (idx == fdx) {
-	unlaceClass(cdx);
-	items[idx].next = firstFreeItem;
-	firstFreeItem = idx;
-	return;
+        unlaceClass(cdx);
+        items[idx].next = firstFreeItem;
+        firstFreeItem = idx;
+        return;
       } else {
-	classes[cdx].firstItem = fdx;
-	--classes[cdx].size;
-	items[fdx].parent = ~cdx;
-
-	unlaceItem(idx);
-	idx = items[fdx].next;
-	while (idx != fdx) {
-	  items[idx].parent = fdx;
-	  idx = items[idx].next;
-	}
-          
+        classes[cdx].firstItem = fdx;
+        --classes[cdx].size;
+        items[fdx].parent = ~cdx;
+
+        unlaceItem(idx);
+        idx = items[fdx].next;
+        while (idx != fdx) {
+          items[idx].parent = fdx;
+          idx = items[idx].next;
+        }
+
       }
 
@@ -515,5 +515,5 @@
       /// Constructor to get invalid iterator
       ClassIt(Invalid) : unionFind(0), cdx(-1) {}
-      
+
       /// \brief Increment operator
       ///
@@ -523,5 +523,5 @@
         return *this;
       }
-      
+
       /// \brief Conversion operator
       ///
@@ -534,5 +534,5 @@
       ///
       /// Equality operator
-      bool operator==(const ClassIt& i) { 
+      bool operator==(const ClassIt& i) {
         return i.cdx == cdx;
       }
@@ -541,8 +541,8 @@
       ///
       /// Inequality operator
-      bool operator!=(const ClassIt& i) { 
+      bool operator!=(const ClassIt& i) {
         return i.cdx != cdx;
       }
-      
+
     private:
       const UnionFindEnum* unionFind;
@@ -578,5 +578,5 @@
       /// Constructor to get invalid iterator
       ItemIt(Invalid) : unionFind(0), idx(-1) {}
-      
+
       /// \brief Increment operator
       ///
@@ -587,5 +587,5 @@
         return *this;
       }
-      
+
       /// \brief Conversion operator
       ///
@@ -598,5 +598,5 @@
       ///
       /// Equality operator
-      bool operator==(const ItemIt& i) { 
+      bool operator==(const ItemIt& i) {
         return i.idx == idx;
       }
@@ -605,8 +605,8 @@
       ///
       /// Inequality operator
-      bool operator!=(const ItemIt& i) { 
+      bool operator!=(const ItemIt& i) {
         return i.idx != idx;
       }
-      
+
     private:
       const UnionFindEnum* unionFind;
@@ -631,10 +631,10 @@
   class ExtendFindEnum {
   public:
-    
+
     typedef _ItemIntMap ItemIntMap;
     typedef typename ItemIntMap::Key Item;
 
   private:
-    
+
     ItemIntMap& index;
 
@@ -659,10 +659,10 @@
     int newClass() {
       if (firstFreeClass != -1) {
-	int cdx = firstFreeClass;
-	firstFreeClass = classes[cdx].next;
-	return cdx;
+        int cdx = firstFreeClass;
+        firstFreeClass = classes[cdx].next;
+        return cdx;
       } else {
-	classes.push_back(ClassT());
-	return classes.size() - 1;
+        classes.push_back(ClassT());
+        return classes.size() - 1;
       }
     }
@@ -670,10 +670,10 @@
     int newItem() {
       if (firstFreeItem != -1) {
-	int idx = firstFreeItem;
-	firstFreeItem = items[idx].next;
-	return idx;
+        int idx = firstFreeItem;
+        firstFreeItem = items[idx].next;
+        return idx;
       } else {
-	items.push_back(ItemT());
-	return items.size() - 1;
+        items.push_back(ItemT());
+        return items.size() - 1;
       }
     }
@@ -682,8 +682,8 @@
 
     /// \brief Constructor
-    ExtendFindEnum(ItemIntMap& _index) 
-      : index(_index), items(), firstFreeItem(-1), 
-	classes(), firstClass(-1), firstFreeClass(-1) {}
-    
+    ExtendFindEnum(ItemIntMap& _index)
+      : index(_index), items(), firstFreeItem(-1),
+        classes(), firstClass(-1), firstFreeClass(-1) {}
+
     /// \brief Inserts the given element into a new component.
     ///
@@ -695,8 +695,8 @@
       classes[cdx].next = firstClass;
       if (firstClass != -1) {
-	classes[firstClass].prev = cdx;
+        classes[firstClass].prev = cdx;
       }
       firstClass = cdx;
-      
+
       int idx = newItem();
       items[idx].item = item;
@@ -708,5 +708,5 @@
 
       index.set(item, idx);
-      
+
       return cdx;
     }
@@ -751,5 +751,5 @@
       return items[classes[cls].firstItem].item;
     }
-    
+
     /// \brief Removes the given element from the structure.
     ///
@@ -762,27 +762,27 @@
       int idx = index[item];
       int cdx = items[idx].cls;
-      
+
       if (idx == items[idx].next) {
-	if (classes[cdx].prev != -1) {
-	  classes[classes[cdx].prev].next = classes[cdx].next; 
-	} else {
-	  firstClass = classes[cdx].next;
-	}
-	if (classes[cdx].next != -1) {
-	  classes[classes[cdx].next].prev = classes[cdx].prev; 
-	}
-	classes[cdx].next = firstFreeClass;
-	firstFreeClass = cdx;
+        if (classes[cdx].prev != -1) {
+          classes[classes[cdx].prev].next = classes[cdx].next;
+        } else {
+          firstClass = classes[cdx].next;
+        }
+        if (classes[cdx].next != -1) {
+          classes[classes[cdx].next].prev = classes[cdx].prev;
+        }
+        classes[cdx].next = firstFreeClass;
+        firstFreeClass = cdx;
       } else {
-	classes[cdx].firstItem = items[idx].next;
-	items[items[idx].next].prev = items[idx].prev;
-	items[items[idx].prev].next = items[idx].next;
+        classes[cdx].firstItem = items[idx].next;
+        items[items[idx].next].prev = items[idx].prev;
+        items[items[idx].prev].next = items[idx].next;
       }
       items[idx].next = firstFreeItem;
       firstFreeItem = idx;
-	
-    }    
-
-    
+
+    }
+
+
     /// \brief Removes the component of the given element from the structure.
     ///
@@ -797,10 +797,10 @@
 
       if (classes[cdx].prev != -1) {
-	classes[classes[cdx].prev].next = classes[cdx].next; 
+        classes[classes[cdx].prev].next = classes[cdx].next;
       } else {
-	firstClass = classes[cdx].next;
+        firstClass = classes[cdx].next;
       }
       if (classes[cdx].next != -1) {
-	classes[classes[cdx].next].prev = classes[cdx].prev; 
+        classes[classes[cdx].next].prev = classes[cdx].prev;
       }
       classes[cdx].next = firstFreeClass;
@@ -825,5 +825,5 @@
       /// Constructor to get invalid iterator
       ClassIt(Invalid) : extendFind(0), cdx(-1) {}
-      
+
       /// \brief Increment operator
       ///
@@ -833,5 +833,5 @@
         return *this;
       }
-      
+
       /// \brief Conversion operator
       ///
@@ -844,5 +844,5 @@
       ///
       /// Equality operator
-      bool operator==(const ClassIt& i) { 
+      bool operator==(const ClassIt& i) {
         return i.cdx == cdx;
       }
@@ -851,8 +851,8 @@
       ///
       /// Inequality operator
-      bool operator!=(const ClassIt& i) { 
+      bool operator!=(const ClassIt& i) {
         return i.cdx != cdx;
       }
-      
+
     private:
       const ExtendFindEnum* extendFind;
@@ -888,5 +888,5 @@
       /// Constructor to get invalid iterator
       ItemIt(Invalid) : extendFind(0), idx(-1) {}
-      
+
       /// \brief Increment operator
       ///
@@ -894,8 +894,8 @@
       ItemIt& operator++() {
         idx = extendFind->items[idx].next;
-	if (fdx == idx) idx = -1;
+        if (fdx == idx) idx = -1;
         return *this;
       }
-      
+
       /// \brief Conversion operator
       ///
@@ -908,5 +908,5 @@
       ///
       /// Equality operator
-      bool operator==(const ItemIt& i) { 
+      bool operator==(const ItemIt& i) {
         return i.idx == idx;
       }
@@ -915,8 +915,8 @@
       ///
       /// Inequality operator
-      bool operator!=(const ItemIt& i) { 
+      bool operator!=(const ItemIt& i) {
         return i.idx != idx;
       }
-      
+
     private:
       const ExtendFindEnum* extendFind;
@@ -950,9 +950,9 @@
   /// method.
   ///
-  template <typename _Value, typename _ItemIntMap, 
+  template <typename _Value, typename _ItemIntMap,
             typename _Comp = std::less<_Value> >
   class HeapUnionFind {
   public:
-    
+
     typedef _Value Value;
     typedef typename _ItemIntMap::Key Item;
@@ -1055,5 +1055,5 @@
       id = nodes[id].next;
       while (depth--) {
-        id = nodes[id].left;      
+        id = nodes[id].left;
       }
       return id;
@@ -1133,5 +1133,5 @@
       nodes[kd].right = nodes[id].prev;
       nodes[nodes[id].prev].next = -1;
-      
+
       nodes[jd].left = id;
       nodes[id].prev = -1;
@@ -1142,5 +1142,5 @@
         id = nodes[id].next;
         ++num;
-      }      
+      }
       nodes[kd].size -= num;
       nodes[jd].size = num;
@@ -1166,82 +1166,82 @@
       int jd = ~(classes[id].parent);
       while (nodes[jd].left != -1) {
-	int kd = nodes[jd].left;
-	if (nodes[jd].size == 1) {
-	  if (nodes[jd].parent < 0) {
-	    classes[id].parent = ~kd;
-	    classes[id].depth -= 1;
-	    nodes[kd].parent = ~id;
-	    deleteNode(jd);
-	    jd = kd;
-	  } else {
-	    int pd = nodes[jd].parent;
-	    if (nodes[nodes[jd].next].size < cmax) {
-	      pushLeft(nodes[jd].next, nodes[jd].left);
-	      if (less(nodes[jd].left, nodes[jd].next)) {
-		nodes[nodes[jd].next].prio = nodes[nodes[jd].left].prio;
-		nodes[nodes[jd].next].item = nodes[nodes[jd].left].item;
-	      } 
-	      popLeft(pd);
-	      deleteNode(jd);
-	      jd = pd;
-	    } else {
-	      int ld = nodes[nodes[jd].next].left;
-	      popLeft(nodes[jd].next);
-	      pushRight(jd, ld);
-	      if (less(ld, nodes[jd].left)) {
-		nodes[jd].item = nodes[ld].item;
-		nodes[jd].prio = nodes[jd].prio;
-	      }
-	      if (nodes[nodes[jd].next].item == nodes[ld].item) {
-		setPrio(nodes[jd].next);
-	      }
-	      jd = nodes[jd].left;
-	    }
-	  }
-	} else {
-	  jd = nodes[jd].left;
-	}
-      }
-    }    
+        int kd = nodes[jd].left;
+        if (nodes[jd].size == 1) {
+          if (nodes[jd].parent < 0) {
+            classes[id].parent = ~kd;
+            classes[id].depth -= 1;
+            nodes[kd].parent = ~id;
+            deleteNode(jd);
+            jd = kd;
+          } else {
+            int pd = nodes[jd].parent;
+            if (nodes[nodes[jd].next].size < cmax) {
+              pushLeft(nodes[jd].next, nodes[jd].left);
+              if (less(nodes[jd].left, nodes[jd].next)) {
+                nodes[nodes[jd].next].prio = nodes[nodes[jd].left].prio;
+                nodes[nodes[jd].next].item = nodes[nodes[jd].left].item;
+              }
+              popLeft(pd);
+              deleteNode(jd);
+              jd = pd;
+            } else {
+              int ld = nodes[nodes[jd].next].left;
+              popLeft(nodes[jd].next);
+              pushRight(jd, ld);
+              if (less(ld, nodes[jd].left)) {
+                nodes[jd].item = nodes[ld].item;
+                nodes[jd].prio = nodes[jd].prio;
+              }
+              if (nodes[nodes[jd].next].item == nodes[ld].item) {
+                setPrio(nodes[jd].next);
+              }
+              jd = nodes[jd].left;
+            }
+          }
+        } else {
+          jd = nodes[jd].left;
+        }
+      }
+    }
 
     void repairRight(int id) {
       int jd = ~(classes[id].parent);
       while (nodes[jd].right != -1) {
-	int kd = nodes[jd].right;
-	if (nodes[jd].size == 1) {
-	  if (nodes[jd].parent < 0) {
-	    classes[id].parent = ~kd;
-	    classes[id].depth -= 1;
-	    nodes[kd].parent = ~id;
-	    deleteNode(jd);
-	    jd = kd;
-	  } else {
-	    int pd = nodes[jd].parent;
-	    if (nodes[nodes[jd].prev].size < cmax) {
-	      pushRight(nodes[jd].prev, nodes[jd].right);
-	      if (less(nodes[jd].right, nodes[jd].prev)) {
-		nodes[nodes[jd].prev].prio = nodes[nodes[jd].right].prio;
-		nodes[nodes[jd].prev].item = nodes[nodes[jd].right].item;
-	      } 
-	      popRight(pd);
-	      deleteNode(jd);
-	      jd = pd;
-	    } else {
-	      int ld = nodes[nodes[jd].prev].right;
-	      popRight(nodes[jd].prev);
-	      pushLeft(jd, ld);
-	      if (less(ld, nodes[jd].right)) {
-		nodes[jd].item = nodes[ld].item;
-		nodes[jd].prio = nodes[jd].prio;
-	      }
-	      if (nodes[nodes[jd].prev].item == nodes[ld].item) {
-		setPrio(nodes[jd].prev);
-	      }
-	      jd = nodes[jd].right;
-	    }
-	  }
-	} else {
-	  jd = nodes[jd].right;
-	}
+        int kd = nodes[jd].right;
+        if (nodes[jd].size == 1) {
+          if (nodes[jd].parent < 0) {
+            classes[id].parent = ~kd;
+            classes[id].depth -= 1;
+            nodes[kd].parent = ~id;
+            deleteNode(jd);
+            jd = kd;
+          } else {
+            int pd = nodes[jd].parent;
+            if (nodes[nodes[jd].prev].size < cmax) {
+              pushRight(nodes[jd].prev, nodes[jd].right);
+              if (less(nodes[jd].right, nodes[jd].prev)) {
+                nodes[nodes[jd].prev].prio = nodes[nodes[jd].right].prio;
+                nodes[nodes[jd].prev].item = nodes[nodes[jd].right].item;
+              }
+              popRight(pd);
+              deleteNode(jd);
+              jd = pd;
+            } else {
+              int ld = nodes[nodes[jd].prev].right;
+              popRight(nodes[jd].prev);
+              pushLeft(jd, ld);
+              if (less(ld, nodes[jd].right)) {
+                nodes[jd].item = nodes[ld].item;
+                nodes[jd].prio = nodes[jd].prio;
+              }
+              if (nodes[nodes[jd].prev].item == nodes[ld].item) {
+                setPrio(nodes[jd].prev);
+              }
+              jd = nodes[jd].right;
+            }
+          }
+        } else {
+          jd = nodes[jd].right;
+        }
       }
     }
@@ -1277,10 +1277,10 @@
     /// \brief Constructs the union-find.
     ///
-    /// Constructs the union-find.  
+    /// Constructs the union-find.
     /// \brief _index The index map of the union-find. The data
     /// structure uses internally for store references.
-    HeapUnionFind(ItemIntMap& _index) 
-      : index(_index), first_class(-1), 
-	first_free_class(-1), first_free_node(-1) {}
+    HeapUnionFind(ItemIntMap& _index)
+      : index(_index), first_class(-1),
+        first_free_class(-1), first_free_node(-1) {}
 
     /// \brief Insert a new node into a new component.
@@ -1304,5 +1304,5 @@
       nodes[id].item = item;
       index[item] = id;
-      
+
       int class_id = newClass();
       classes[class_id].parent = ~id;
@@ -1311,5 +1311,5 @@
       classes[class_id].left = -1;
       classes[class_id].right = -1;
-      
+
       if (first_class != -1) {
         classes[first_class].prev = class_id;
@@ -1320,5 +1320,5 @@
 
       nodes[id].parent = ~class_id;
-      
+
       return class_id;
     }
@@ -1333,5 +1333,5 @@
       return findClass(index[item]);
     }
-    
+
     /// \brief Joins the classes.
     ///
@@ -1372,5 +1372,5 @@
         }
         classes[classes[l].prev].next = classes[l].next;
-        
+
         classes[l].prev = -1;
         classes[l].next = -1;
@@ -1378,5 +1378,5 @@
         classes[l].depth = leftNode(l);
         classes[l].parent = class_id;
-        
+
       }
 
@@ -1456,5 +1456,5 @@
               pushLeft(new_parent, ~(classes[l].parent));
               setPrio(new_parent);
-              
+
               classes[r].parent = ~new_parent;
               classes[r].depth += 1;
@@ -1471,13 +1471,13 @@
             classes[l].depth = classes[r].depth;
           } else {
-            if (classes[l].depth != 0 && 
-                nodes[~(classes[l].parent)].size + 
+            if (classes[l].depth != 0 &&
+                nodes[~(classes[l].parent)].size +
                 nodes[~(classes[r].parent)].size <= cmax) {
               splice(~(classes[l].parent), ~(classes[r].parent));
               deleteNode(~(classes[r].parent));
               if (less(~(classes[r].parent), ~(classes[l].parent))) {
-                nodes[~(classes[l].parent)].prio = 
+                nodes[~(classes[l].parent)].prio =
                   nodes[~(classes[r].parent)].prio;
-                nodes[~(classes[l].parent)].item = 
+                nodes[~(classes[l].parent)].item =
                   nodes[~(classes[r].parent)].item;
               }
@@ -1488,5 +1488,5 @@
               pushRight(new_parent, ~(classes[r].parent));
               setPrio(new_parent);
-            
+
               classes[l].parent = ~new_parent;
               classes[l].depth += 1;
@@ -1543,10 +1543,10 @@
         classes[first_class].prev = classes[id].right;
         first_class = classes[id].left;
-        
+
         if (classes[id].next != -1) {
           classes[classes[id].next].prev = classes[id].prev;
         }
         classes[classes[id].prev].next = classes[id].next;
-        
+
         deleteClass(id);
       }
@@ -1558,5 +1558,5 @@
             l = nodes[l].parent;
           }
-          int r = l;    
+          int r = l;
           while (nodes[l].parent >= 0) {
             l = nodes[l].parent;
@@ -1581,5 +1581,5 @@
           repairRight(~(nodes[l].parent));
           repairLeft(cs[i]);
-          
+
           *out++ = cs[i];
         }
@@ -1604,5 +1604,5 @@
       }
     }
-      
+
     /// \brief Increase the priority of the current item.
     ///
@@ -1631,5 +1631,5 @@
       }
     }
-    
+
     /// \brief Gives back the minimum priority of the class.
     ///
@@ -1647,7 +1647,7 @@
 
     /// \brief Gives back a representant item of the class.
-    /// 
+    ///
     /// The representant is indpendent from the priorities of the
-    /// items. 
+    /// items.
     /// \return Gives back a representant item of the class.
     const Item& classRep(int id) const {
@@ -1675,10 +1675,10 @@
       const HeapUnionFind* _huf;
       int _id, _lid;
-      
+
     public:
 
-      /// \brief Default constructor 
-      ///
-      /// Default constructor 
+      /// \brief Default constructor
+      ///
+      /// Default constructor
       ItemIt() {}
 
@@ -1696,7 +1696,7 @@
           _id = _huf->leftNode(id);
           _lid = -1;
-        } 
-      }
-      
+        }
+      }
+
       /// \brief Increment operator
       ///
@@ -1713,9 +1713,9 @@
         return _huf->nodes[_id].item;
       }
-      
+
       /// \brief Equality operator
       ///
       /// Equality operator
-      bool operator==(const ItemIt& i) { 
+      bool operator==(const ItemIt& i) {
         return i._id == _id;
       }
@@ -1724,5 +1724,5 @@
       ///
       /// Inequality operator
-      bool operator!=(const ItemIt& i) { 
+      bool operator!=(const ItemIt& i) {
         return i._id != _id;
       }
@@ -1731,5 +1731,5 @@
       ///
       /// Equality operator
-      bool operator==(Invalid) { 
+      bool operator==(Invalid) {
         return _id == _lid;
       }
@@ -1738,13 +1738,13 @@
       ///
       /// Inequality operator
-      bool operator!=(Invalid) { 
+      bool operator!=(Invalid) {
         return _id != _lid;
       }
-      
+
     };
 
     /// \brief Class iterator
     ///
-    /// The iterator stores 
+    /// The iterator stores
     class ClassIt {
     private:
@@ -1755,15 +1755,15 @@
     public:
 
-      ClassIt(const HeapUnionFind& huf) 
+      ClassIt(const HeapUnionFind& huf)
         : _huf(&huf), _id(huf.first_class) {}
 
-      ClassIt(const HeapUnionFind& huf, int cls) 
+      ClassIt(const HeapUnionFind& huf, int cls)
         : _huf(&huf), _id(huf.classes[cls].left) {}
 
       ClassIt(Invalid) : _huf(0), _id(-1) {}
-      
+
       const ClassIt& operator++() {
         _id = _huf->classes[_id].next;
-	return *this;
+        return *this;
       }
 
@@ -1771,5 +1771,5 @@
       ///
       /// Equality operator
-      bool operator==(const ClassIt& i) { 
+      bool operator==(const ClassIt& i) {
         return i._id == _id;
       }
@@ -1778,12 +1778,12 @@
       ///
       /// Inequality operator
-      bool operator!=(const ClassIt& i) { 
+      bool operator!=(const ClassIt& i) {
         return i._id != _id;
-      }      
-      
+      }
+
       operator int() const {
-	return _id;
-      }
-            
+        return _id;
+      }
+
     };
 
