com.bulletphysics.collision.dispatch
Class UnionFind
java.lang.Object
com.bulletphysics.collision.dispatch.UnionFind
public class UnionFind
- extends Object
UnionFind calculates connected subsets. Implements weighted Quick Union with
path compression.
UnionFind
public UnionFind()
sortIslands
public void sortIslands()
- This is a special operation, destroying the content of UnionFind.
It sorts the elements, based on island id, in order to make it easy to iterate over islands.
reset
public void reset(int N)
getNumElements
public int getNumElements()
isRoot
public boolean isRoot(int x)
getElement
public UnionFind.Element getElement(int index)
allocate
public void allocate(int N)
free
public void free()
find
public int find(int p,
int q)
unite
public void unite(int p,
int q)
find
public int find(int x)