
class DoubleIntegerDBIDListKNNHeap extends DoubleIntegerDBIDKNNList implements KNNHeap
kdists, ids, size| Modifier | Constructor and Description |
|---|---|
protected |
DoubleIntegerDBIDListKNNHeap(int k)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(double dist,
DBIDRef id)
Add an object to this result.
|
protected void |
addInternal(double dist,
int id)
Add a new element to the heap/list.
|
void |
insert(DoubleDBIDPair e)
Add a distance-id pair to the heap unless the distance is too large.
|
double |
insert(double dist,
DBIDRef id)
Add a distance-id pair to the heap unless the distance is too large.
|
private void |
insertionSort(double dist,
int id)
Insertion sort a single object.
|
DoubleIntegerDBIDPair |
peek()
Peek at the largest element in the heap.
|
DoubleIntegerDBIDPair |
poll()
Poll the largest element from the heap.
|
KNNList |
toKNNList()
Serialize to a
KNNList. |
String |
toString() |
getK, getKNNDistanceadd, clear, contains, get, grow, isEmpty, iter, remove, removeSwap, reverse, size, sort, swap, truncateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, getK, getKNNDistance, isEmpty, sizeget, iterprotected DoubleIntegerDBIDListKNNHeap(int k)
k - K parameterprotected final void addInternal(double dist,
int id)
addInternal in class DoubleIntegerDBIDListdist - Distanceid - Object IDprivate void insertionSort(double dist,
int id)
dist - New distanceid - New idpublic double insert(double dist,
DBIDRef id)
KNNHeappublic void add(double dist,
DBIDRef id)
ModifiableDoubleDBIDListadd in interface ModifiableDoubleDBIDListadd in class DoubleIntegerDBIDListdist - Distance to addid - DBID to addpublic void insert(DoubleDBIDPair e)
KNNHeappublic DoubleIntegerDBIDPair poll()
KNNHeapKNNHeap.toKNNList().public DoubleIntegerDBIDPair peek()
KNNHeappublic KNNList toKNNList()
KNNHeapKNNList. This empties the heap!public String toString()
toString in class DoubleIntegerDBIDKNNListCopyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.