From e67219db073ca1f07242e4efb977960ac9a1e119 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 6 Oct 2016 12:38:15 +0200 Subject: [PATCH 01/16] Rewrite mp[qz]_class coercions. --- .../include/CGAL/gmpxx_coercion_traits.h | 98 ++++++++----------- 1 file changed, 43 insertions(+), 55 deletions(-) diff --git a/Number_types/include/CGAL/gmpxx_coercion_traits.h b/Number_types/include/CGAL/gmpxx_coercion_traits.h index d1140ec05b4..05c1c7cfd71 100644 --- a/Number_types/include/CGAL/gmpxx_coercion_traits.h +++ b/Number_types/include/CGAL/gmpxx_coercion_traits.h @@ -36,74 +36,62 @@ namespace CGAL { -//mpz_class internal coercions: //self for mpz_class / mpq_class -template -struct Coercion_traits< - ::__gmp_expr< T , U>,::__gmp_expr< T , U> >{ - typedef Tag_true Are_explicit_interoperable; - typedef Tag_true Are_implicit_interoperable; - typedef ::__gmp_expr Type; - struct Cast{ - typedef Type result_type; - template - Type operator()(const ::__gmp_expr< T , U3>& x) const { - return x; - } - }; -}; - -template -struct Coercion_traits< - ::__gmp_expr< T , U1>,::__gmp_expr< T , U2> >{ - typedef Tag_true Are_explicit_interoperable; - typedef Tag_true Are_implicit_interoperable; - typedef ::__gmp_expr< T , T > Type; - struct Cast{ - typedef Type result_type; - template - Type operator()(const ::__gmp_expr< T , U3>& x) const { - return x; - } - }; -}; - - -template -struct Coercion_traits< ::__gmp_expr< T1 , U1>,::__gmp_expr< T2 , U2> >{ - typedef Tag_true Are_explicit_interoperable; - typedef Tag_true Are_implicit_interoperable; - typedef mpq_class Type; - struct Cast{ - typedef Type result_type; - template - Type operator()(const ::__gmp_expr< T , U>& x) const { - return Type(x); - } - }; -}; - - -// gmpzq_class implicit interoperable with int template -struct Coercion_traits< - ::__gmp_expr< T , U >, int >{ +struct Coercion_traits< ::__gmp_expr< T , U>, ::__gmp_expr< T , U> >{ typedef Tag_true Are_explicit_interoperable; typedef Tag_true Are_implicit_interoperable; typedef ::__gmp_expr< T , T > Type; struct Cast{ typedef Type result_type; - template - Type operator()(const ::__gmp_expr< T , U3>& x) const { + template + Type operator()(const X& x) const { return x; } - Type operator()(int x) const { return Type(x); } }; }; -// gmpz_class implicit interoperable with int +template +struct Coercion_traits< ::__gmp_expr< T , U1>, ::__gmp_expr< T , U2> > +: Coercion_traits< ::__gmp_expr, ::__gmp_expr > {}; + +//mixed mpz_class + mpq_class, ignore the possibility of mpf_class +template +struct Coercion_traits< ::__gmp_expr< T1 , U1>, ::__gmp_expr< T2 , U2> > +: Coercion_traits< mpq_class, mpq_class > {}; + +// gmpzq_class implicit interoperable with int, short, long +template +struct Coercion_traits< ::__gmp_expr< T , U >, int > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; template struct Coercion_traits< int , ::__gmp_expr< T , U> > - :public Coercion_traits< ::__gmp_expr< T , U>, int >{}; +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< ::__gmp_expr< T , U >, long > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< long , ::__gmp_expr< T , U > > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< ::__gmp_expr< T , U >, short > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< short , ::__gmp_expr< T , U > > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; + +// The traits are identical for float/double. The implicit conversion from double to mpz_class might disappear some day, but hopefully by that time CGAL will not support antediluvian versions of GMP anymore, which will make it easier to specialize the traits (or we will have a default version of Coercion_traits based on std::common_type and we can remove this file). +template +struct Coercion_traits< ::__gmp_expr< T , U >, double > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< double , ::__gmp_expr< T , U > > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< ::__gmp_expr< T , U >, float > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; +template +struct Coercion_traits< float , ::__gmp_expr< T , U > > +: public Coercion_traits< ::__gmp_expr< T , T >, ::__gmp_expr< T , T > > {}; } //namespace CGAL From 606840f1e1eaf6194f077ae04004fb82f689166f Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 13 Oct 2016 08:34:11 +0200 Subject: [PATCH 02/16] Specify the number type, for expression templates. --- .../Oriented_side_of_bisector_C2.h | 8 ++++---- .../CGAL/Apollonius_graph_2/compare_quadratic.h | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h index 8587e8a1893..5d1769c619d 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/Oriented_side_of_bisector_C2.h @@ -73,14 +73,14 @@ private: if ( sign_of_Dw == POSITIVE ) { if ( R != SMALLER ) return LARGER; - Sign s = sign_a_plus_b_x_sqrt_c(D1 - D2 + CGAL::square(Dw), - RT(2) * Dw, D1); + Sign s = sign_a_plus_b_x_sqrt_c(D1 - D2 + CGAL::square(Dw), + RT(2) * Dw, D1); return ((s == POSITIVE) ? LARGER : ((s == ZERO) ? EQUAL : SMALLER)); } if ( R != LARGER ) return SMALLER; - Sign s = sign_a_plus_b_x_sqrt_c(D1 - D2 - CGAL::square(Dw), - RT(2) * Dw, D2); + Sign s = sign_a_plus_b_x_sqrt_c(D1 - D2 - CGAL::square(Dw), + RT(2) * Dw, D2); return ((s == POSITIVE) ? LARGER : ((s == ZERO) ? EQUAL : SMALLER)); } diff --git a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h index 08669ab7fbd..e0738e1b652 100644 --- a/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h +++ b/Apollonius_graph_2/include/CGAL/Apollonius_graph_2/compare_quadratic.h @@ -449,7 +449,7 @@ ke_compare_l1_l2(const FT& a1, const FT& b1, const FT& c1, FT a1c2 = a1 * c2; FT a2c1 = a2 * c1; - FT K = value_of_K(a1c2, a2c1, b1 * b2); + FT K = value_of_K(a1c2, a2c1, b1 * b2); Sign s_K = CGAL::sign(K); if ( s_J == POSITIVE ) { @@ -530,7 +530,7 @@ ke_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, FT a1c2 = a1 * c2; FT a2c1 = a2 * c1; - FT K = value_of_K(a1c2, a2c1, b1 * b2); + FT K = value_of_K(a1c2, a2c1, b1 * b2); Sign s_K = CGAL::sign(K); if ( s_K == NEGATIVE ) { return SMALLER; } @@ -550,7 +550,7 @@ ke_compare_l1_r2(const FT& a1, const FT& b1, const FT& c1, if ( CGAL::is_positive(Jp) ) { return LARGER; } - FT P4 = value_of_P4(J, Jp, a1c2 - a2c1); + FT P4 = value_of_P4(J, Jp, a1c2 - a2c1); Sign s_P4 = CGAL::sign(P4); if ( s_P4 == POSITIVE ) { return SMALLER; } @@ -583,7 +583,7 @@ ke_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, FT a1c2 = a1 * c2; FT a2c1 = a2 * c1; - FT K = value_of_K(a1c2, a2c1, b1 * b2); + FT K = value_of_K(a1c2, a2c1, b1 * b2); Sign s_K = CGAL::sign(K); if ( s_K == NEGATIVE ) { return LARGER; } @@ -604,7 +604,7 @@ ke_compare_r1_l2(const FT& a1, const FT& b1, const FT& c1, if ( CGAL::is_negative(Jp) ) { return SMALLER; } - FT P4 = value_of_P4(J, Jp, a1c2 - a2c1); + FT P4 = value_of_P4(J, Jp, a1c2 - a2c1); Sign s_P4 = CGAL::sign(P4); if ( s_P4 == POSITIVE ) { return LARGER; } @@ -627,7 +627,7 @@ ke_compare_r1_r2(const FT& a1, const FT& b1, const FT& c1, FT a1c2 = a1 * c2; FT a2c1 = a2 * c1; - FT K = value_of_K(a1c2, a2c1, b1 * b2); + FT K = value_of_K(a1c2, a2c1, b1 * b2); Sign s_K = CGAL::sign(K); if ( s_J == POSITIVE ) { From 60806b035b4ed413ead5716a8e045cba5d275d7c Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 13 Oct 2016 08:49:22 +0200 Subject: [PATCH 03/16] Specify the number type, for expression templates. --- .../Triangulation_2_projection_traits_base_3.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Triangulation_2/include/CGAL/internal/Triangulation_2_projection_traits_base_3.h b/Triangulation_2/include/CGAL/internal/Triangulation_2_projection_traits_base_3.h index 903c5df2776..218d337ad8a 100644 --- a/Triangulation_2/include/CGAL/internal/Triangulation_2_projection_traits_base_3.h +++ b/Triangulation_2/include/CGAL/internal/Triangulation_2_projection_traits_base_3.h @@ -107,11 +107,11 @@ public: const FT k_q = tq * u; const FT k_r = tr * u; - return - sign_of_determinant(tp.x(), tp.y(), tp.z(), (tp2 + k_p) * u2 - k_p * k_p, - tr.x(), tr.y(), tr.z(), (tr2 + k_r) * u2 - k_r * k_r, - tq.x(), tq.y(), tq.z(), (tq2 + k_q) * u2 - k_q * k_q, - u.x(), u.y(), u.z(), u2 * u2); + return sign_of_determinant( + tp.x(), tp.y(), tp.z(), (tp2 + k_p) * u2 - k_p * k_p, + tr.x(), tr.y(), tr.z(), (tr2 + k_r) * u2 - k_r * k_r, + tq.x(), tq.y(), tq.z(), (tq2 + k_q) * u2 - k_q * k_q, + u.x(), u.y(), u.z(), u2 * u2); // Note that q and r have been swapped in the determinant above, to // inverse its sign. } From 232fc7ecf0df74bde35aba6213ca75b2d127de8b Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 13 Oct 2016 11:25:59 +0200 Subject: [PATCH 04/16] Help type deduction for expression template number types. --- .../include/CGAL/Arr_geometry_traits/Circle_segment_2.h | 6 +++--- .../include/CGAL/Sqrt_extension/Sqrt_extension_type.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h index 058a6d9923f..d6dde67c925 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_geometry_traits/Circle_segment_2.h @@ -2033,9 +2033,9 @@ protected: if (CGAL::sign(denom) == ZERO) return; - const NT x_numer = b()*cv.c() - c()*cv.b(); - const NT y_numer = c()*cv.a() - a()*cv.c(); - Point_2 p (x_numer / denom, y_numer / denom); + const NT x = (b()*cv.c() - c()*cv.b()) / denom; + const NT y = (c()*cv.a() - a()*cv.c()) / denom; + Point_2 p (x, y); inter_list.push_back (Intersection_point_2 (p, mult)); return; diff --git a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h index f4ed07f7742..b7290aec11e 100644 --- a/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h +++ b/Number_types/include/CGAL/Sqrt_extension/Sqrt_extension_type.h @@ -170,11 +170,11 @@ public: // is_extended_(x.is_extended()){} /*! \brief Constructor from some type NTX and ROOTX - * NT must be constructible from NTX\\ + * NT must be constructible from NTX and NTY\\ * ROOT must be construcible from ROOTX\\ */ - template - explicit Sqrt_extension(const NTX& a0, const NTX& a1, const ROOTX& root) + template + explicit Sqrt_extension(const NTX& a0, const NTY& a1, const ROOTX& root) : a0_(a0), a1_(a1), root_(root), From 678f9572f7fbb6a9fa52639fd81a99af6db0695a Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 13 Oct 2016 23:11:26 +0200 Subject: [PATCH 05/16] More ugly workarounds for expression templates. --- .../Min_sphere_of_spheres_d_support_set_impl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_support_set_impl.h b/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_support_set_impl.h index fe3797a12bf..84dfa1e0918 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_support_set_impl.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_support_set_impl.h @@ -91,7 +91,7 @@ namespace CGAL_MINIBALL_NAMESPACE { for (int j=0; j(u[m][j]-d[m-1][j]); } phi[m] = FT(2)*(phi[m] - t1); eps[m] = t1*t2+FT(2)*eps[m]; @@ -151,7 +151,7 @@ namespace CGAL_MINIBALL_NAMESPACE { if (m > 1) { // compute the coeffients beta[i] and the center: for(unsigned int i=1; i(delta[i]+eps[i])+sol[m]*phi[i])/alpha[i]; for (int j=0; j Date: Thu, 13 Oct 2016 23:40:59 +0200 Subject: [PATCH 06/16] Specify the type for expression templates. Get_rational_type is still wrong, it should be mpq_class instead of Quotient, but I don't know if I am supposed to define an (undocumented) arithmetic kernel for gmpxx... --- Number_types/include/CGAL/Root_of_traits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/Root_of_traits.h b/Number_types/include/CGAL/Root_of_traits.h index f4b1282b98b..b26b16d19fe 100644 --- a/Number_types/include/CGAL/Root_of_traits.h +++ b/Number_types/include/CGAL/Root_of_traits.h @@ -185,7 +185,7 @@ public: RT b_ = b_num * a_den * c_den; RT c_ = c_num * a_den * b_den; - return make_root_of_2(a_,b_,c_,smaller); + return make_root_of_2(a_,b_,c_,smaller); } }; From 2868790cf4e39942790fb4f9c28a9725b9abb77c Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Thu, 13 Oct 2016 23:58:29 +0200 Subject: [PATCH 07/16] Workarounds for expression templates. Theses are just tests and already look ugly, don't try to be clever here. --- .../include/CGAL/_test_sphere_compute.h | 6 ++-- .../include/CGAL/_test_sphere_constructions.h | 22 +++++++-------- .../include/CGAL/_test_sphere_predicates.h | 28 +++++++++---------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_compute.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_compute.h index 59d317f2506..6d28a631585 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_compute.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_compute.h @@ -73,11 +73,11 @@ void _test_spherical_kernel_compute(SK sk) Root_for_spheres_2_3 rt[8]; rt[0] = Root_for_spheres_2_3(0,1,0); - rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1)/FT(2)),FT(2)),0); + rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1)/FT(2)),FT(2)),0); rt[2] = Root_for_spheres_2_3(-1,0,0); - rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1)/FT(2)),FT(2)),0); + rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1)/FT(2)),FT(2)),0); rt[4] = Root_for_spheres_2_3(0,-1,0); - rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1)/FT(2)),FT(2)),0); + rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1)/FT(2)),FT(2)),0); rt[6] = Root_for_spheres_2_3(1,0,0); rt[7] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1)/FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1)/FT(2)),FT(2)),0); diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h index fb554468eec..2c506a402eb 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_constructions.h @@ -1784,11 +1784,11 @@ void _test_intersection_construct(SK sk) { Root_for_spheres_2_3 rt[8]; rt[0] = Root_for_spheres_2_3(0,1,0); - rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); + rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); rt[2] = Root_for_spheres_2_3(-1,0,0); - rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[4] = Root_for_spheres_2_3(0,-1,0); - rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[6] = Root_for_spheres_2_3(1,0,0); rt[7] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); @@ -2479,11 +2479,11 @@ void _test_split_construct(SK sk) { Root_for_spheres_2_3 rt[8]; rt[0] = Root_for_spheres_2_3(0,1,0); - rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); + rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); rt[2] = Root_for_spheres_2_3(-1,0,0); - rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[4] = Root_for_spheres_2_3(0,-1,0); - rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[6] = Root_for_spheres_2_3(1,0,0); rt[7] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); @@ -2567,13 +2567,13 @@ void _test_extremal_points_construct(SK sk) { Circular_arc_point_3 pc[4], ps[6], res[6]; - pc[0] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), + pc[0] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), 0, CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2))); pc[1] = Root_for_spheres_2_3(0,1,0); pc[2] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), 0, - CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2))); + CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2))); pc[3] = Root_for_spheres_2_3(0,-1,0); res[0] = x_extremal_point(c, true); @@ -2590,11 +2590,11 @@ void _test_extremal_points_construct(SK sk) { assert(res[4] == pc[0]); assert(res[5] == pc[2]); - ps[0] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(1),-FT(1),FT(2)), 1, 1); + ps[0] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(1),FT(-1),FT(2)), 1, 1); ps[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(1),FT(1),FT(2)), 1, 1); - ps[2] = Root_for_spheres_2_3(1, CGAL::make_root_of_2(FT(1),-FT(1),FT(2)), 1); + ps[2] = Root_for_spheres_2_3(1, CGAL::make_root_of_2(FT(1),FT(-1),FT(2)), 1); ps[3] = Root_for_spheres_2_3(1, CGAL::make_root_of_2(FT(1),FT(1),FT(2)), 1); - ps[4] = Root_for_spheres_2_3(1, 1, CGAL::make_root_of_2(FT(1),-FT(1),FT(2))); + ps[4] = Root_for_spheres_2_3(1, 1, CGAL::make_root_of_2(FT(1),FT(-1),FT(2))); ps[5] = Root_for_spheres_2_3(1, 1, CGAL::make_root_of_2(FT(1),FT(1),FT(2))); res[0] = x_extremal_point(s, true); diff --git a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h index cc3f212fc0f..32d66d58c54 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h +++ b/Circular_kernel_3/test/Circular_kernel_3/include/CGAL/_test_sphere_predicates.h @@ -269,7 +269,7 @@ void _test_has_on_predicate(SK sk) { Point_3 p_3_s_1 = Point_3(0,0,1); Point_3 p_4_s_1 = Point_3(1,0,1); std::cout << "Testing has_on(Sphere,Circular_arc_point)..." << std::endl; - Root_of_2 sqrt_1_div_3 = CGAL::make_root_of_2(FT(0),FT(1),FT(1) / FT(3)); + Root_of_2 sqrt_1_div_3 = CGAL::make_root_of_2(FT(0),FT(1),FT(FT(1) / FT(3))); Root_of_2 sqrt_1_div_2 = CGAL::make_root_of_2(FT(0),FT(1),FT(FT(1) / FT(2))); Root_for_spheres_2_3 r_1_s_1 = Root_for_spheres_2_3(0,sqrt_1_div_2,sqrt_1_div_2); Root_for_spheres_2_3 r_2_s_1 = Root_for_spheres_2_3(sqrt_1_div_3,sqrt_1_div_3,sqrt_1_div_3); @@ -327,8 +327,8 @@ void _test_has_on_predicate(SK sk) { Polynomial_1_3(1,1,1,0)); Circle_3 c_2 = theConstruct_circle_3(pc2); Root_of_2 r_1_1_c_2 = FT(FT(1) / FT(2)); - Root_of_2 r_1_2_c_2 = CGAL::make_root_of_2(-FT(FT(1) / FT(4)),-FT(FT(1) / FT(4)),FT(5)); - Root_of_2 r_1_3_c_2 = CGAL::make_root_of_2(-FT(FT(1) / FT(4)),FT(FT(1) / FT(4)),FT(5)); + Root_of_2 r_1_2_c_2 = CGAL::make_root_of_2(FT(-FT(1) / FT(4)),FT(-FT(1) / FT(4)),FT(5)); + Root_of_2 r_1_3_c_2 = CGAL::make_root_of_2(FT(-FT(1) / FT(4)),FT(FT(1) / FT(4)),FT(5)); Root_for_spheres_2_3 r_1_c_2 = Root_for_spheres_2_3(r_1_1_c_2,r_1_2_c_2,r_1_3_c_2); Root_for_spheres_2_3 r_2_c_2 = Root_for_spheres_2_3(r_1_2_c_2,r_1_2_c_2,r_1_2_c_2); Circular_arc_point_3 cp_1_c_2 = Circular_arc_point_3(r_1_c_2); @@ -408,14 +408,14 @@ void _test_has_on_predicate(SK sk) { Root_for_spheres_2_3 rt[10]; rt[0] = Root_for_spheres_2_3(0,1,0); - rt[1] = Root_for_spheres_2_3(-FT(FT(1) / FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(3)), 0); - rt[2] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); - rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(3)), FT(FT(1) / FT(2)), 0); + rt[1] = Root_for_spheres_2_3(FT(-FT(1) / FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(3)), 0); + rt[2] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); + rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(3)), FT(FT(1) / FT(2)), 0); rt[4] = Root_for_spheres_2_3(-1,0,0); - rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[6] = Root_for_spheres_2_3(0,-1,0); - rt[7] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[7] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[8] = Root_for_spheres_2_3(1,0,0); rt[9] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); @@ -450,11 +450,11 @@ void _test_has_on_predicate(SK sk) { Root_for_spheres_2_3 rt2[8]; rt2[0] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2))); rt2[1] = Root_for_spheres_2_3(0,0,1); - rt2[2] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2))); + rt2[2] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2))); rt2[3] = Root_for_spheres_2_3(0,-1,0); - rt2[4] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2))); + rt2[4] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2))); rt2[5] = Root_for_spheres_2_3(0,0,-1); - rt2[6] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2))); + rt2[6] = Root_for_spheres_2_3(0,CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2))); rt2[7] = Root_for_spheres_2_3(0,1,0); for(int i=0; i<8; i++) { @@ -579,11 +579,11 @@ void _test_do_overlap_predicate(SK sk) { Root_for_spheres_2_3 rt[8]; rt[0] = Root_for_spheres_2_3(0,1,0); - rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); + rt[1] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); rt[2] = Root_for_spheres_2_3(-1,0,0); - rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[3] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[4] = Root_for_spheres_2_3(0,-1,0); - rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),-FT(FT(1) / FT(2)),FT(2)),0); + rt[5] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(-FT(1) / FT(2)),FT(2)),0); rt[6] = Root_for_spheres_2_3(1,0,0); rt[7] = Root_for_spheres_2_3(CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)), CGAL::make_root_of_2(FT(0),FT(FT(1) / FT(2)),FT(2)),0); From 030d81e3f72bce8558fd64e714115d19b7f3d5b0 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Fri, 14 Oct 2016 00:37:11 +0200 Subject: [PATCH 08/16] Fixes for FT=mpq_class. In particular, the constructor from std::string is explicit. test_nef_3_io_EPEC is still broken because of that. --- .../Intersections_3/Bbox_3_Triangle_3_do_intersect.h | 6 +++--- Nef_3/test/Nef_3/test_nef_3_io_Cartesian_Lazy.cpp | 4 ++-- Nef_3/test/Nef_3/test_nef_3_io_Homogenoeus_Lazy.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h index 6b831f07f46..26a2bea7740 100644 --- a/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h +++ b/Intersections_3/include/CGAL/internal/Intersections_3/Bbox_3_Triangle_3_do_intersect.h @@ -159,7 +159,7 @@ namespace internal { return -sides[SIDE].y()*alpha + sides[SIDE].x()*beta; default: CGAL_error(); - return typename K::FT(0.); + return typename K::FT(0); } } @@ -192,8 +192,8 @@ namespace internal { typename K::Point_3 p_min, p_max; get_min_max(AXE==0? 0: AXE==1? sides[SIDE].z(): -sides[SIDE].y(), AXE==0? -sides[SIDE].z(): AXE==1? 0: sides[SIDE].x(), - AXE==0? sides[SIDE].y(): AXE==1? -sides[SIDE].x(): 0, - bbox, p_min, p_max); + AXE==0? sides[SIDE].y(): AXE==1? -sides[SIDE].x(): + typename K::FT(0), bbox, p_min, p_max); switch ( AXE ) { diff --git a/Nef_3/test/Nef_3/test_nef_3_io_Cartesian_Lazy.cpp b/Nef_3/test/Nef_3/test_nef_3_io_Cartesian_Lazy.cpp index cd8d18b9a02..0793d81fcaf 100644 --- a/Nef_3/test/Nef_3/test_nef_3_io_Cartesian_Lazy.cpp +++ b/Nef_3/test/Nef_3/test_nef_3_io_Cartesian_Lazy.cpp @@ -23,8 +23,8 @@ void test_write_read() typedef CGAL::Polyhedron_3< Kernel > Polyhedron; typedef typename Kernel::Point_3 Point; - typename Kernel::RT n( std::string("6369051672525773")); - typename Kernel::RT d( std::string("4503599627370496")); + typename Kernel::RT n(RT(std::string("6369051672525773"))); + typename Kernel::RT d(RT(std::string("4503599627370496"))); Point p(n, 0, 0, d); Point q(0, n, 0, d); diff --git a/Nef_3/test/Nef_3/test_nef_3_io_Homogenoeus_Lazy.cpp b/Nef_3/test/Nef_3/test_nef_3_io_Homogenoeus_Lazy.cpp index 920e3af755e..c665bc9fbb8 100644 --- a/Nef_3/test/Nef_3/test_nef_3_io_Homogenoeus_Lazy.cpp +++ b/Nef_3/test/Nef_3/test_nef_3_io_Homogenoeus_Lazy.cpp @@ -23,8 +23,8 @@ void test_write_read() typedef CGAL::Polyhedron_3< Kernel > Polyhedron; typedef typename Kernel::Point_3 Point; - typename Kernel::RT n( std::string("6369051672525773")); - typename Kernel::RT d( std::string("4503599627370496")); + typename Kernel::RT n(RT(std::string("6369051672525773"))); + typename Kernel::RT d(RT(std::string("4503599627370496"))); Point p(n, 0, 0, d); Point q(0, n, 0, d); From 06673205d290139a9e0e6a14f4fb4650dad5ba61 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Fri, 14 Oct 2016 10:19:17 +0200 Subject: [PATCH 09/16] Specialize for gmpxx. --- .../QP_solver/master_mps_to_derivatives.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp index b55dccde78f..0e75cc7dfba 100644 --- a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp +++ b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp @@ -57,6 +57,12 @@ namespace QP_from_mps_detail { struct MPS_type_name { static const char *name() { return "integer"; } }; +#ifdef CGAL_USE_GMPXX + template<> + struct MPS_type_name { + static const char *name() { return "rational"; } + }; +#endif #ifdef CGAL_USE_GMP template<> struct MPS_type_name { @@ -83,10 +89,22 @@ namespace QP_from_mps_detail { }; #ifdef CGAL_USE_GMP +#ifdef CGAL_USE_GMPXX + template<> + struct IT_to_ET { + typedef mpz_class ET; + }; + + template<> + struct IT_to_ET { + typedef mpq_class ET; + }; +#else template<> struct IT_to_ET { typedef CGAL::Gmpz ET; }; +#endif template<> struct IT_to_ET { From 31d6b482f575a2f867ad5616d629fda723785df1 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Fri, 14 Oct 2016 14:51:37 +0200 Subject: [PATCH 10/16] Workaround for expression templates. --- QP_solver/test/QP_solver/master_mps_to_derivatives.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp index 0e75cc7dfba..e9a5827d31d 100644 --- a/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp +++ b/QP_solver/test/QP_solver/master_mps_to_derivatives.cpp @@ -217,14 +217,14 @@ void create_shifted_instance(const CGAL::Quadratic_program_from_mps & qp, std::vector Av(m, IT(0)); for (int i=0; i mvTD(n, IT(0)); // -2D^Tv for (int i=0; i Date: Sat, 15 Oct 2016 17:44:44 +0200 Subject: [PATCH 11/16] strcmp returns 0 when strings match, invert. --- Envelope_2/test/Envelope_2/test_envelope_segments.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Envelope_2/test/Envelope_2/test_envelope_segments.cpp b/Envelope_2/test/Envelope_2/test_envelope_segments.cpp index 100ff96a573..ba607181e80 100644 --- a/Envelope_2/test/Envelope_2/test_envelope_segments.cpp +++ b/Envelope_2/test/Envelope_2/test_envelope_segments.cpp @@ -310,9 +310,9 @@ int main (int argc, char *argv[]) // Determine the input format. Coord_input_format format = F_RATIONAL; - if (strcmp (argv[2*i + 2], "-i") || strcmp (argv[2*i + 2], "-I")) + if (strcmp (argv[2*i + 2], "-i") == 0 || strcmp (argv[2*i + 2], "-I") == 0) format = F_INTEGER; - else if (strcmp (argv[2*i + 2], "-d") || strcmp (argv[2*i + 2], "-D")) + else if (strcmp (argv[2*i + 2], "-d") == 0 || strcmp (argv[2*i + 2], "-D") == 0) format = F_DOUBLE; // Read the input segments. From 5bee5f592255c95cb0d23cc49269f46baa85acbd Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 15 Oct 2016 18:21:54 +0200 Subject: [PATCH 12/16] Workarounds for expression templates. --- Nef_3/include/CGAL/Nef_3/SNC_constructor.h | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_constructor.h b/Nef_3/include/CGAL/Nef_3/SNC_constructor.h index 3bbc14028ee..7d9635077ff 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_constructor.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_constructor.h @@ -234,9 +234,9 @@ public: Vertex_handle v = this->sncp()->new_vertex(p , boundary); CGAL_NEF_TRACEN( v->point()); SM_decorator SD(&*v); - Sphere_point sp[] = { Sphere_point(-x, 0, 0), - Sphere_point(0, -y, 0), - Sphere_point(0, 0, -z) }; + Sphere_point sp[] = { Sphere_point(NT(-x), 0, 0), + Sphere_point(0, NT(-y), 0), + Sphere_point(0, 0, NT(-z)) }; /* create box vertices */ SVertex_handle sv[3]; @@ -1126,9 +1126,8 @@ public: std::list points; for(int dir=0; dir<3;++dir) { - NT cnst[3]; - for(int i=0; i<3;++i) - cnst[i] = (i==dir? -h.d()[0] : 0); + NT cnst[3] = { 0, 0, 0 }; + cnst[dir] = -h.d()[0]; NT cross[4][4]; cross[0][dir] = -orth_coords[(dir+1)%3]-orth_coords[(dir+2)%3]; @@ -1541,10 +1540,10 @@ public: CGAL_NEF_TRACEN("create corner frame point "); - RT vp[3]; - vp[0] = -p.hx()[1]; - vp[1] = -p.hy()[1]; - vp[2] = -p.hz()[1]; + RT vp[3] = { + static_cast(-p.hx()[1]), + static_cast(-p.hy()[1]), + static_cast(-p.hz()[1]) }; CGAL_NEF_TRACEN("create spoints"); Sphere_point SP[5]; @@ -1606,10 +1605,10 @@ public: (CGAL_NTS abs(vec.hy()) == CGAL_NTS abs(vec.hz()) && vec.hx() == 0) || (CGAL_NTS abs(vec.hx()) == CGAL_NTS abs(vec.hz()) && vec.hy() == 0)); - RT vp[3]; - vp[0] = -p.hx()[1]; - vp[1] = -p.hy()[1]; - vp[2] = -p.hz()[1]; + RT vp[3] = { + static_cast(-p.hx()[1]), + static_cast(-p.hy()[1]), + static_cast(-p.hz()[1]) }; CGAL_NEF_TRACEN("create degenerate corner frame point "); From 3816bc4e4b89f3f889c6976b4c7d7982f117a6ab Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 15 Oct 2016 18:40:02 +0200 Subject: [PATCH 13/16] Specify the right type for make_root_of_2... It compiled but was causing an infinite recursion. --- Number_types/include/CGAL/Root_of_traits.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/Root_of_traits.h b/Number_types/include/CGAL/Root_of_traits.h index b26b16d19fe..ac33701129d 100644 --- a/Number_types/include/CGAL/Root_of_traits.h +++ b/Number_types/include/CGAL/Root_of_traits.h @@ -185,7 +185,7 @@ public: RT b_ = b_num * a_den * c_den; RT c_ = c_num * a_den * b_den; - return make_root_of_2(a_,b_,c_,smaller); + return make_root_of_2(a_,b_,c_,smaller); } }; From 1c6cf4b55780fae4d1a3a59a98bcd56cc4c11ebe Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 15 Oct 2016 19:48:25 +0200 Subject: [PATCH 14/16] Replace ?: with 'if' for expression templates. --- Polynomial/include/CGAL/Polynomial/prs_resultant.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Polynomial/include/CGAL/Polynomial/prs_resultant.h b/Polynomial/include/CGAL/Polynomial/prs_resultant.h index a3fae56cf69..1310832c1e8 100644 --- a/Polynomial/include/CGAL/Polynomial/prs_resultant.h +++ b/Polynomial/include/CGAL/Polynomial/prs_resultant.h @@ -134,7 +134,10 @@ NT prs_resultant_ufd(Polynomial A, Polynomial B) { delta = A.degree(); g = B.lcoeff(); internal::hgdelta_update(h, g, delta); - h = signflip ? -(t*h) : t*h; + if (signflip) + h = -(t*h); + else + h = t*h; typename Algebraic_structure_traits::Simplify simplify; simplify(h); return h; From 2c31c41529ab7da2b8d648896b953ef5ab660183 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 15 Oct 2016 19:54:51 +0200 Subject: [PATCH 15/16] Specify the type for expression templates. --- .../include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h index 4d422f53306..89d3538c254 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2/Are_parallel_C2.h @@ -62,8 +62,8 @@ private: x4 = s2.target().x(), y4 = s2.target().y(); - FT det = determinant(x2 - x1, x4 - x3, - y2 - y1, y4 - y3); + FT det = determinant(x2 - x1, x4 - x3, + y2 - y1, y4 - y3); return ( CGAL::sign(det) == CGAL::ZERO ); } From 12618d3d5625518c8168f08211ca43814a5095b3 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 15 Oct 2016 22:39:23 +0200 Subject: [PATCH 16/16] Use 1/2 instead of .5 as file input for Epeck. That's what all the other testcases in the directory do, so I assume it is ok. --- .../test/Visibility_2/data/test_simple_polygon_22.dat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Visibility_2/test/Visibility_2/data/test_simple_polygon_22.dat b/Visibility_2/test/Visibility_2/data/test_simple_polygon_22.dat index e75d1320752..cade56a2b75 100644 --- a/Visibility_2/test/Visibility_2/data/test_simple_polygon_22.dat +++ b/Visibility_2/test/Visibility_2/data/test_simple_polygon_22.dat @@ -1,5 +1,5 @@ -0.5 2 -0.5 2 +1/2 2 +1/2 2 0 6