#ifdef CGAL_USE_LEDA #include #include #include #include #include #include #include #include typedef leda_integer RT; typedef CGAL::Homogeneous_d Kernel; typedef CGAL::Delaunay_d Delaunay_d; typedef Delaunay_d::Point_d Point_d; typedef Delaunay_d::Lifted_hyperplane_d Hyperplane_d; typedef Delaunay_d::Sphere_d Sphere_d; typedef Delaunay_d::Simplex_handle Simplex_handle; typedef Delaunay_d::Vertex_handle Vertex_handle; typedef Delaunay_d::Facet_handle Facet_handle; template CGAL::Point_d random_point_in_range(int d,int l,int h, CGAL::Point_d) { std::vector V(d+1); V[d]=1; for(int i = 0; i(d,V.begin(),V.end()); } template void random_points_in_range(int n, int d,int l,int h, std::list< CGAL::Point_d >& L) { CGAL::Point_d dummy; for(int i = 0; i 1 && leda_string(argv[1])=="-h") { std::cout<<"usage: "< 1) dimension = atoi(argv[1]); if (argc > 2) n = atoi(argv[2]); if (argc > 3) m = atoi(argv[2]); Delaunay_d T(dimension); std::list L; random_points_in_range(n,dimension,-m,m,L); float ti = CGAL_LEDA_SCOPE::used_time(); int i=0; std::list::iterator it; for(it = L.begin(); it!=L.end(); ++it) { T.insert(*it); i++; if (i%10==0) std::cout << i << " points inserted" << std::endl; } std::cout << "used time for inserts " << CGAL_LEDA_SCOPE::used_time(ti) << std::endl; std::cout << "entering check" << std::endl; T.is_valid(); std::cout << "used time for sanity check " << CGAL_LEDA_SCOPE::used_time(ti) << std::endl; std::cout << "entering nearest neighbor location" << std::endl; L.clear(); random_points_in_range(n/10,dimension,-m,m,L); ti = CGAL_LEDA_SCOPE::used_time(); i = 0; for(it = L.begin(); it!=L.end(); ++it) { T.nearest_neighbor(*it); i++; if (i%10==0) std::cout << i << " points located" << std::endl; } std::cout << "used time for location " << CGAL_LEDA_SCOPE::used_time(ti) << std::endl; T.print_statistics(); CGAL_LEDA_SCOPE::print_statistics(); return 0; } #else #include int main() { std::cout << "this program requires LEDA" << std::endl; return 0; } #endif // CGAL_USE_LEDA