Parallel Plane Sweep  0.1
Shared memory multithreaded version of the plane sweep algorithm
parPlaneSweep.h File Reference
#include "halfsegment.h"
#include <vector>

Go to the source code of this file.


void parallelOverlay (vector< halfsegment > &r1, vector< halfsegment > &r2, vector< halfsegment > &result, int numSplits=-1, int numWorkerThreads=-1)
void overlayPlaneSweep (const halfsegment r1[], int r1Size, const halfsegment r2[], int r2Size, vector< halfsegment > &result)

Detailed Description

Header file containing the necessary function prototypes for the parallel plane sweep and the serial plane sweep algorithms.

Also contains some helper functions.

Definition in file parPlaneSweep.h.

Function Documentation

void overlayPlaneSweep ( const halfsegment  r1[],
int  r1Size,
const halfsegment  r2[],
int  r2Size,
vector< halfsegment > &  result 

Compute the overlay of halfsegments given in two input vectors. Uses the plane sweep algorithm. This is the serial plane sweep algorithm, it is called by parallelOverlay(). parallelOverlay() sets up the strips, then calls this over each strip. The implementation of this function can be switched with any plane sweep style algorithm.

r1a vector of halfsegments
r2a vector of halfsegments
r1Sizethe length of the r1 vector
r2Sizethe length of the r2 vector
result[in/out] the result of overlaying r1 and r2

See the prototype in parPlaneSweep.h

Definition at line 347 of file parPlaneSweep.cpp.

void parallelOverlay ( vector< halfsegment > &  r1,
vector< halfsegment > &  r2,
vector< halfsegment > &  result,
int  numStrips,
int  numWorkerThreads 

Compute the overlay of two regions in parallel. This is a wrapper function that divides a pair of input regions into strips, assigns halfsegments to the appropriate strips, then calls a plane sweep algorithm on each strip.

r1[in/out] input region 1
r2[in/out] input region 2
numSplitshow many strips should be created over the input. If no value is given, the number of strips defaults to the number of processor cores.
numWorkerThreadsThe number of worker threads for openMP to use. If no value is given, openMP's default value is used.

See the prototype in parPlaneSweep.h

Definition at line 247 of file parPlaneSweep.cpp.