[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
MappedBucketQueue< ValueType, PriorityFunctor, Ascending > Class Template Reference |
Priority queue implemented using bucket sort (STL compatible). More...
#include <vigra/priority_queue.hxx>
Public Member Functions | |
MappedBucketQueue (unsigned int bucket_count=256, PriorityFunctor const &priority=PriorityFunctor()) | |
Create a queue with. More... | |
void | push (value_type const &v) |
Insert new element. More... | |
Public Member Functions inherited from BucketQueue< ValueType, Ascending > | |
BucketQueue (size_type bucket_count=256) | |
Create bucket queue with. More... | |
bool | empty () const |
Queue contains no elements. Equivalent to size() == 0 . | |
priority_type | maxIndex () const |
Maximum index (i.e. priority) allowed in this queue. Equivalent to bucket_count - 1 . | |
void | pop () |
Remove the current top element. | |
void | push (value_type const &v, priority_type priority) |
Insert new element. More... | |
size_type | size () const |
Number of elements in this queue. | |
const_reference | top () const |
The current top element. | |
priority_type | topPriority () const |
Priority of the current top element. | |
Priority queue implemented using bucket sort (STL compatible).
This template is compatible to std::priority_queue
, but uses a more efficient algorithm based on bucket sort. It us used like vigra::BucketQueue, but has an additional PriorityFunctor
which extracts the priority value of an element of type ValueType
. Thus functor is called within push
so that it does not need an extra argument.
#include <vigra/priority_queue.hxx>
Namespace: vigra
MappedBucketQueue | ( | unsigned int | bucket_count = 256 , |
PriorityFunctor const & | priority = PriorityFunctor() |
||
) |
Create a queue with.
PriorityFunctor
given in priority(v)
must result in an integer, where v
is an instance of ValueType
). void push | ( | value_type const & | v | ) |
Insert new element.
priority(v)
, where priority
is an instance of the PriorityFunctor
passed in the constructor. If the priority is outside the range [0, ..., bucket_count-1]
, it is clamped to the range borders.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|