public class KDTree<T>
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
KDTree.KDNode<T>
KD node associated with a node on a KD-Tree
|
Constructor and Description |
---|
KDTree(int dim,
java.util.List<T> list,
KDComparator<T> comp)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(T value)
Checks if the tree contains the supplied value
|
T |
nearestNeighbourSearch(T pnt,
double tol)
Nearest Neighbour search
|
java.util.ArrayList<T> |
nearestNeighbourSearch(T pnt,
int K,
double tol)
K Nearest Neighbour search
|
public KDTree(int dim, java.util.List<T> list, KDComparator<T> comp)
public boolean contains(T value)
public java.util.ArrayList<T> nearestNeighbourSearch(T pnt, int K, double tol)
pnt
- point to find neighbors of.K
- Number of neighbors to retrieve. Can return more than K,
if last nodes are equal distances.tol
- tolerance for located neighbors