Priority queue for integer coordinates with squared distances as priority. More...
#include <bucketedqueue.h>
Public Member Functions | |
BucketPrioQueue () | |
Standard constructor. | |
bool | empty () |
Checks whether the Queue is empty. | |
INTPOINT | pop () |
return and pop the element with the lowest squared distance */ | |
void | push (int prio, INTPOINT t) |
push an element | |
Static Private Member Functions | |
static void | initSqrIndices () |
Private Attributes | |
std::vector< std::queue < INTPOINT > > | buckets |
int | count |
int | nextBucket |
Static Private Attributes | |
static int | numBuckets |
static std::vector< int > | sqrIndices |
Priority queue for integer coordinates with squared distances as priority.
A priority queue that uses buckets to group elements with the same priority. The individual buckets are unsorted, which increases efficiency if these groups are large. The elements are assumed to be integer coordinates, and the priorities are assumed to be squared euclidean distances (integers).
Definition at line 19 of file bucketedqueue.h.
Standard constructor.
Standard constructor. When called for the first time it creates a look up table that maps square distanes to bucket numbers, which might take some time...
Definition at line 11 of file bucketedqueue.cpp.
bool BucketPrioQueue::empty | ( | ) |
Checks whether the Queue is empty.
Definition at line 24 of file bucketedqueue.cpp.
void BucketPrioQueue::initSqrIndices | ( | ) | [static, private] |
Definition at line 63 of file bucketedqueue.cpp.
return and pop the element with the lowest squared distance */
Definition at line 46 of file bucketedqueue.cpp.
void BucketPrioQueue::push | ( | int | prio, |
INTPOINT | t | ||
) |
push an element
Definition at line 29 of file bucketedqueue.cpp.
std::vector<std::queue<INTPOINT> > BucketPrioQueue::buckets [private] |
Definition at line 42 of file bucketedqueue.h.
int BucketPrioQueue::count [private] |
Definition at line 39 of file bucketedqueue.h.
int BucketPrioQueue::nextBucket [private] |
Definition at line 40 of file bucketedqueue.h.
int BucketPrioQueue::numBuckets [static, private] |
Definition at line 38 of file bucketedqueue.h.
std::vector< int > BucketPrioQueue::sqrIndices [static, private] |
Definition at line 37 of file bucketedqueue.h.