From a89b28a05365686439758191f924ae3149df2007 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 30 May 2012 15:30:18 +0000 Subject: [PATCH 1/4] Add Compute_determinant_[23] to the Kernel concept --- Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex index f151ea7f43a..f23657e82dd 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex @@ -198,6 +198,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccNestedType{Compute_squared_radius_2}{a model of \ccc{Kernel::ComputeSquaredRadius_2}} \ccGlue \ccNestedType{Compute_area_2}{a model of \ccc{Kernel::ComputeArea_2}} +\ccGlue +\ccNextedType{Compute_determinant_2}{a model of \ccc{Kernel::ComputeDeterminant_2}} \ccHeading{Generalized Predicates} @@ -443,6 +445,8 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccGlue \ccNestedType{Compute_approximate_area_3}{a model of \ccc{Kernel::ComputeApproximateArea_3}} \ccGlue +\ccNextedType{Compute_determinant_3}{a model of \ccc{Kernel::ComputeDeterminant_3}} +\ccGlue \ccNestedType{Compute_squared_distance_3}{a model of \ccc{Kernel::ComputeSquaredDistance_3}} \ccGlue \ccNestedType{Compute_squared_length_3}{a model of \ccc{Kernel::ComputeSquaredLength_3}} From cf9a4e8742272feff7f1d72d0607c80c5c444947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 30 May 2012 16:06:57 +0000 Subject: [PATCH 2/4] update benchmark --- .../benchmark/Convex_hull_2/static_ch2.cpp | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp b/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp index 5b3df569ec7..ec1a19499de 100644 --- a/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp +++ b/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp @@ -12,14 +12,14 @@ #include -#define bench(METHOD) \ +#define bench(METHOD,CONTAINER) \ {\ unsigned run=0;\ CGAL::Timer time;\ do{\ result.clear();\ time.start();\ - METHOD( points.begin(), points.end(), std::back_inserter(result) );\ + METHOD( CONTAINER.begin(), CONTAINER.end(), std::back_inserter(result) );\ time.stop();\ }while(++run pt_list; + std::copy(points.begin(),points.end(),std::back_inserter(pt_list)); + std::cout << "Using list" << std::endl; + bench(CGAL::convex_hull_2,pt_list) + } } From 6b51332818ae3cdf7da4708d4a453a18837e980b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 31 May 2012 12:59:50 +0000 Subject: [PATCH 3/4] add code to benchmark to test specific situations --- .../benchmark/Convex_hull_2/static_ch2.cpp | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp b/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp index ec1a19499de..8dd3d98795c 100644 --- a/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp +++ b/Convex_hull_2/benchmark/Convex_hull_2/static_ch2.cpp @@ -14,6 +14,7 @@ #define bench(METHOD,CONTAINER) \ {\ + std::size_t previous=0;\ unsigned run=0;\ CGAL::Timer time;\ do{\ @@ -21,6 +22,8 @@ time.start();\ METHOD( CONTAINER.begin(), CONTAINER.end(), std::back_inserter(result) );\ time.stop();\ + if( previous!=0 && previous!=result.size()) std::cerr << "error got different result" << std::endl;\ + previous=result.size();\ }while(++run1) nbpts=atoi(argv[1]); + if (argc>2) repeat=atoi(argv[2]); if (argc>3) seed=atoi(argv[3]); @@ -46,6 +50,38 @@ int main(int argc, char** argv) CGAL::Random_points_in_disc_2 g( 150.0,r); CGAL::cpp0x::copy_n( g, nbpts, std::back_inserter(points)); + //the following code is for testing when there is only two extreme points, affine hull is 2D + /* + CGAL::Bbox_2 bbox=points.begin()->bbox(); + for (Points::iterator it=points.begin();it!=points.end();++it) + bbox=bbox+it->bbox(); + + points.push_back( Point_2(bbox.xmin()-1,bbox.ymin()-1) ); + points.push_back( Point_2(bbox.xmax()+1,bbox.ymax()+1) ); + */ + + //the following code is for testing when there is only three extreme points + /* + CGAL::Bbox_2 bbox=points.begin()->bbox(); + for (Points::iterator it=points.begin();it!=points.end();++it) + bbox=bbox+it->bbox(); + + points.push_back( Point_2(bbox.xmin()-1,bbox.ymin()-1) ); + points.push_back( Point_2(bbox.xmax()+1,bbox.ymax()+1) ); + points.push_back( Point_2(bbox.xmax(),bbox.ymax()+2) ); + */ + + //the following code is for testing when there is only two extreme points, affine hull is 1D + /* + points.clear(); + for (unsigned i=0;i Date: Thu, 31 May 2012 17:22:53 +0000 Subject: [PATCH 4/4] Fix a typo --- Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex index f23657e82dd..03c4bf3d933 100644 --- a/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex +++ b/Kernel_23/doc_tex/Kernel_23_ref/Kernel.tex @@ -199,7 +199,7 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccGlue \ccNestedType{Compute_area_2}{a model of \ccc{Kernel::ComputeArea_2}} \ccGlue -\ccNextedType{Compute_determinant_2}{a model of \ccc{Kernel::ComputeDeterminant_2}} +\ccNestedType{Compute_determinant_2}{a model of \ccc{Kernel::ComputeDeterminant_2}} \ccHeading{Generalized Predicates} @@ -445,7 +445,7 @@ If the result type is a number type, the prefix is \ccc{Compute_}: \ccGlue \ccNestedType{Compute_approximate_area_3}{a model of \ccc{Kernel::ComputeApproximateArea_3}} \ccGlue -\ccNextedType{Compute_determinant_3}{a model of \ccc{Kernel::ComputeDeterminant_3}} +\ccNestedType{Compute_determinant_3}{a model of \ccc{Kernel::ComputeDeterminant_3}} \ccGlue \ccNestedType{Compute_squared_distance_3}{a model of \ccc{Kernel::ComputeSquaredDistance_3}} \ccGlue