
D - Distance functionpublic interface KNNHeap<D extends Distance<D>>
DBIDUtil.newHeap(D, int)!| Modifier and Type | Method and Description | 
|---|---|
void | 
add(D distance,
   DBIDRef id)
Add a distance-id pair to the heap unless the distance is too large. 
 | 
void | 
clear()
Clear the heap. 
 | 
int | 
getK()
Get the K parameter ("maxsize" internally). 
 | 
D | 
getKNNDistance()
Get the distance to the k nearest neighbor, or maxdist otherwise. 
 | 
boolean | 
isEmpty()
Test if the heap is empty. 
 | 
DistanceDBIDPair<D> | 
peek()
Peek at the largest element in the heap. 
 | 
DistanceDBIDPair<D> | 
poll()
Poll the largest element from the heap. 
 | 
int | 
size()
Current size of heap. 
 | 
KNNList<D> | 
toKNNList()
Serialize to a  
KNNList. | 
KNNList<D> toKNNList()
KNNList. This empties the heap!int getK()
D getKNNDistance()
void add(D distance, DBIDRef id)
distance - Distance valueid - ID numberint size()
boolean isEmpty()
void clear()
DistanceDBIDPair<D> poll()
toKNNList().DistanceDBIDPair<D> peek()