fix compilation errors in the benchmark

This commit is contained in:
Laurent Rineau 2025-09-09 20:20:19 +02:00
parent 4e455a510c
commit 826049ce84
1 changed files with 9 additions and 9 deletions

View File

@ -4,8 +4,6 @@
#include <CGAL/point_generators_2.h> #include <CGAL/point_generators_2.h>
#include <iostream> #include <iostream>
#include <fstream>
#include <string>
#include <vector> #include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
@ -27,27 +25,29 @@ int main(int argc, char **argv)
std::vector<Point> points; std::vector<Point> points;
points.reserve(n); points.reserve(n);
CGAL::Random_points_in_disc_2<Point,Creator> g(1); CGAL::Random_points_in_disc_2<Point,Creator> g(1);
CGAL::copy_n( g, n, std::back_inserter(points)); std::copy_n( g, n, std::back_inserter(points));
Delaunay original; Delaunay original;
original.insert(points.begin(),points.end()); original.insert(points.begin(),points.end());
double res=0; double res=0;
for (int r=0;r<rep;++r){ for (int r=0;r<rep;++r){
Delaunay delaunay=original; Delaunay delaunay=original;
std::vector<Vertex_handle> vertices; std::vector<Vertex_handle> vertices(delaunay.number_of_vertices());
for(FVI fvi = delaunay.finite_vertices_begin(); fvi != delaunay.finite_vertices_end();++fvi){ std::copy(delaunay.finite_vertex_handles().begin(),
vertices.push_back(fvi); delaunay.finite_vertex_handles().end(),
} vertices.begin());
CGAL::Timer t; CGAL::Timer t;
t.start(); t.start();
for (int k=0; k<vertices.size(); ++k) for (auto v : vertices) {
delaunay.remove(vertices[k]); delaunay.remove(v);
}
t.stop(); t.stop();
res+=t.time(); res+=t.time();
if (delaunay.number_of_vertices()!=0){ if (delaunay.number_of_vertices()!=0){
std::cerr << "ERROR"<< std::endl; std::cerr << "ERROR"<< std::endl;
return 1; return 1;
} }
std::cerr << r << " : " << t.time() << std::endl;
} }
std::cout << res/rep << std::endl; std::cout << res/rep << std::endl;