edu.stanford.math.plex4.kd
public class KDTree extends java.lang.Object
Constructor and Description |
---|
KDTree(double[][] dataPoints)
Constructor for initializing the KD-tree with a set of points.
|
Modifier and Type | Method and Description |
---|---|
gnu.trove.TIntHashSet |
epsilonNeighborhoodSearch(double[] queryPoint,
double epsilon,
boolean openNeighborhood)
This function finds all points within an open or closed neighborhood of the query point.
|
int |
nearestNeighborSearch(double[] queryPoint)
This function returns the index of the nearest neighbor to the query point.
|
public KDTree(double[][] dataPoints)
dataPoints
- public int nearestNeighborSearch(double[] queryPoint)
queryPoint
- the point to find the closest point topublic gnu.trove.TIntHashSet epsilonNeighborhoodSearch(double[] queryPoint, double epsilon, boolean openNeighborhood)
queryPoint
- the center of the ball to queryepsilon
- the radius of the ballopenNeighborhood
- true if the neighborhood is open and false otherwise