|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Facemorph.mdl.KdTree
public class KdTree
KdTree implementation
Constructor Summary | |
---|---|
KdTree(java.util.ArrayList<KdTreePoint> points)
KdTree constructor |
|
KdTree(java.util.ArrayList<KdTreePoint> points,
int sortIndex)
KdTree constructor |
Method Summary | |
---|---|
static double |
distance(double[] p,
double[] q)
Find the distance between two points |
KdTreePoint |
getNearest(KdTreePoint position)
Get the nearest to the point |
KdTreePoint |
getNearest(KdTreePoint position,
KdTreePoint currentNearest,
double currentDistance)
Get the nearest to position |
static void |
quickSort(java.util.ArrayList<KdTreePoint> points,
int index,
int start,
int len)
Does a quick sort on the values given |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public KdTree(java.util.ArrayList<KdTreePoint> points)
points
- the points to build the Kd tree frompublic KdTree(java.util.ArrayList<KdTreePoint> points, int sortIndex)
points
- the points to put in this treesortIndex
- the index of the splitMethod Detail |
---|
public KdTreePoint getNearest(KdTreePoint position)
position
- the position
public KdTreePoint getNearest(KdTreePoint position, KdTreePoint currentNearest, double currentDistance)
position
- the position we're looking for the nearest point tocurrentNearest
- the current nearest (or null at the start)currentDistance
- the distance of the current nearest from the target point
public static double distance(double[] p, double[] q)
p
- first pointq
- second point
public static void quickSort(java.util.ArrayList<KdTreePoint> points, int index, int start, int len)
points
- the values to sortindex
- the data associated with each point.start
- the start of the portion of the array to sortlen
- the length of the portion of the array to sort
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |