Exemplo n.º 1
0
int main()
{
    const int N = 10000000; // 10M
    CGAL::Real_timer timer;
    timer.start();
    std::vector<Point_3> points;
    points.reserve(N);
    CGAL::Random_points_in_sphere_3<Point_3> g( 100.0);
    CGAL::cpp11::copy_n( g, N, std::back_inserter(points));
    timer.stop();
    std::cout << "Fill vector: " << timer.time() << " sec" << std::endl;
    timer.reset();
    timer.start();
    int res=0;
    Predicate predicate;
    for(int j = 0; j < 10; ++j) {
        for(int i = 0; i < N-4; i++) {
            res += predicate(points[i], points[i+1], points[i+2], points[i+3]);
        }
    }
    timer.stop();
    std::cout << "result = " << res << std::endl;
#ifndef ONLY_TEST_COMPARISONS
    std::cout << "Orientation: ";
#else
    std::cout << "Comparisons: ";
#endif
    std::cout << timer.time() << " sec" << std::endl;
}
Exemplo n.º 2
0
int main(int, char** argv)
{
  Mesh m1,m2;
  std::ifstream input(argv[1]);
  input >> m1;
  input.close();

  input.open(argv[2]);
  input >> m2;

  std::cout << "First mesh has " << num_faces(m1) << " faces\n";
  std::cout << "Second mesh has " << num_faces(m2) << " faces\n";

  CGAL::Real_timer time;
  #if defined(CGAL_LINKED_WITH_TBB)
  time.start();
   std::cout << "Distance between meshes (parallel) "
             << PMP::approximate_Hausdorff_distance<CGAL::Parallel_tag>(
                  m1,m2,PMP::parameters::number_of_points_per_area_unit(4000))
             << "\n";
  time.stop();
  std::cout << "done in " << time.time() << "s.\n";
  #endif

  time.reset();
  time.start();
  std::cout << "Distance between meshes (sequential) "
            << PMP::approximate_Hausdorff_distance<CGAL::Sequential_tag>(
                 m1,m2,PMP::parameters::number_of_points_per_area_unit(4000))
            << "\n";
  time.stop();
  std::cout << "done in " << time.time() << "s.\n";

  general_tests<K>(m1,m2);

  test_concept();

  return 0;
}
Exemplo n.º 3
0
void start_timeout_watchdog()
{
  sTimeoutWatchdog.reset();
  sTimeoutWatchdog.start();  
  sHadTimedOut = false ;
}