From e88dc6f1ec2fef087da4e821f25e371b8a37b845 Mon Sep 17 00:00:00 2001 From: Oren Salzman Date: Wed, 1 Jun 2011 08:34:29 +0000 Subject: [PATCH] updated examples after efi's comments --- .../Arrangement_on_surface_2/rational_functions.cpp | 7 +++---- .../unbounded_rational_functions.cpp | 11 ++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp index a721c419602..33286feb0b9 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/rational_functions.cpp @@ -1,6 +1,5 @@ //! \file examples/Arrangement_2/ex_rational_functions.cpp // Constructing an arrangement of arcs of rational functions. - #include #include //NT @@ -31,10 +30,10 @@ int main () std::vector arcs; // Create an arc supported by the polynomial y = x^4 - 6x^2 + 8, - // defined over the interval [-2, 2]: + // defined over the interval [-2.1, 2.1]: Polynomial_1 P1 = x*x*x*x - 6*x*x + 8; arcs.push_back( construct_arc(P1.begin(), P1.end(), - Alg_real_1(-2), Alg_real_1(2))); + Alg_real_1(-2.1), Alg_real_1(2.1))); // Create an arc supported by the function y = x / (1 + x^2), // defined over the interval [-3, 3]: @@ -57,7 +56,7 @@ int main () Alg_real_1(-3), Alg_real_1(0))); // Construct the arrangement of the four arcs. - Arrangement_2 arr; + Arrangement_2 arr(&traits); insert (arr, arcs.begin(), arcs.end()); // Print the arrangement size. diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp index 3a21e687293..dda0e57cfb2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/unbounded_rational_functions.cpp @@ -19,9 +19,9 @@ typedef CGAL::Arrangement_2 Arrangement_2; int main () { // Traits class object - Traits_2 traits; - AK1 ak1 = traits.algebraic_kernel_d_1(); - + AK1 ak1; + Traits_2 traits(&ak1); + // constructor for rational functions Traits_2::Construct_curve_2 construct = traits.construct_curve_2_object(); @@ -45,7 +45,7 @@ int main () Polynomial_1 P2 = -4*x*x+3; Polynomial_1 minusP2 = -P2; std::vector > roots; - ak1.solve_1_object()(P2,std::back_inserter(roots));// [-sqrt(3)/2, sqrt(3)/2] + traits.algebraic_kernel_d_1()->solve_1_object()(P2,std::back_inserter(roots));// [-sqrt(3)/2, sqrt(3)/2] arcs.push_back(construct(P2.begin(), P2.end(), roots[0].first, roots[1].first)); arcs.push_back(construct(minusP2.begin(),minusP2.end(), roots[0].first, roots[1].first)); @@ -58,7 +58,8 @@ int main () arcs.push_back(construct(minusP3.begin(),minusP3.end(), Q3.begin(), Q3.end(), Alg_real_1(0), false)); // Construct the arrangement of the six arcs. - Arrangement_2 arr; + //Arrangement_2 arr(&traits); + Arrangement_2 arr; insert (arr, arcs.begin(), arcs.end()); // Print the arrangement size.