|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Facemorph.haar.DisjointSets
public class DisjointSets
A disjoint sets ADT. Performs union-by-rank and path compression. Implemented using arrays. There is no error checking whatsoever. By adding your own error-checking, you might save yourself a lot of time finding bugs in your application code for Project 3 and Homework 9. Without error-checking, expect bad things to happen if you try to unite two elements that are not roots of their respective sets, or are not distinct. Elements are represented by ints, numbered from zero.
Constructor Summary | |
---|---|
DisjointSets(java.util.List objects)
Construct a disjoint sets object. |
Method Summary | |
---|---|
int |
find(int x)
find() finds the (int) name of the set containing a given element. |
static void |
groupRectangles(java.util.List<Face> rectList,
java.util.ArrayList<java.lang.Integer> weights,
int groupThreshold,
double eps)
Group a set of rectangle |
static void |
groupRectangles(java.util.List<Face> rectList,
int groupThreshold,
double eps)
Group a set of rectangle |
static void |
groupRectangles(java.util.List<Face> rectList,
int groupThreshold,
double eps,
java.util.ArrayList<java.lang.Integer> weights)
Group a set of rectangle |
static void |
main(java.lang.String[] args)
main() is test code. |
void |
union(int root1,
int root2)
union() unites two disjoint sets into a single set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DisjointSets(java.util.List objects)
objects
- the elements to put into the setsMethod Detail |
---|
public void union(int root1, int root2)
root1
- the root of the first set.root2
- the root of the other set.public int find(int x)
x
- the element sought.
public static void groupRectangles(java.util.List<Face> rectList, int groupThreshold, double eps, java.util.ArrayList<java.lang.Integer> weights)
rectList
- the list of rectanglesgroupThreshold
- the threshold counteps
- an error parameterweights
- list of countspublic static void groupRectangles(java.util.List<Face> rectList, int groupThreshold, double eps)
rectList
- the list of rectanglesgroupThreshold
- the threshold counteps
- an error parameterpublic static void groupRectangles(java.util.List<Face> rectList, java.util.ArrayList<java.lang.Integer> weights, int groupThreshold, double eps)
rectList
- the list of rectanglesweights
- list of countsgroupThreshold
- the threshold counteps
- an error parameterpublic static void main(java.lang.String[] args)
args
- the program args
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |