Priority queue for integer coordinates with squared distances as priority. More...
#include <bucketedqueue.h>
Public Member Functions | |
BucketPrioQueue () | |
Standard constructor. More... | |
bool | empty () |
Checks whether the Queue is empty. | |
void | push (int prio, INTPOINT t) |
push an element | |
INTPOINT | pop () |
return and pop the element with the lowest squared distance */ | |
Static Private Member Functions | |
static void | initSqrIndices () |
Private Attributes | |
int | count |
int | nextBucket |
std::vector< std::queue < INTPOINT > > | buckets |
Static Private Attributes | |
static std::vector< int > | sqrIndices |
static int | numBuckets |
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).
BucketPrioQueue::BucketPrioQueue | ( | ) |
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...