Constructor and Description |
---|
IntArrayUnionFind(int size) |
IntArrayUnionFind(int size,
IntBinaryOperator comparator) |
Modifier and Type | Method and Description |
---|---|
IntArrayUnionFind |
clone() |
int |
findRoot(int id)
Find the root node (set identifier) for a specified id.
|
long |
findRoot(long id) |
int |
intSetCount() |
int |
intSize() |
int |
join(int id1,
int id2)
Join two sets.
|
long |
join(long id1,
long id2)
Join two sets represented by
root1 and root2 |
long |
setCount() |
long |
size() |
public IntArrayUnionFind(int size)
public IntArrayUnionFind(int size, IntBinaryOperator comparator)
size
- Number of elements. (Initially, each element forms a single
element subset)comparator
- When joining to sets, the new representative id will be
determined by comparator:
id = comparator.comparator(id1, id2) < 0 ? id1 : id2
public int findRoot(int id)
id
- public int join(int id1, int id2)
id1
- Root node of the first set.id2
- Root node of the second set.public long findRoot(long id)
public long join(long id1, long id2)
UnionFind
root1
and root2
public long size()
public long setCount()
public int intSize()
public int intSetCount()
public IntArrayUnionFind clone()
Copyright © 2015–2022 ImgLib2. All rights reserved.