public class CoverTree<T> extends Object implements PointIndex<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
CoverTree.CTStats |
| Modifier and Type | Method and Description |
|---|---|
void |
check() |
void |
clear()
Clear all entries.
|
boolean |
containsExact(double[] key) |
static <T> Point<T> |
create(double[] point,
T value) |
static <T> CoverTree<T> |
create(int nDims) |
static <T> CoverTree<T> |
create(int nDims,
double base,
PointDistanceFunction dist) |
static <T> CoverTree<T> |
create(Point<T>[] data,
double base,
PointDistanceFunction distFn) |
int |
getDepth() |
int |
getDims() |
int |
getNodeCount() |
CoverTree.CTStats |
getStats() |
void |
insert(double[] key,
T value)
Insert a point.
|
QueryIterator<? extends PointEntry<T>> |
iterator() |
QueryIterator<PointEntry<T>> |
query(double[] min,
double[] max) |
PointEntryDist<T> |
query1NN(double[] center)
Finds the nearest neighbor.
|
T |
queryExact(double[] point)
Lookup an entry, using exact match.
|
QueryIteratorKNN<PointEntryDist<T>> |
queryKNN(double[] center,
int k)
Finds the nearest neighbor.
|
T |
remove(double[] point)
Remove a point entry.
|
int |
size() |
String |
toString() |
String |
toStringTree() |
T |
update(double[] oldPoint,
double[] newPoint)
Update the position of an entry.
|
public static <T> Point<T> create(double[] point, T value)
public static <T> CoverTree<T> create(int nDims)
public static <T> CoverTree<T> create(int nDims, double base, PointDistanceFunction dist)
public static <T> CoverTree<T> create(Point<T>[] data, double base, PointDistanceFunction distFn)
public int getDims()
public void clear()
Indexpublic CoverTree.CTStats getStats()
public int getNodeCount()
getNodeCount in interface Index<T>public String toStringTree()
toStringTree in interface Index<T>public void insert(double[] key,
T value)
PointIndexinsert in interface PointIndex<T>key - pointvalue - valuepublic T remove(double[] point)
PointIndexremove in interface PointIndex<T>point - the pointpublic T update(double[] oldPoint, double[] newPoint)
PointIndexupdate in interface PointIndex<T>oldPoint - old positionnewPoint - new positionpublic T queryExact(double[] point)
PointIndexqueryExact in interface PointIndex<T>point - the pointpublic QueryIterator<? extends PointEntry<T>> iterator()
iterator in interface PointIndex<T>public QueryIterator<PointEntry<T>> query(double[] min, double[] max)
query in interface PointIndex<T>min - Lower left corner of the query windowmax - Upper right corner of the query windowpublic PointEntryDist<T> query1NN(double[] center)
PointIndexquery1NN in interface PointIndex<T>center - center pointpublic QueryIteratorKNN<PointEntryDist<T>> queryKNN(double[] center, int k)
PointIndexqueryKNN in interface PointIndex<T>center - center pointk - number of neighborspublic boolean containsExact(double[] key)
public void check()
Copyright © 2018. All rights reserved.