diff --git a/Heat_method_3/examples/Heat_method_3/README b/Heat_method_3/examples/Heat_method_3/README deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp b/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp index 993692647d7..3c93dc4f78b 100644 --- a/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp +++ b/Triangulation_3/examples/Triangulation_3/sequential_parallel.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include @@ -13,23 +14,42 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point; -const int NUM_INSERTED_POINTS = 10000; +const int NUM_INSERTED_POINTS = 1000000; -int main() +int main(int argc, char* argv[]) { - CGAL::Random_points_in_cube_3 rnd(1.); - - std::cerr << "Construction of a 3D Delaunay triangulation from a vector of " - << NUM_INSERTED_POINTS << " random points in a cube" << std::endl; + std::vector V; - V.reserve(NUM_INSERTED_POINTS); - for (int i = 0; i != NUM_INSERTED_POINTS; ++i) - V.push_back(*rnd++); + if(argc == 1){ + CGAL::Random_points_in_cube_3 rnd(1.); + + std::cerr << "Construction of a 3D Delaunay triangulation from a vector of " + << NUM_INSERTED_POINTS << " random points in a cube" << std::endl; + + V.reserve(NUM_INSERTED_POINTS); + for (int i = 0; i != NUM_INSERTED_POINTS; ++i) + V.push_back(*rnd++); + } else { + Point p; + std::ifstream in(argv[1]); + while(in >> p){ + V.push_back(p); + } + } // Sequential Delaunay T3 typedef CGAL::Delaunay_triangulation_3 SequentialTriangulation; CGAL::Real_timer t; + + + t.start(); + CGAL::spatial_sort(V.begin(), V.end()); + t.stop(); + std::cerr << "spatial sort " << t.time() << std::endl; + + t.reset(); + t.start(); SequentialTriangulation S(V.begin(), V.end()); t.stop(); @@ -46,8 +66,7 @@ int main() t.reset(); t.start(); // Construct the locking data-structure, using the bounding-box of the points - ParallelTriangulation::Lock_data_structure locking_ds( - CGAL::Bbox_3(-1., -1., -1., 1., 1., 1.), 50); + ParallelTriangulation::Lock_data_structure locking_ds(CGAL::bounding_box(V.begin(), V.end()).bbox(), 50); // Construct the triangulation in parallel ParallelTriangulation T(V.begin(), V.end(), &locking_ds); t.stop();