proj home

Files   Classes   Functions   Hierarchy  

main.cpp

Go to the documentation of this file.
00001 #include <cassert>
00002 #include <iostream>
00003 using namespace std;
00004 
00005 #include <commandline.h>
00006 #include <quickhull2Dtest.h>
00007 #include <quickhull3Dtest.h>
00008 #include <typedefs.h>
00009 #include <zero.h>
00010 
00011 template<>
00012 double zero<double>::val = 1E-10;
00013 
00014 
00015 int main(int argc, char** argv)
00016 {
00017   commandline cmd(argc,argv);
00018   uint prog(0);
00019   cmd.mapvar(prog,"prog");
00020 
00021   switch (prog)
00022   {
00023     case 0:
00024 
00025       cout << "Generate 2D points and find and display the convex hull." << endl;
00026       cout << "  ./main prog=2 pointsfile=data.txt numPoints=300" << endl;
00027       cout << "Generates random 2D points in unit circle and writes them to a file." << endl;
00028       cout << "  ./main prog=4 pointsfile=data.txt numPoints=30" << endl;
00029 
00030       cout << "Calculate the Convex hull of a set of 2D points." << endl;
00031       cout << "  Read file of points, writes the hull indexes." << endl;
00032       cout << "  Optional randomize to guarantee O(nlogn) time complexity." << endl;
00033 
00034       cout << "  ./main prog=5 pointsfile=data.txt hullfile=hull.txt randomize" << endl;
00035 
00036       cout << "Display the convex hull and points by reading in the points and hull indexes." << endl;
00037       cout << "  ./main prog=6 pointsfile=data.txt hullfile=hull.txt" << endl;
00038       cout << "Quickhull 3D Algorithm (Experiment)" << endl;
00039       cout << "  ./main prog=11 n=40" << endl;
00040 
00041       break;
00042 
00043     case 2: quickhull2Dtest().test02(argc,argv); break;
00044     case 3: quickhull2Dtest::test03(); break;
00045     case 4: quickhull2Dtest::test04(argc,argv); break;
00046     case 5: quickhull2Dtest::test05(argc,argv); break;
00047     case 6: quickhull2Dtest().test06(argc,argv); break;
00048 
00049     case 11: quickhull3Dtest().test01(argc,argv); break;
00050     //case 12: quickhull3Dtest().test02(argc,argv); break;
00051 
00052     default: cout << "error:  No case handled." << endl; return 1;
00053   }
00054 
00055   return 0;
00056 }
00057 
00058 

Generated on Fri Mar 4 00:49:25 2011 for Chelton Evans Source by  doxygen 1.5.8