diff --git a/Generator/include/CGAL/Random_convex_set_traits_2.h b/Generator/include/CGAL/Random_convex_set_traits_2.h index 0d155acf5b3..84f3e7ad0bc 100644 --- a/Generator/include/CGAL/Random_convex_set_traits_2.h +++ b/Generator/include/CGAL/Random_convex_set_traits_2.h @@ -29,7 +29,7 @@ CGAL_BEGIN_NAMESPACE template < class Kernel > -struct Random_convex_set_traits_2 { +struct Random_convex_set_traits_2 : public Kernel { typedef typename Kernel::Point_2 Point_2; typedef typename Kernel::Direction_2 Direction_2; diff --git a/Generator/include/CGAL/random_convex_set_2.h b/Generator/include/CGAL/random_convex_set_2.h index ecd4fba74f0..ac5e8537f56 100644 --- a/Generator/include/CGAL/random_convex_set_2.h +++ b/Generator/include/CGAL/random_convex_set_2.h @@ -30,6 +30,7 @@ #include #include #include +#include CGAL_BEGIN_NAMESPACE @@ -73,10 +74,7 @@ random_convex_set_2( int n, CGAL::copy_n( pg, n, back_inserter( points)); // compute centroid of points: - Point_2 centroid( - scale( - accumulate( points.begin(), points.end(), t.origin(), Sum()), - FT( 1) / FT( n))); + Point_2 centroid = CGAL::centroid( points.begin(), points.end(), t ); // translate s.t. centroid == origin: transform( @@ -94,10 +92,7 @@ random_convex_set_2( int n, points.begin(), points.end(), points.begin(), Sum()); // and compute its centroid: - Point_2 new_centroid( - scale( - accumulate( points.begin(), points.end(), t.origin(), Sum()), - FT( 1) / FT( n))); + Point_2 new_centroid = CGAL::centroid( points.begin(), points.end(), t ); // translate s.t. centroids match: transform(