diff --git a/Packages/Snap_rounding_2/demo/Snap_rounding_2/demo_kd_trees.C b/Packages/Snap_rounding_2/demo/Snap_rounding_2/demo_kd_trees.C index dc797cdfdd3..c5fea912461 100644 --- a/Packages/Snap_rounding_2/demo/Snap_rounding_2/demo_kd_trees.C +++ b/Packages/Snap_rounding_2/demo/Snap_rounding_2/demo_kd_trees.C @@ -84,14 +84,14 @@ int main(int argc,char *argv[]) read_data(argv,prec,seg_list); for(int i = 1;i < 11;++i) { - std::cout << " kd trees parameter is " << i << std::endl; + std::cout << "Input number of kd trees : " << i << std::endl; CGAL::Timer t; t.start(); CGAL::snap_rounding_2::const_iterator, std::list > > (seg_list.begin(),seg_list.end(),output_list,prec,true,false,i); t.stop(); - std::cout << "*** time : " << t.time() << "\n\n"; + std::cout << "total time : " << t.time() << "\n\n"; } delete(is_ptr); diff --git a/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_2.h b/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_2.h index 8787a63e4db..9ac00e6e394 100644 --- a/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_2.h +++ b/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_2.h @@ -505,7 +505,6 @@ void Snap_rounding_2:: std::list subcurves; - // get intersection points (with endpoints) PointList mypointlist; @@ -681,7 +680,6 @@ void snap_rounding_2( InputIterator begin, InputIterator end, OutputContainer& output_container, - //std::list >& output_container, typename Rep_::FT pixel_size, bool do_isr = true, bool int_output = true, @@ -690,6 +688,7 @@ void snap_rounding_2( std::list > seg_list; Multiple_kd_tree *> *mul_kd_tree; + output_container.clear(); // copy segments list while(begin != end) { seg_list.push_back(Segment_data(begin->source(), diff --git a/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h b/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h index 1fee48c403f..4259efb4d5c 100644 --- a/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h +++ b/Packages/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h @@ -325,15 +325,31 @@ public: check_kd(kd_counter,number_of_trees,seg_list,directions); int ind = 0; + +#ifdef KD_DEBUG + int number_of_actual_kd_trees = 0; +#endif + for(NT angle = 0;angle < half_pi;angle += half_pi / number_of_trees) { if(kd_counter[ind] >= (double)number_of_segments / (double)number_of_trees / 2.0) { kd = create_kd_tree(angle); kd_trees_list.push_back(kd); + +#ifdef KD_DEBUG + ++number_of_actual_kd_trees; +#endif + } ++ind; } + +#ifdef KD_DEBUG + std::cout << "Actual number of kd-trees created : " << + number_of_actual_kd_trees << std::endl; +#endif + } Point_2 small_x_point(Point_2 p1,Point_2 p2)