// Test of closest pair algorithms // David Eppstein, UC Irvine, 19 Apr 1997 // // Generate points in generalized Sierpinski tetrahedron // // Each point is generated from some set S of k random binary numbers // by taking exclusive ors of each of the 2^(k-1)-1 nonempty subsets of S. // For k=2, d=3 this produces the well-known fractal Sierpinski tetrahedron. // For higher k this should again produce well-structured point sets. // // Distance is measured using (squared) Euclidean distance #include "PointSet.h" class SierpinskiTetrahedron : public PointSet { double * points; // n*d array of 3d coordinates int d; public: SierpinskiTetrahedron(unsigned long npoints, int d); ~SierpinskiTetrahedron() { delete points; } double operator() (point i, point j); void interact(point, point); };