Modifier and Type | Class and Description |
---|---|
private class |
DistanceDBIDPairKNNList.Itr
Iterator.
|
Modifier and Type | Field and Description |
---|---|
private Object[] |
data
The actual data array.
|
private int |
k
The value of k this was materialized for.
|
Modifier | Constructor and Description |
---|---|
|
DistanceDBIDPairKNNList(Heap<? extends DistanceDBIDPair<D>> heap,
int k)
Constructor.
|
protected |
DistanceDBIDPairKNNList(KNNHeap<D> heap)
Constructor, to be called from KNNHeap only.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(DBIDRef o)
Test whether an ID is contained.
|
DistanceDBIDPair<D> |
get(int index)
Direct object access.
|
int |
getK()
Get the K parameter (note: this may be less than the size of the list!)
|
D |
getKNNDistance()
Get the distance to the k nearest neighbor, or maxdist otherwise.
|
boolean |
isEmpty()
Test for an empty DBID collection.
|
DistanceDBIDListIter<D> |
iter()
Get an iterator
|
int |
size()
Size
|
String |
toString() |
private final int k
private final Object[] data
protected DistanceDBIDPairKNNList(KNNHeap<D> heap)
KNNHeap.toKNNList()
instead!heap
- Calling heappublic DistanceDBIDPairKNNList(Heap<? extends DistanceDBIDPair<D>> heap, int k)
KNNHeap.toKNNList()
instead!heap
- Calling heapk
- K valuepublic int getK()
KNNList
public D getKNNDistance()
KNNList
getKNNDistance
in interface KNNList<D extends Distance<D>>
public DistanceDBIDPair<D> get(int index)
KNNList
public DistanceDBIDListIter<D> iter()
DistanceDBIDList
public int size()
KNNList
public boolean contains(DBIDRef o)
DBIDs