class DoubleIntegerDBIDListKNNHeap extends DoubleIntegerDBIDKNNList implements KNNHeap
k
dists, 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, getKNNDistance
add, clear, contains, get, grow, isEmpty, iter, remove, removeSwap, reverse, size, sort, swap, truncate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clear, getK, getKNNDistance, isEmpty, size
get, iter
protected DoubleIntegerDBIDListKNNHeap(int k)
k
- K parameterprotected final void addInternal(double dist, int id)
addInternal
in class DoubleIntegerDBIDList
dist
- Distanceid
- Object IDprivate void insertionSort(double dist, int id)
dist
- New distanceid
- New idpublic double insert(double dist, DBIDRef id)
KNNHeap
public void add(double dist, DBIDRef id)
ModifiableDoubleDBIDList
add
in interface ModifiableDoubleDBIDList
add
in class DoubleIntegerDBIDList
dist
- Distance to addid
- DBID to addpublic void insert(DoubleDBIDPair e)
KNNHeap
public DoubleIntegerDBIDPair poll()
KNNHeap
KNNHeap.toKNNList()
.public DoubleIntegerDBIDPair peek()
KNNHeap
public KNNList toKNNList()
KNNHeap
KNNList
. This empties the heap!public String toString()
toString
in class DoubleIntegerDBIDKNNList
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.