fixed inline to INLINE
[libfirm] / ir / adt / unionfind.h
index 9364d6b..4dde3ec 100644 (file)
  * @file unionfind.h
  *
  * Union-Find datastructure
+ *
+ * This implementation uses weighted sets and path compression which results
+ * in O(n) complexity for n find and union operations (actually it's
+ * n * alpha(n) with alpha being the inverse of the ackermann function and
+ * therefore smaller than 5 for all 64bit values of n)
  */
 #ifndef _UNIONFIND_H
 #define _UNIONFIND_H
@@ -53,7 +58,7 @@ static INLINE int uf_union(int* data, int set1, int set2) {
        if(set1 == set2)
                return 0;
 
-       // need 2 set represantatives
+       // need 2 set representatives
        assert(d1 < 0 && d2 < 0);
 
        newcount = d1 + d2;
@@ -70,9 +75,9 @@ static INLINE int uf_union(int* data, int set1, int set2) {
 
 /**
  * Finds the representative for the set with member @p e.
- * The representative of a set is unique, so if the find operations
- * 2 similar/different representatives, then the elements are in the
- * same/2 different sets.
+ * The representative of a set is unique, so if the find operations finds
+ * the same/different representatives, then the elements are in the
+ * the same/different sets.
  *
  * @param data The union find data
  * @param e            The element