public interface DoubleLongHeap
Modifier and Type | Interface and Description |
---|---|
static interface |
DoubleLongHeap.UnsortedIter
Unsorted iterator - in heap order.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double key,
long val)
Add a key-value pair to the heap
|
void |
add(double key,
long val,
int k)
Add a key-value pair to the heap if it improves the top.
|
void |
clear()
Clear the heap contents.
|
boolean |
containsKey(double q)
Contains operation for a key (slow: with a linear scan).
|
boolean |
containsValue(long q)
Contains operation for a value (slow: with a linear scan).
|
boolean |
isEmpty()
Is the heap empty?
|
double |
peekKey()
Get the current top key.
|
long |
peekValue()
Get the current top value.
|
void |
poll()
Remove the first element.
|
void |
replaceTopElement(double key,
long val)
Combined operation that removes the top element, and inserts a new element instead.
|
int |
size()
Query the size.
|
DoubleLongHeap.UnsortedIter |
unsortedIter()
Get an unsorted iterator to inspect the heap.
|
void add(double key, long val)
key
- Keyval
- Valuevoid add(double key, long val, int k)
key
- Keyval
- Valuek
- Desired maximum sizevoid replaceTopElement(double key, long val)
key
- Key of new elementval
- Value of new elementdouble peekKey()
long peekValue()
boolean containsKey(double q)
q
- Keytrue
if the key is contained in the heap.boolean containsValue(long q)
q
- Valuetrue
if the value is contained in the heap.void poll()
void clear()
int size()
boolean isEmpty()
true
when the size is 0.DoubleLongHeap.UnsortedIter unsortedIter()
Copyright © 2019 ELKI Development Team. License information.