Skip to content

Commit d800692

Browse files
committed
Add simple benchmark
1 parent b1c09b9 commit d800692

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Created by the script cgal_create_cmake_script
2+
# This is the CMake script for compiling a CGAL application.
3+
4+
5+
project( Spatial_sorting_ )
6+
7+
cmake_minimum_required(VERSION 2.6.2)
8+
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
9+
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
10+
cmake_policy(VERSION 2.8.4)
11+
else()
12+
cmake_policy(VERSION 2.6)
13+
endif()
14+
endif()
15+
16+
find_package(CGAL QUIET COMPONENTS Core )
17+
18+
if ( CGAL_FOUND )
19+
20+
include( ${CGAL_USE_FILE} )
21+
22+
include( CGAL_CreateSingleSourceCGALProgram )
23+
24+
include_directories (BEFORE "../../include")
25+
26+
create_single_source_cgal_program( "simple.cpp" )
27+
28+
else()
29+
30+
message(STATUS "This program requires the CGAL library, and will not be compiled.")
31+
32+
endif()
33+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
//#define CGAL_PROFILE
2+
//#define CGAL_USE_SSE2_FABS
3+
//#define CGAL_USE_SSE2_MAX
4+
//#define CGAL_MSVC_USE_STD_FABS // use this one with precise
5+
#define CGAL_DONT_USE_INDEPENDENT_SHUFFLE 1
6+
7+
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
8+
9+
10+
#include <CGAL/Delaunay_triangulation_3.h>
11+
12+
13+
#include <CGAL/Timer.h>
14+
#include <iostream>
15+
16+
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
17+
typedef CGAL::Delaunay_triangulation_3<K> DT;
18+
typedef K::Point_3 Point_3;
19+
typedef CGAL::Timer Timer;
20+
21+
int main()
22+
{
23+
24+
std::vector<Point_3> points;
25+
Point_3 p;
26+
27+
while(std::cin >> p){
28+
points.push_back(p);
29+
}
30+
Timer timer;
31+
timer.start();
32+
int N = 0;
33+
for(int i = 0; i < 5; i++){
34+
spatial_sort(points.begin(), points.end());
35+
}
36+
timer.stop();
37+
38+
std::cerr << timer.time() << " sec" << std::endl;
39+
return 0;
40+
}

Spatial_sorting/dont_submit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
benchmark

0 commit comments

Comments
 (0)