diff --git a/Bounding_volumes/examples/Min_annulus_d/min_annulus_d.cpp b/Bounding_volumes/examples/Min_annulus_d/min_annulus_d.cpp index d02136e8426..15a4ee3f1f6 100644 --- a/Bounding_volumes/examples/Min_annulus_d/min_annulus_d.cpp +++ b/Bounding_volumes/examples/Min_annulus_d/min_annulus_d.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #ifdef CGAL_USE_GMP #include @@ -25,10 +26,10 @@ typedef CGAL::Min_annulus_d Min_annulus; int main() { // points on the squares [-1,1]^2 and [-2,2]^2 - Point P[8] = { Point(-1,-1), Point(-1,1), Point(1,-1), Point(1,1), - Point(-2,-2), Point(-2,2), Point(2,-2), Point(2,2)}; + std::array P = { Point(-1,-1), Point(-1,1), Point(1,-1), Point(1,1), + Point(-2,-2), Point(-2,2), Point(2,-2), Point(2,2)}; - Min_annulus ma(P, P+8); + Min_annulus ma(P.begin(), P.end()); assert (ma.is_valid()); // get center of annulus diff --git a/Bounding_volumes/examples/Min_annulus_d/min_annulus_d_fast_exact.cpp b/Bounding_volumes/examples/Min_annulus_d/min_annulus_d_fast_exact.cpp index 07bb660370b..8c4de47087e 100644 --- a/Bounding_volumes/examples/Min_annulus_d/min_annulus_d_fast_exact.cpp +++ b/Bounding_volumes/examples/Min_annulus_d/min_annulus_d_fast_exact.cpp @@ -11,6 +11,7 @@ typedef CGAL::Exact_integer ET; #include #include +#include // use an inexact kernel... typedef CGAL::Homogeneous K; @@ -24,10 +25,10 @@ typedef CGAL::Min_annulus_d Min_annulus; int main() { // points on the squares [-1,1]^2 and [-2,2]^2 - Point P[8] = { Point(-1,-1), Point(-1,1), Point(1,-1), Point(1,1), - Point(-2,-2), Point(-2,2), Point(2,-2), Point(2,2)}; + std::array P = { Point(-1,-1), Point(-1,1), Point(1,-1), Point(1,1), + Point(-2,-2), Point(-2,2), Point(2,-2), Point(2,2)}; - Min_annulus ma(P, P+8); + Min_annulus ma(P.begin(), P.end()); assert (ma.is_valid()); // get center of annulus diff --git a/Bounding_volumes/examples/Min_circle_2/min_circle_2.cpp b/Bounding_volumes/examples/Min_circle_2/min_circle_2.cpp index e45b00c7b87..a3fcbfa7c4d 100644 --- a/Bounding_volumes/examples/Min_circle_2/min_circle_2.cpp +++ b/Bounding_volumes/examples/Min_circle_2/min_circle_2.cpp @@ -4,6 +4,7 @@ #include #include +#include typedef CGAL::Simple_cartesian K; typedef CGAL::Min_sphere_of_points_d_traits_2 Traits; @@ -14,14 +15,14 @@ int main( int, char**) { const int n = 100; - Point P[n]; + std::array P; CGAL::Random r; // random number generator for ( int i = 0; i < n; ++i){ - P[ i] = Point(r.get_double(), r.get_double()); + P.at(i) = Point(r.get_double(), r.get_double()); } - Min_circle mc( P, P+n); + Min_circle mc( P.begin(), P.end()); Min_circle::Cartesian_const_iterator ccib = mc.center_cartesian_begin(), ccie = mc.center_cartesian_end(); std::cout << "center:"; diff --git a/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp b/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp index 238887de2e4..4cdc3a56d57 100644 --- a/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp +++ b/Bounding_volumes/examples/Min_circle_2/min_circle_homogeneous_2.cpp @@ -3,6 +3,7 @@ #include #include +#include #include // typedefs @@ -16,15 +17,15 @@ int main( int, char**) { const int n = 100; - Point P[n]; + std::array P; for ( int i = 0; i < n; ++i){ - P[i] = Point( (i%2 == 0 ? i : -i), 0, 1); + P.at(i) = Point( (i%2 == 0 ? i : -i), 0, 1); // (0,0), (-1,0), (2,0), (-3,0), ... } - Min_circle mc1( P, P+n, false); // very slow - Min_circle mc2( P, P+n, true); // fast + Min_circle mc1( P.begin(), P.end(), false); // very slow + Min_circle mc2( P.begin(), P.end(), true); // fast CGAL::IO::set_pretty_mode( std::cout); std::cout << mc2; diff --git a/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp b/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp index a5f5935e5b4..6012d079933 100644 --- a/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp +++ b/Bounding_volumes/examples/Min_ellipse_2/min_ellipse_2.cpp @@ -4,6 +4,7 @@ #include #include +#include typedef CGAL::Exact_rational NT; typedef CGAL::Cartesian K; @@ -16,20 +17,20 @@ int main( int, char**) { const int n = 200; - Point P[n]; + std::array P; for ( int i = 0; i < n; ++i) - P[ i] = Point( i % 2 ? i : -i , 0); + P.at(i) = Point( i % 2 ? i : -i , 0); // (0,0), (-1,0), (2,0), (-3,0) std::cout << "Computing ellipse (without randomization)..."; std::cout.flush(); - Min_ellipse me1( P, P+n, false); // very slow + Min_ellipse me1( P.begin(), P.end(), false); // very slow std::cout << "done." << std::endl; std::cout << "Computing ellipse (with randomization)..."; std::cout.flush(); - Min_ellipse me2( P, P+n, true); // fast + Min_ellipse me2( P.begin(), P.end(), true); // fast std::cout << "done." << std::endl; // because all input points are collinear, the ellipse is diff --git a/Bounding_volumes/examples/Min_sphere_d/min_sphere_3.cpp b/Bounding_volumes/examples/Min_sphere_d/min_sphere_3.cpp index 32e92903271..9c2a5222ef1 100644 --- a/Bounding_volumes/examples/Min_sphere_d/min_sphere_3.cpp +++ b/Bounding_volumes/examples/Min_sphere_d/min_sphere_3.cpp @@ -5,6 +5,7 @@ #include #include +#include typedef CGAL::Simple_cartesian K; typedef CGAL::Min_sphere_of_points_d_traits_3 Traits; @@ -16,16 +17,16 @@ const int d = 3; // dimension of points int main () { - Point P[n]; // n points + std::array P; // n points CGAL::Random r; // random number generator for (int i=0; i #include +#include typedef CGAL::Homogeneous K; typedef CGAL::Min_sphere_annulus_d_traits_3 Traits; @@ -16,14 +17,14 @@ int main () { const int n = 10; // number of points - Point P[n]; // n points + std::array P; // n points CGAL::Random r; // random number generator for (int i=0; i