proj home

Files   Classes   Functions   Hierarchy  

quickhull2Drandomized< PT, D > Class Template Reference

Input to quickhull algorithm is shuffled. More...

#include <quickhull2D.h>

Collaboration diagram for quickhull2Drandomized< PT, D >:

List of all members.

Public Member Functions

 quickhull2Drandomized (vector< PT > const &pts_)
 Compute the convex hull of the point pts.

Public Attributes

vector< PT > const & pts
 Global points.
vector< uintboundary
 Points on the hull.


Detailed Description

template<typename PT, typename D>
class quickhull2Drandomized< PT, D >

Input to quickhull algorithm is shuffled.

O(nlogn) expected complexity in time.

Example
vector<pt2> pts;
//fill pts, then calculate the hull.
quickhull2Drandomized qh(pts);

Definition at line 71 of file quickhull2D.h.


Constructor & Destructor Documentation

template<typename PT , typename D >
quickhull2Drandomized< PT, D >::quickhull2Drandomized ( vector< PT > const &  pts_  )  [inline]

Compute the convex hull of the point pts.

Definition at line 210 of file quickhull2D.h.

References quickhull2D< PT, D >::boundary, pts, and vectorshuffle().

00213   : pts(pts_)
00214 {
00215   vector<uint> index;
00216   vector<PT> pts2(pts.begin(),pts.end());
00217   vectorshuffle(pts2,index);
00218   quickhull2D<PT,D> qh(pts2);
00219   uintc n=qh.boundary.size();
00220   boundary.resize(n);
00221   for (uint i=0; i<n; ++i)
00222     boundary[i] = index[qh.boundary[i]];
00223 }


Member Data Documentation

template<typename PT, typename D>
vector< uint > quickhull2Drandomized< PT, D >::boundary

Points on the hull.

Definition at line 79 of file quickhull2D.h.

Referenced by quickhull2Dtest::test05().

template<typename PT, typename D>
vector<PT> const& quickhull2Drandomized< PT, D >::pts

Global points.

Definition at line 76 of file quickhull2D.h.


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:11 2011 for Chelton Evans Source by  doxygen 1.5.8