public class KDTree
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
KDTree.KDNode |
Constructor and Description |
---|
KDTree(int dims) |
Modifier and Type | Method and Description |
---|---|
KDTree.KDNode |
delete(org.nd4j.linalg.api.ndarray.INDArray point) |
void |
insert(org.nd4j.linalg.api.ndarray.INDArray point)
Insert a point in to the tree
|
java.util.List<Pair<java.lang.Double,org.nd4j.linalg.api.ndarray.INDArray>> |
knn(org.nd4j.linalg.api.ndarray.INDArray point,
double distance) |
Pair<java.lang.Double,org.nd4j.linalg.api.ndarray.INDArray> |
nn(org.nd4j.linalg.api.ndarray.INDArray point)
Query for nearest neighbor.
|
int |
size()
The number of elements in the tree
|
public static final int GREATER
public static final int LESS
public void insert(org.nd4j.linalg.api.ndarray.INDArray point)
point
- the point to insertpublic KDTree.KDNode delete(org.nd4j.linalg.api.ndarray.INDArray point)
public java.util.List<Pair<java.lang.Double,org.nd4j.linalg.api.ndarray.INDArray>> knn(org.nd4j.linalg.api.ndarray.INDArray point, double distance)
public Pair<java.lang.Double,org.nd4j.linalg.api.ndarray.INDArray> nn(org.nd4j.linalg.api.ndarray.INDArray point)
point
- the point to query forpublic int size()