[ 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/bucket_queue.hxx>`

Inheritance diagram for MappedBucketQueue< ValueType, PriorityFunctor, Ascending >:

List of all members.

## Public Member Functions

| MappedBucketQueue (unsigned int bucket_count=256, PriorityFunctor const &priority=PriorityFunctor())
| Create a queue with.
void | push (value_type const &v)
| Insert new element.

## Detailed Description

### template<class ValueType, class PriorityFunctor, bool Ascending = false>
class vigra::MappedBucketQueue< ValueType, PriorityFunctor, Ascending >

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/bucket_queue.hxx>
Namespace: vigra

## Constructor & Destructor Documentation

MappedBucketQueue | ( | unsigned int | bucket_count = `256`,
|  | PriorityFunctor const & | priority = `PriorityFunctor()`
| ) |  |

Create a queue with.

- bucket_count entries. Priorities will be computed by the `PriorityFunctor` given in
- priority (i.e. `priority(v)` must result in an integer, where `v` is an instance of `ValueType`).

## Member Function Documentation

void push | ( | value_type const & | v | ) |

Insert new element.

- v. Its priority is calculated by `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.

The documentation for this class was generated from the following file:

- vigra/bucket_queue.hxx

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany | html generated using doxygen and Python vigra 1.9.0 (Tue Nov 6 2012)