Parallel Plane Sweep  0.1
Shared memory multithreaded version of the plane sweep algorithm
main.cpp File Reference
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <cstdlib>
#include <algorithm>
#include "parPlaneSweep.h"
#include "d2hex.h"
#include <fstream>

Go to the source code of this file.


void tokenizeString (const std::string &str, std::vector< string > &tokens, const string &delimiters)
int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 

The main function provides examples of how to call the serial and parallel versions of the plane sweep algorithm. This code implements a O((n n) + (k k)) version of the algorithm, that returns a sorted list of halfsegments.

This particular function expects input in a hexadecimal format, and includes code to extract floating point numbers from exadecimal representation.

The command line arguments required are:

  • [an input hex file with region 1]
  • [an input hex file with region 2]
  • [the number of strips to begin running the program with]
  • [the number of strips to stop at]

The program repeatedly runs a plan sweep algorithm on the input with increasing numbers of strips. Strip counts increase quadratically.

Definition at line 53 of file main.cpp.

void tokenizeString ( const std::string &  str,
std::vector< string > &  tokens,
const string &  delimiters 

Function that tokenizes a string.

[in]strthe string to tokenize
[out]tokensa vecotr of string tokens
[in]delimitersA string consisting of delimiters on which to tokenize

Definition at line 191 of file main.cpp.