
public final class KNNUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
KNNUtil.DistanceItr<D extends Distance<D>>
Proxy iterator for accessing DBIDs.
|
protected static class |
KNNUtil.DistanceView<D extends Distance<D>>
A view on the Distances of the result.
|
protected static class |
KNNUtil.KNNSubList<D extends Distance<D>>
Sublist of an existing result to contain only the first k elements.
|
| Modifier | Constructor and Description |
|---|---|
private |
KNNUtil()
Fake constructor: do not instantiate.
|
| Modifier and Type | Method and Description |
|---|---|
static <D extends Distance<D>> |
asDistanceList(KNNResult<D> list)
View as list of distances.
|
static <D extends Distance<D>> |
newHeap(D factory,
int k)
Create an appropriate heap for the distance function.
|
static <D extends Distance<D>> |
newHeap(DistanceFunction<?,D> df,
int k)
Create an appropriate heap for the distance function.
|
static <D extends Distance<D>> |
newHeap(DistanceQuery<?,D> df,
int k)
Create an appropriate heap for the distance function.
|
static <D extends Distance<D>> |
newHeap(KNNResult<D> exist)
Build a new heap from a given list.
|
static <D extends Distance<D>> |
subList(KNNResult<D> list,
int k)
Get a subset of the KNN result.
|
public static <D extends Distance<D>> KNNHeap<D> newHeap(DistanceFunction<?,D> df, int k)
D - distance typedf - Distance functionk - K valuepublic static <D extends Distance<D>> KNNHeap<D> newHeap(DistanceQuery<?,D> df, int k)
D - distance typedf - Distance functionk - K valuepublic static <D extends Distance<D>> KNNHeap<D> newHeap(D factory, int k)
D - distance typefactory - distance prototypek - K valuepublic static <D extends Distance<D>> KNNHeap<D> newHeap(KNNResult<D> exist)
D - Distance typeexist - Existing resultpublic static <D extends Distance<D>> List<D> asDistanceList(KNNResult<D> list)
D - distance typelist - Result to proxy