Constructor and Description |
---|
LongHashMapUnionFind() |
LongHashMapUnionFind(gnu.trove.map.hash.TLongLongHashMap parents,
int nSets,
LongBinaryOperator comparator) |
Modifier and Type | Method and Description |
---|---|
LongHashMapUnionFind |
clone() |
long |
findRoot(long id) |
long |
join(long id1,
long id2)
Join two sets represented by
root1 and root2 |
long |
setCount() |
long |
size() |
public LongHashMapUnionFind()
public LongHashMapUnionFind(gnu.trove.map.hash.TLongLongHashMap parents, int nSets, LongBinaryOperator comparator)
parents
- assignments from id to representative of setnSets
- number of sets in parents
. This should be identical
with parents.valueCollection().size()
.comparator
- When joining to sets, the new representative id will be
determined by comparator:
id = comparator.comparator(id1, id2) < 0 ? id1 : id2
public long findRoot(long id)
public long join(long id1, long id2)
UnionFind
root1
and root2
public long size()
public long setCount()
public LongHashMapUnionFind clone()
Copyright © 2015–2022 ImgLib2. All rights reserved.