Parallel Plane Sweep
0.1
Shared memory multithreaded version of the plane sweep algorithm
|
A vector-based implementation of a plane sweep event queue. More...
#include <vectorAlEq.h>
Public Member Functions | |
void | insert (const halfsegment &h1) |
bool | peek (halfsegment &h1) |
bool | pop () |
int | size () |
void | print () |
A vector-based implementation of a plane sweep event queue.
This is an event queue implemented on top of an STL vector
It is pretty basic. It simply pops from the front of the vector, and does an insertion sort-style insert.
This implementation was used to compare the cache behavior of a vector based plane sweep implementation with an avl tree based implementation.
As expected, the vector based has very good cache behavior (low miss rate), but has quadratic time complexity. The AVL tree implementation has a bad cache miss rate (often upwards of 20 percent miss rate on L2 cache), but a good time complexity
Definition at line 42 of file vectorAlEq.h.
|
inline |
insert into the event queue
uses an insertion sort-style insert. The queue is more like a priority queue, it is always sorted.
Definition at line 55 of file vectorAlEq.h.
|
inline |
Peek at the head of queue. return the halfsegment at the head of the queue, but do not remove it
h1 | [in/out] pass by reference. Will be set to the values of the halfsegment at the head of the queue. |
Definition at line 77 of file vectorAlEq.h.
|
inline |
Pop the element from the head of the queue.
Definition at line 89 of file vectorAlEq.h.
|
inline |
Print all elements in the queue (for debugging)
Definition at line 106 of file vectorAlEq.h.
|
inline |
Get the number of halfsegments in the queue
Definition at line 99 of file vectorAlEq.h.