diff --git a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h index e34a96ceae9..7f02db00aa8 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h +++ b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_2.h @@ -33,7 +33,6 @@ protected: typedef DG Delaunay_graph; typedef typename DG::Vertex Vertex; typedef typename DG::Face Face; - // typedef typename Gt::Line_2 Line; public: // TYPES diff --git a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.C b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.C index 0f70d048c8b..21db13a3ef9 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.C +++ b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.C @@ -471,24 +471,24 @@ inline bool ad_is_hidden_test_2(const Weighted_point< Point, We >& p, const Weighted_point< Point, We >& q, - Cartesian_tag, Naive_tag ) + Cartesian_tag, Sqrt_field_tag ) { typedef typename Point::FT FT; - return ad_is_trivial_test_naive_C2(p.x(), p.y(), FT(p.weight()), - q.x(), q.y(), FT(q.weight())); + return ad_is_hidden_test_sqrtf_C2(p.x(), p.y(), FT(p.weight()), + q.x(), q.y(), FT(q.weight())); } -template < class Point, class We, class Algebraic_tag > +template < class Point, class We > inline bool ad_is_hidden_test_2(const Weighted_point< Point, We >& p, const Weighted_point< Point, We >& q, - Cartesian_tag, Algebraic_tag ) + Cartesian_tag, Ring_tag ) { typedef typename Point::FT FT; - return ad_is_trivial_test_alg_C2(p.x(), p.y(), FT(p.weight()), - q.x(), q.y(), FT(q.weight())); + return ad_is_hidden_test_ring_C2(p.x(), p.y(), FT(p.weight()), + q.x(), q.y(), FT(q.weight())); } @@ -550,11 +550,11 @@ inline Comparison_result ad_distances_test_2(const Weighted_point< Point, We >& p1, const Weighted_point< Point, We >& p2, - const Point& p, Cartesian_tag, Naive_tag ) + const Point& p, Cartesian_tag, Sqrt_field_tag ) { typedef typename Point::FT FT; return - compare_ad_distances_test_naive_C2(p1.x(), p1.y(), FT(p1.weight()), + compare_ad_distances_test_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p.x(), p.y()); } @@ -565,25 +565,11 @@ inline Comparison_result ad_distances_test_2(const Weighted_point< Point, We >& p1, const Weighted_point< Point, We >& p2, - const Point& p, Cartesian_tag, Algebraic1_tag ) + const Point& p, Cartesian_tag, Ring_tag ) { typedef typename Point::FT FT; return - compare_ad_distances_test_alg1_C2(p1.x(), p1.y(), FT(p1.weight()), - p2.x(), p2.y(), FT(p2.weight()), - p.x(), p.y()); -} - -template < class Point, class We > -inline -Comparison_result -ad_distances_test_2(const Weighted_point< Point, We >& p1, - const Weighted_point< Point, We >& p2, - const Point& p, Cartesian_tag, Algebraic2_tag ) -{ - typedef typename Point::FT FT; - return - compare_ad_distances_test_alg2_C2(p1.x(), p1.y(), FT(p1.weight()), + compare_ad_distances_test_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p.x(), p.y()); } @@ -668,10 +654,10 @@ Sign ad_incircle_test_2(const Weighted_point< Point, We >& p1, const Weighted_point< Point, We >& p2, const Weighted_point< Point, We >& q, - Cartesian_tag, Naive_tag ) + Cartesian_tag, Sqrt_field_tag ) { typedef typename Point::FT FT; - return ad_incircle_test_naive_C2(p1.x(), p1.y(), FT(p1.weight()), + return ad_incircle_test_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), q.x(), q.y(), FT( q.weight())); } @@ -683,29 +669,14 @@ Sign ad_incircle_test_2(const Weighted_point< Point, We >& p1, const Weighted_point< Point, We >& p2, const Weighted_point< Point, We >& q, - Cartesian_tag, Algebraic1_tag ) + Cartesian_tag, Ring_tag ) { typedef typename Point::FT FT; - return ad_incircle_test_alg1_C2(p1.x(), p1.y(), FT(p1.weight()), + return ad_incircle_test_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), q.x(), q.y(), FT( q.weight())); } -template < class Point, class We > -inline -Sign -ad_incircle_test_2(const Weighted_point< Point, We >& p1, - const Weighted_point< Point, We >& p2, - const Weighted_point< Point, We >& q, - Cartesian_tag, Algebraic2_tag ) -{ - typedef typename Point::FT FT; - return ad_incircle_test_alg2_C2(p1.x(), p1.y(), FT(p1.weight()), - p2.x(), p2.y(), FT(p2.weight()), - q.x(), q.y(), FT( q.weight())); -} - - template < class Point, class We, class Method_tag > inline @@ -745,10 +716,10 @@ ad_incircle_test_2(const Weighted_point< Point, We >& p1, const Weighted_point< Point, We >& p2, const Weighted_point< Point, We >& p3, const Weighted_point< Point, We >& q, - Cartesian_tag, Naive_tag ) + Cartesian_tag, Sqrt_field_tag ) { typedef typename Point::FT FT; - return ad_incircle_test_naive_C2(p1.x(), p1.y(), FT(p1.weight()), + return ad_incircle_test_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), q.x(), q.y(), FT( q.weight())); @@ -762,31 +733,15 @@ ad_incircle_test_2(const Weighted_point< Point, We >& p1, const Weighted_point< Point, We >& p2, const Weighted_point< Point, We >& p3, const Weighted_point< Point, We >& q, - Cartesian_tag, Algebraic1_tag ) + Cartesian_tag, Ring_tag ) { typedef typename Point::FT FT; - return ad_incircle_test_alg1_C2(p1.x(), p1.y(), FT(p1.weight()), + return ad_incircle_test_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), q.x(), q.y(), FT( q.weight())); } -template < class Point, class We > -inline -Sign -ad_incircle_test_2(const Weighted_point< Point, We >& p1, - const Weighted_point< Point, We >& p2, - const Weighted_point< Point, We >& p3, - const Weighted_point< Point, We >& q, - Cartesian_tag, Algebraic2_tag ) -{ - typedef typename Point::FT FT; - return ad_incircle_test_alg2_C2(p1.x(), p1.y(), FT(p1.weight()), - p2.x(), p2.y(), FT(p2.weight()), - p3.x(), p3.y(), FT(p3.weight()), - q.x(), q.y(), FT( q.weight())); -} - template < class Point, class We, class Method_tag > @@ -865,11 +820,11 @@ bool ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Naive_tag) + bool b, Cartesian_tag, Sqrt_field_tag) { typedef typename Pt::FT FT; return - ad_finite_edge_test_degenerated_naive_C2(p1.x(), p1.y(), + ad_finite_edge_test_degenerated_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), @@ -883,29 +838,11 @@ bool ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic1_tag) + bool b, Cartesian_tag, Ring_tag) { typedef typename Pt::FT FT; return - ad_finite_edge_test_degenerated_alg1_C2(p1.x(), p1.y(), - FT(p1.weight()), - p2.x(), p2.y(), - FT(p2.weight()), - q.x(), q.y(), - FT( q.weight()), b); -} - -template < class Pt, class We> -inline -bool -ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, - const Weighted_point< Pt, We >& p2, - const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic2_tag) -{ - typedef typename Pt::FT FT; - return - ad_finite_edge_test_degenerated_alg2_C2(p1.x(), p1.y(), + ad_finite_edge_test_degenerated_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), @@ -968,10 +905,10 @@ ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Naive_tag) + bool b, Cartesian_tag, Sqrt_field_tag) { typedef typename Pt::FT FT; - return ad_finite_edge_test_degenerated_naive_C2(p1.x(), p1.y(), + return ad_finite_edge_test_degenerated_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), @@ -988,30 +925,10 @@ ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic1_tag) + bool b, Cartesian_tag, Ring_tag) { typedef typename Pt::FT FT; - return ad_finite_edge_test_degenerated_alg1_C2(p1.x(), p1.y(), - FT(p1.weight()), - p2.x(), p2.y(), - FT(p2.weight()), - p3.x(), p3.y(), - FT(p3.weight()), - q.x(), q.y(), - FT( q.weight()), b); -} - -template < class Pt, class We > -inline -bool -ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, - const Weighted_point< Pt, We >& p2, - const Weighted_point< Pt, We >& p3, - const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic2_tag) -{ - typedef typename Pt::FT FT; - return ad_finite_edge_test_degenerated_alg2_C2(p1.x(), p1.y(), + return ad_finite_edge_test_degenerated_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), @@ -1084,11 +1001,11 @@ ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& p4, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Naive_tag) + bool b, Cartesian_tag, Sqrt_field_tag) { typedef typename Pt::FT FT; return - ad_finite_edge_test_naive_C2(p1.x(), p1.y(), FT(p1.weight()), + ad_finite_edge_test_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), p4.x(), p4.y(), FT(p4.weight()), @@ -1103,31 +1020,11 @@ ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& p4, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic1_tag) + bool b, Cartesian_tag, Ring_tag) { typedef typename Pt::FT FT; return - ad_finite_edge_test_alg1_C2(p1.x(), p1.y(), FT(p1.weight()), - p2.x(), p2.y(), FT(p2.weight()), - p3.x(), p3.y(), FT(p3.weight()), - p4.x(), p4.y(), FT(p4.weight()), - q.x(), q.y(), FT(q.weight()), b); -} - - -template < class Pt, class We > -inline -bool -ad_finite_edge_test_2(const Weighted_point< Pt, We >& p1, - const Weighted_point< Pt, We >& p2, - const Weighted_point< Pt, We >& p3, - const Weighted_point< Pt, We >& p4, - const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic2_tag) -{ - typedef typename Pt::FT FT; - return - ad_finite_edge_test_alg2_C2(p1.x(), p1.y(), FT(p1.weight()), + ad_finite_edge_test_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), p4.x(), p4.y(), FT(p4.weight()), @@ -1245,11 +1142,11 @@ ad_infinite_edge_test_2(const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& p4, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Naive_tag) + bool b, Cartesian_tag, Sqrt_field_tag) { typedef typename Pt::FT FT; return - ad_infinite_edge_test_naive_C2(p2.x(), p2.y(), FT(p2.weight()), + ad_infinite_edge_test_sqrtf_C2(p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), p4.x(), p4.y(), FT(p4.weight()), q.x(), q.y(), FT( q.weight()), b); @@ -1263,28 +1160,11 @@ ad_infinite_edge_test_2(const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& p4, const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic1_tag) + bool b, Cartesian_tag, Ring_tag) { typedef typename Pt::FT FT; return - ad_infinite_edge_test_alg1_C2(p2.x(), p2.y(), FT(p2.weight()), - p3.x(), p3.y(), FT(p3.weight()), - p4.x(), p4.y(), FT(p4.weight()), - q.x(), q.y(), FT( q.weight()), b); -} - -template < class Pt, class We > -inline -bool -ad_infinite_edge_test_2(const Weighted_point< Pt, We >& p2, - const Weighted_point< Pt, We >& p3, - const Weighted_point< Pt, We >& p4, - const Weighted_point< Pt, We >& q, - bool b, Cartesian_tag, Algebraic2_tag) -{ - typedef typename Pt::FT FT; - return - ad_infinite_edge_test_alg2_C2(p2.x(), p2.y(), FT(p2.weight()), + ad_infinite_edge_test_ring_C2(p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), p4.x(), p4.y(), FT(p4.weight()), q.x(), q.y(), FT( q.weight()), b); @@ -1375,11 +1255,11 @@ ad_is_degenerate_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& p4, - Cartesian_tag, Naive_tag) + Cartesian_tag, Sqrt_field_tag) { typedef typename Pt::FT FT; return - ad_is_degenerate_edge_test_naive_C2(p1.x(), p1.y(), FT(p1.weight()), + ad_is_degenerate_edge_test_sqrtf_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), p4.x(), p4.y(), FT(p4.weight())); @@ -1392,29 +1272,11 @@ ad_is_degenerate_edge_test_2(const Weighted_point< Pt, We >& p1, const Weighted_point< Pt, We >& p2, const Weighted_point< Pt, We >& p3, const Weighted_point< Pt, We >& p4, - Cartesian_tag, Algebraic1_tag) + Cartesian_tag, Ring_tag) { typedef typename Pt::FT FT; return - ad_is_degenerate_edge_test_alg1_C2(p1.x(), p1.y(), FT(p1.weight()), - p2.x(), p2.y(), FT(p2.weight()), - p3.x(), p3.y(), FT(p3.weight()), - p4.x(), p4.y(), FT(p4.weight())); -} - - -template < class Pt, class We > -inline -bool -ad_is_degenerate_edge_test_2(const Weighted_point< Pt, We >& p1, - const Weighted_point< Pt, We >& p2, - const Weighted_point< Pt, We >& p3, - const Weighted_point< Pt, We >& p4, - Cartesian_tag, Algebraic2_tag) -{ - typedef typename Pt::FT FT; - return - ad_is_degenerate_edge_test_alg2_C2(p1.x(), p1.y(), FT(p1.weight()), + ad_is_degenerate_edge_test_ring_C2(p1.x(), p1.y(), FT(p1.weight()), p2.x(), p2.y(), FT(p2.weight()), p3.x(), p3.y(), FT(p3.weight()), p4.x(), p4.y(), FT(p4.weight())); diff --git a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.h b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.h index 21d3004a542..ae53eb13dda 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.h +++ b/Packages/Apollonius_graph_2/include/CGAL/Apollonius_graph_euclidean_traits_2.h @@ -8,8 +8,6 @@ #include #include -#include - #include #include diff --git a/Packages/Apollonius_graph_2/include/CGAL/Arithmetic_filter/predicates/Apollonius_graph_ftC2.h b/Packages/Apollonius_graph_2/include/CGAL/Arithmetic_filter/predicates/Apollonius_graph_ftC2.h index 919374133d9..963f0af2fbf 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/Arithmetic_filter/predicates/Apollonius_graph_ftC2.h +++ b/Packages/Apollonius_graph_2/include/CGAL/Arithmetic_filter/predicates/Apollonius_graph_ftC2.h @@ -36,7 +36,7 @@ static #endif /* inline */ bool -ad_is_trivial_test_alg_C2( +ad_is_hidden_test_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -47,11 +47,11 @@ ad_is_trivial_test_alg_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_is_trivial_test_alg_C2 calls"); + static Profile_counter calls("IA ad_is_hidden_test_alg_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_is_trivial_test_alg_C2( + return ad_is_hidden_test_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -62,11 +62,11 @@ ad_is_trivial_test_alg_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_is_trivial_test_alg_C2 failures"); + static Profile_counter failures("IA ad_is_hidden_test_alg_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_is_trivial_test_alg_C2( + return ad_is_hidden_test_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -84,7 +84,7 @@ static #endif /* inline */ bool -ad_is_trivial_test_naive_C2( +ad_is_hidden_test_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -95,11 +95,11 @@ ad_is_trivial_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_is_trivial_test_naive_C2 calls"); + static Profile_counter calls("IA ad_is_hidden_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_is_trivial_test_naive_C2( + return ad_is_hidden_test_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -110,11 +110,11 @@ ad_is_trivial_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_is_trivial_test_naive_C2 failures"); + static Profile_counter failures("IA ad_is_hidden_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_is_trivial_test_naive_C2( + return ad_is_hidden_test_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -132,7 +132,7 @@ static #endif /* CGAL_MEDIUM_INLINE */ Comparison_result -compare_ad_distances_test_alg1_C2( +compare_ad_distances_test_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -145,11 +145,11 @@ compare_ad_distances_test_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA compare_ad_distances_test_alg1_C2 calls"); + static Profile_counter calls("IA compare_ad_distances_test_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return compare_ad_distances_test_alg1_C2( + return compare_ad_distances_test_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -162,11 +162,11 @@ compare_ad_distances_test_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA compare_ad_distances_test_alg1_C2 failures"); + static Profile_counter failures("IA compare_ad_distances_test_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return compare_ad_distances_test_alg1_C2( + return compare_ad_distances_test_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -186,7 +186,7 @@ static #endif /* CGAL_MEDIUM_INLINE */ Comparison_result -compare_ad_distances_test_naive_C2( +compare_ad_distances_test_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -199,11 +199,11 @@ compare_ad_distances_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA compare_ad_distances_test_naive_C2 calls"); + static Profile_counter calls("IA compare_ad_distances_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return compare_ad_distances_test_naive_C2( + return compare_ad_distances_test_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -216,11 +216,11 @@ compare_ad_distances_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA compare_ad_distances_test_naive_C2 failures"); + static Profile_counter failures("IA compare_ad_distances_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return compare_ad_distances_test_naive_C2( + return compare_ad_distances_test_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -240,7 +240,7 @@ static #endif /* */ Sign -ad_incircle_test_naive_C2( +ad_incircle_test_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -254,11 +254,11 @@ ad_incircle_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_incircle_test_naive_C2 calls"); + static Profile_counter calls("IA ad_incircle_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_incircle_test_naive_C2( + return ad_incircle_test_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -272,11 +272,11 @@ ad_incircle_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_incircle_test_naive_C2 failures"); + static Profile_counter failures("IA ad_incircle_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_incircle_test_naive_C2( + return ad_incircle_test_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -297,7 +297,7 @@ static #endif /* */ Sign -ad_incircle_test_alg1_C2( +ad_incircle_test_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -311,11 +311,11 @@ ad_incircle_test_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_incircle_test_alg1_C2 calls"); + static Profile_counter calls("IA ad_incircle_test_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_incircle_test_alg1_C2( + return ad_incircle_test_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -329,11 +329,11 @@ ad_incircle_test_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_incircle_test_alg1_C2 failures"); + static Profile_counter failures("IA ad_incircle_test_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_incircle_test_alg1_C2( + return ad_incircle_test_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -411,7 +411,7 @@ static #endif /* */ Sign -ad_incircle_test_naive_C2( +ad_incircle_test_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -428,11 +428,11 @@ ad_incircle_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_incircle_test_naive_C2 calls"); + static Profile_counter calls("IA ad_incircle_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_incircle_test_naive_C2( + return ad_incircle_test_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -449,11 +449,11 @@ ad_incircle_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_incircle_test_naive_C2 failures"); + static Profile_counter failures("IA ad_incircle_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_incircle_test_naive_C2( + return ad_incircle_test_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -477,7 +477,7 @@ static #endif /* */ Sign -ad_incircle_test_alg1_C2( +ad_incircle_test_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -494,11 +494,11 @@ ad_incircle_test_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_incircle_test_alg1_C2 calls"); + static Profile_counter calls("IA ad_incircle_test_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_incircle_test_alg1_C2( + return ad_incircle_test_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -515,11 +515,11 @@ ad_incircle_test_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_incircle_test_alg1_C2 failures"); + static Profile_counter failures("IA ad_incircle_test_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_incircle_test_alg1_C2( + return ad_incircle_test_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -609,7 +609,7 @@ static #endif /* */ bool -ad_finite_edge_test_naive_C2( +ad_finite_edge_test_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -630,11 +630,11 @@ ad_finite_edge_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_finite_edge_test_naive_C2 calls"); + static Profile_counter calls("IA ad_finite_edge_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_finite_edge_test_naive_C2( + return ad_finite_edge_test_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -655,11 +655,11 @@ ad_finite_edge_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_finite_edge_test_naive_C2 failures"); + static Profile_counter failures("IA ad_finite_edge_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_finite_edge_test_naive_C2( + return ad_finite_edge_test_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -687,7 +687,7 @@ static #endif /* */ bool -ad_finite_edge_test_alg1_C2( +ad_finite_edge_test_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -708,11 +708,11 @@ ad_finite_edge_test_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_finite_edge_test_alg1_C2 calls"); + static Profile_counter calls("IA ad_finite_edge_test_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_finite_edge_test_alg1_C2( + return ad_finite_edge_test_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -733,11 +733,11 @@ ad_finite_edge_test_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_finite_edge_test_alg1_C2 failures"); + static Profile_counter failures("IA ad_finite_edge_test_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_finite_edge_test_alg1_C2( + return ad_finite_edge_test_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -843,7 +843,7 @@ static #endif /* */ bool -ad_finite_edge_test_degenerated_naive_C2( +ad_finite_edge_test_degenerated_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -858,11 +858,11 @@ ad_finite_edge_test_degenerated_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_finite_edge_test_degenerated_naive_C2 calls"); + static Profile_counter calls("IA ad_finite_edge_test_degenerated_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_finite_edge_test_degenerated_naive_C2( + return ad_finite_edge_test_degenerated_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -877,11 +877,11 @@ ad_finite_edge_test_degenerated_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_finite_edge_test_degenerated_naive_C2 failures"); + static Profile_counter failures("IA ad_finite_edge_test_degenerated_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_finite_edge_test_degenerated_naive_C2( + return ad_finite_edge_test_degenerated_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -903,7 +903,7 @@ static #endif /* */ bool -ad_finite_edge_test_degenerated_alg1_C2( +ad_finite_edge_test_degenerated_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -918,11 +918,11 @@ ad_finite_edge_test_degenerated_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_finite_edge_test_degenerated_alg1_C2 calls"); + static Profile_counter calls("IA ad_finite_edge_test_degenerated_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_finite_edge_test_degenerated_alg1_C2( + return ad_finite_edge_test_degenerated_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -937,11 +937,11 @@ ad_finite_edge_test_degenerated_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_finite_edge_test_degenerated_alg1_C2 failures"); + static Profile_counter failures("IA ad_finite_edge_test_degenerated_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_finite_edge_test_degenerated_alg1_C2( + return ad_finite_edge_test_degenerated_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -1023,7 +1023,7 @@ static #endif /* */ bool -ad_finite_edge_test_degenerated_naive_C2( +ad_finite_edge_test_degenerated_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -1041,11 +1041,11 @@ ad_finite_edge_test_degenerated_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_finite_edge_test_degenerated_naive_C2 calls"); + static Profile_counter calls("IA ad_finite_edge_test_degenerated_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_finite_edge_test_degenerated_naive_C2( + return ad_finite_edge_test_degenerated_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -1063,11 +1063,11 @@ ad_finite_edge_test_degenerated_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_finite_edge_test_degenerated_naive_C2 failures"); + static Profile_counter failures("IA ad_finite_edge_test_degenerated_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_finite_edge_test_degenerated_naive_C2( + return ad_finite_edge_test_degenerated_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -1092,7 +1092,7 @@ static #endif /* */ bool -ad_finite_edge_test_degenerated_alg1_C2( +ad_finite_edge_test_degenerated_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -1110,11 +1110,11 @@ ad_finite_edge_test_degenerated_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_finite_edge_test_degenerated_alg1_C2 calls"); + static Profile_counter calls("IA ad_finite_edge_test_degenerated_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_finite_edge_test_degenerated_alg1_C2( + return ad_finite_edge_test_degenerated_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -1132,11 +1132,11 @@ ad_finite_edge_test_degenerated_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_finite_edge_test_degenerated_alg1_C2 failures"); + static Profile_counter failures("IA ad_finite_edge_test_degenerated_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_finite_edge_test_degenerated_alg1_C2( + return ad_finite_edge_test_degenerated_ring_C2( x1.exact(), y1.exact(), w1.exact(), @@ -1230,7 +1230,7 @@ static #endif /* */ bool -ad_infinite_edge_test_naive_C2( +ad_infinite_edge_test_sqrtf_C2( const Filtered_exact &x2, const Filtered_exact &y2, const Filtered_exact &w2, @@ -1248,11 +1248,11 @@ ad_infinite_edge_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_infinite_edge_test_naive_C2 calls"); + static Profile_counter calls("IA ad_infinite_edge_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_infinite_edge_test_naive_C2( + return ad_infinite_edge_test_sqrtf_C2( x2.interval(), y2.interval(), w2.interval(), @@ -1270,11 +1270,11 @@ ad_infinite_edge_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_infinite_edge_test_naive_C2 failures"); + static Profile_counter failures("IA ad_infinite_edge_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_infinite_edge_test_naive_C2( + return ad_infinite_edge_test_sqrtf_C2( x2.exact(), y2.exact(), w2.exact(), @@ -1299,7 +1299,7 @@ static #endif /* */ bool -ad_infinite_edge_test_alg1_C2( +ad_infinite_edge_test_ring_C2( const Filtered_exact &x2, const Filtered_exact &y2, const Filtered_exact &w2, @@ -1317,11 +1317,11 @@ ad_infinite_edge_test_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_infinite_edge_test_alg1_C2 calls"); + static Profile_counter calls("IA ad_infinite_edge_test_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_infinite_edge_test_alg1_C2( + return ad_infinite_edge_test_ring_C2( x2.interval(), y2.interval(), w2.interval(), @@ -1339,11 +1339,11 @@ ad_infinite_edge_test_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_infinite_edge_test_alg1_C2 failures"); + static Profile_counter failures("IA ad_infinite_edge_test_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_infinite_edge_test_alg1_C2( + return ad_infinite_edge_test_ring_C2( x2.exact(), y2.exact(), w2.exact(), @@ -1437,7 +1437,7 @@ static #endif /* */ bool -ad_is_degenerate_edge_test_naive_C2( +ad_is_degenerate_edge_test_sqrtf_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -1454,11 +1454,11 @@ ad_is_degenerate_edge_test_naive_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_is_degenerate_edge_test_naive_C2 calls"); + static Profile_counter calls("IA ad_is_degenerate_edge_test_sqrtf_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_is_degenerate_edge_test_naive_C2( + return ad_is_degenerate_edge_test_sqrtf_C2( x1.interval(), y1.interval(), w1.interval(), @@ -1475,11 +1475,11 @@ ad_is_degenerate_edge_test_naive_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_is_degenerate_edge_test_naive_C2 failures"); + static Profile_counter failures("IA ad_is_degenerate_edge_test_sqrtf_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_is_degenerate_edge_test_naive_C2( + return ad_is_degenerate_edge_test_sqrtf_C2( x1.exact(), y1.exact(), w1.exact(), @@ -1503,7 +1503,7 @@ static #endif /* */ bool -ad_is_degenerate_edge_test_alg1_C2( +ad_is_degenerate_edge_test_ring_C2( const Filtered_exact &x1, const Filtered_exact &y1, const Filtered_exact &w1, @@ -1520,11 +1520,11 @@ ad_is_degenerate_edge_test_alg1_C2( try { #ifdef CGAL_PROFILE - static Profile_counter calls("IA ad_is_degenerate_edge_test_alg1_C2 calls"); + static Profile_counter calls("IA ad_is_degenerate_edge_test_ring_C2 calls"); ++calls; #endif Protect_FPU_rounding Protection; - return ad_is_degenerate_edge_test_alg1_C2( + return ad_is_degenerate_edge_test_ring_C2( x1.interval(), y1.interval(), w1.interval(), @@ -1541,11 +1541,11 @@ ad_is_degenerate_edge_test_alg1_C2( catch (Interval_nt_advanced::unsafe_comparison) { #ifdef CGAL_PROFILE - static Profile_counter failures("IA ad_is_degenerate_edge_test_alg1_C2 failures"); + static Profile_counter failures("IA ad_is_degenerate_edge_test_ring_C2 failures"); ++failures; #endif Protect_FPU_rounding Protection(CGAL_FE_TONEAREST); - return ad_is_degenerate_edge_test_alg1_C2( + return ad_is_degenerate_edge_test_ring_C2( x1.exact(), y1.exact(), w1.exact(), diff --git a/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_ftC2.h b/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_ftC2.h index f7aeab83147..e9429fcb329 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_ftC2.h +++ b/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_ftC2.h @@ -9,8 +9,6 @@ #include #include -#include - CGAL_BEGIN_NAMESPACE //-------------------------------------------------------------------- @@ -18,7 +16,7 @@ CGAL_BEGIN_NAMESPACE template< class RT > inline bool -ad_is_trivial_test_alg_C2(const RT &x1, const RT &y1, const RT &w1, +ad_is_hidden_test_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2) { #ifdef AG2_PROFILE_PREDICATES @@ -39,8 +37,8 @@ ad_is_trivial_test_alg_C2(const RT &x1, const RT &y1, const RT &w1, template< class RT > inline bool -ad_is_trivial_test_naive_C2(const RT &x1, const RT &y1, const RT &w1, - const RT &x2, const RT &y2, const RT &w2) +ad_is_hidden_test_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, + const RT &x2, const RT &y2, const RT &w2) { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::is_trivial_counter++; @@ -59,7 +57,7 @@ ad_is_trivial_test_naive_C2(const RT &x1, const RT &y1, const RT &w1, template< class RT > CGAL_MEDIUM_INLINE Comparison_result -compare_ad_distances_test_alg1_C2(const RT &x1, const RT &y1, const RT &w1, +compare_ad_distances_test_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, const RT & x, const RT & y) { @@ -95,25 +93,13 @@ compare_ad_distances_test_alg1_C2(const RT &x1, const RT &y1, const RT &w1, return ((s == POSITIVE) ? LARGER : ((s == ZERO) ? EQUAL : SMALLER)); } -template< class RT > -/*CGAL_NO_FILTER*/ -inline -Comparison_result -compare_ad_distances_test_alg2_C2(const RT &x1, const RT &y1, const RT &w1, - const RT &x2, const RT &y2, const RT &w2, - const RT & x, const RT & y) -{ - return - compare_ad_distances_test_alg2_C2(x1, y1, w1, x2, y2, w2, x, y); -} - //-------------------------------------------------------------------- template< class RT > CGAL_MEDIUM_INLINE Comparison_result -compare_ad_distances_test_naive_C2(const RT &x1, const RT &y1, const RT &w1, +compare_ad_distances_test_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, const RT & x, const RT & y) { @@ -191,7 +177,7 @@ bounded_side_of_segment(const RT& x1, const RT& y1, template < class RT > Sign -ad_incircle_test_naive_C2(const RT &x1, const RT &y1, +ad_incircle_test_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -208,13 +194,13 @@ ad_incircle_test_naive_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Incircle_test f; - return f(p1, p2, q, Naive_tag() ); + return f(p1, p2, q, Sqrt_field_tag() ); } template < class RT > Sign -ad_incircle_test_alg1_C2(const RT &x1, const RT &y1, +ad_incircle_test_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -233,30 +219,7 @@ ad_incircle_test_alg1_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Incircle_test f; - return f(p1, p2, q, Algebraic1_tag() ); -} - - -template < class RT > -Sign -ad_incircle_test_alg2_C2(const RT &x1, const RT &y1, - const RT &w1, - const RT &x2, const RT &y2, - const RT &w2, - const RT &qx, const RT &qy, - const RT &qw) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p1(Point(x1, y1), w1); - Weighted_point p2(Point(x2, y2), w2); - Weighted_point q(Point(qx, qy), qw); - - Incircle_test f; - return f(p1, p2, q, Algebraic2_tag() ); + return f(p1, p2, q, Ring_tag() ); } @@ -266,7 +229,7 @@ ad_incircle_test_alg2_C2(const RT &x1, const RT &y1, template < class RT > Sign -ad_incircle_test_naive_C2(const RT &x1, const RT &y1, +ad_incircle_test_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -286,13 +249,13 @@ ad_incircle_test_naive_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Incircle_test f; - return f(p1, p2, p3, q, Naive_tag() ); + return f(p1, p2, p3, q, Sqrt_field_tag() ); } template < class RT > Sign -ad_incircle_test_alg1_C2(const RT &x1, const RT &y1, +ad_incircle_test_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -312,44 +275,17 @@ ad_incircle_test_alg1_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Incircle_test f; - return f(p1, p2, p3, q, Algebraic1_tag() ); + return f(p1, p2, p3, q, Ring_tag() ); } -template < class RT > -Sign -ad_incircle_test_alg2_C2(const RT &x1, const RT &y1, - const RT &w1, - const RT &x2, const RT &y2, - const RT &w2, - const RT &x3, const RT &y3, - const RT &w3, - const RT &qx, const RT &qy, - const RT &qw) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p1(Point(x1, y1), w1); - Weighted_point p2(Point(x2, y2), w2); - Weighted_point p3(Point(x3, y3), w3); - Weighted_point q(Point(qx, qy), qw); - - Incircle_test f; - return f(p1, p2, p3, q, Algebraic2_tag() ); -} - - - //-------------------------------------------------------------------- template < class RT > bool -ad_finite_edge_test_naive_C2(const RT &x1, const RT &y1, +ad_finite_edge_test_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -372,12 +308,12 @@ ad_finite_edge_test_naive_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Finite_edge_test f; - return f(p1, p2, p3, p4, q, b, Naive_tag() ); + return f(p1, p2, p3, p4, q, b, Sqrt_field_tag() ); } template < class RT > bool -ad_finite_edge_test_alg1_C2(const RT &x1, const RT &y1, +ad_finite_edge_test_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -402,42 +338,15 @@ ad_finite_edge_test_alg1_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Finite_edge_test f; - return f(p1, p2, p3, p4, q, b, Algebraic1_tag() ); + return f(p1, p2, p3, p4, q, b, Ring_tag() ); } -template < class RT > -bool -ad_finite_edge_test_alg2_C2(const RT &x1, const RT &y1, - const RT &w1, - const RT &x2, const RT &y2, - const RT &w2, - const RT &x3, const RT &y3, - const RT &w3, - const RT &x4, const RT &y4, - const RT &w4, - const RT &qx, const RT &qy, - const RT &qw, bool b) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p1(Point(x1, y1), w1); - Weighted_point p2(Point(x2, y2), w2); - Weighted_point p3(Point(x3, y3), w3); - Weighted_point p4(Point(x4, y4), w4); - Weighted_point q(Point(qx, qy), qw); - - Finite_edge_test f; - return f(p1, p2, p3, p4, q, b, Algebraic2_tag() ); -} //-------------------------------------------------------------------- template < class RT > bool -ad_finite_edge_test_degenerated_naive_C2(const RT &x1, const RT &y1, +ad_finite_edge_test_degenerated_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -454,12 +363,12 @@ ad_finite_edge_test_degenerated_naive_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Finite_edge_test_degenerated f; - return f(p1, p2, q, b, Naive_tag() ); + return f(p1, p2, q, b, Sqrt_field_tag() ); } template < class RT > bool -ad_finite_edge_test_degenerated_alg1_C2(const RT &x1, const RT &y1, +ad_finite_edge_test_degenerated_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -478,36 +387,13 @@ ad_finite_edge_test_degenerated_alg1_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Finite_edge_test_degenerated f; - return f(p1, p2, q, b, Algebraic1_tag() ); + return f(p1, p2, q, b, Ring_tag() ); } -template < class RT > -bool -ad_finite_edge_test_degenerated_alg2_C2(const RT &x1, const RT &y1, - const RT &w1, - const RT &x2, const RT &y2, - const RT &w2, - const RT &qx, const RT &qy, - const RT &qw, bool b) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p1(Point(x1, y1), w1); - Weighted_point p2(Point(x2, y2), w2); - Weighted_point q(Point(qx, qy), qw); - - Finite_edge_test_degenerated f; - return f(p1, p2, q, b, Algebraic2_tag() ); -} - - template < class RT > bool -ad_finite_edge_test_degenerated_naive_C2(const RT &x1, const RT &y1, +ad_finite_edge_test_degenerated_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -527,13 +413,13 @@ ad_finite_edge_test_degenerated_naive_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Finite_edge_test_degenerated f; - return f(p1, p2, p3, q, b, Naive_tag() ); + return f(p1, p2, p3, q, b, Sqrt_field_tag() ); } template < class RT > bool -ad_finite_edge_test_degenerated_alg1_C2(const RT &x1, const RT &y1, +ad_finite_edge_test_degenerated_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -553,40 +439,14 @@ ad_finite_edge_test_degenerated_alg1_C2(const RT &x1, const RT &y1, Weighted_point q(Point(qx, qy), qw); Finite_edge_test_degenerated f; - return f(p1, p2, p3, q, b, Algebraic1_tag() ); + return f(p1, p2, p3, q, b, Ring_tag() ); } -template < class RT > -bool -ad_finite_edge_test_degenerated_alg2_C2(const RT &x1, const RT &y1, - const RT &w1, - const RT &x2, const RT &y2, - const RT &w2, - const RT &x3, const RT &y3, - const RT &w3, - const RT &qx, const RT &qy, - const RT &qw, bool b) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p1(Point(x1, y1), w1); - Weighted_point p2(Point(x2, y2), w2); - Weighted_point p3(Point(x3, y3), w3); - Weighted_point q(Point(qx, qy), qw); - - Finite_edge_test_degenerated f; - return f(p1, p2, p3, q, b, Algebraic2_tag() ); -} - - //-------------------------------------------------------------------- template < class RT > bool -ad_infinite_edge_test_naive_C2(const RT &x2, const RT &y2, +ad_infinite_edge_test_sqrtf_C2(const RT &x2, const RT &y2, const RT &w2, const RT &x3, const RT &y3, const RT &w3, @@ -606,12 +466,12 @@ ad_infinite_edge_test_naive_C2(const RT &x2, const RT &y2, Weighted_point q(Point(qx, qy), qw); Infinite_edge_test f; - return f(p2, p3, p4, q, b, Naive_tag() ); + return f(p2, p3, p4, q, b, Sqrt_field_tag() ); } template < class RT > bool -ad_infinite_edge_test_alg1_C2(const RT &x2, const RT &y2, +ad_infinite_edge_test_ring_C2(const RT &x2, const RT &y2, const RT &w2, const RT &x3, const RT &y3, const RT &w3, @@ -633,32 +493,7 @@ ad_infinite_edge_test_alg1_C2(const RT &x2, const RT &y2, Weighted_point q(Point(qx, qy), qw); Infinite_edge_test f; - return f(p2, p3, p4, q, b, Algebraic1_tag() ); -} - -template < class RT > -bool -ad_infinite_edge_test_alg2_C2(const RT &x2, const RT &y2, - const RT &w2, - const RT &x3, const RT &y3, - const RT &w3, - const RT &x4, const RT &y4, - const RT &w4, - const RT &qx, const RT &qy, - const RT &qw, bool b) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p2(Point(x2, y2), w2); - Weighted_point p3(Point(x3, y3), w3); - Weighted_point p4(Point(x4, y4), w4); - Weighted_point q(Point(qx, qy), qw); - - Infinite_edge_test f; - return f(p2, p3, p4, q, b, Algebraic2_tag() ); + return f(p2, p3, p4, q, b, Ring_tag() ); } @@ -667,7 +502,7 @@ ad_infinite_edge_test_alg2_C2(const RT &x2, const RT &y2, template < class RT > bool -ad_is_degenerate_edge_test_naive_C2(const RT &x1, const RT &y1, +ad_is_degenerate_edge_test_sqrtf_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -687,12 +522,12 @@ ad_is_degenerate_edge_test_naive_C2(const RT &x1, const RT &y1, Weighted_point p4(Point(x4, y4), w4); Is_degenerate_edge_test f; - return f(p1, p2, p3, p4, Naive_tag() ); + return f(p1, p2, p3, p4, Sqrt_field_tag() ); } template < class RT > bool -ad_is_degenerate_edge_test_alg1_C2(const RT &x1, const RT &y1, +ad_is_degenerate_edge_test_ring_C2(const RT &x1, const RT &y1, const RT &w1, const RT &x2, const RT &y2, const RT &w2, @@ -712,33 +547,7 @@ ad_is_degenerate_edge_test_alg1_C2(const RT &x1, const RT &y1, Weighted_point p4(Point(x4, y4), w4); Is_degenerate_edge_test f; - return f(p1, p2, p3, p4, Algebraic1_tag() ); -} - - -template < class RT > -bool -ad_is_degenerate_edge_test_alg2_C2(const RT &x1, const RT &y1, - const RT &w1, - const RT &x2, const RT &y2, - const RT &w2, - const RT &x3, const RT &y3, - const RT &w3, - const RT &x4, const RT &y4, - const RT &w4) -{ - typedef Simple_cartesian R; - typedef Point_2 Point; - typedef RT Weight; - typedef Weighted_point Weighted_point; - - Weighted_point p1(Point(x1, y1), w1); - Weighted_point p2(Point(x2, y2), w2); - Weighted_point p3(Point(x3, y3), w3); - Weighted_point p4(Point(x4, y4), w4); - - Is_degenerate_edge_test f; - return f(p1, p2, p3, p4, Algebraic2_tag() ); + return f(p1, p2, p3, p4, Ring_tag() ); } diff --git a/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_predicates_C2.h b/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_predicates_C2.h index f3748669d35..daf25f7db18 100644 --- a/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_predicates_C2.h +++ b/Packages/Apollonius_graph_2/include/CGAL/predicates/Apollonius_graph_predicates_C2.h @@ -11,8 +11,6 @@ #include #include -#include - CGAL_BEGIN_NAMESPACE @@ -28,22 +26,20 @@ public: public: inline - Sign operator()(const Voronoi_radius& vr, Naive_tag ) + Sign operator()(const Voronoi_radius& vr, Sqrt_field_tag ) { FT r = vr.c1() + vr.c2() * CGAL_NTS sqrt(vr.delta()); return CGAL_NTS sign(r); } + inline - Sign operator()(const Voronoi_radius& vr, Algebraic3_tag ) + Sign operator()(const Voronoi_radius& vr, Ring_tag ) { - return sign_a_plus_b_x_sqrt_c(vr.c1(), vr.c2(), vr.delta()); - } + // this is another way of doing this; the degree becomes 10 + // instead of 5 in this case. + // return sign_a_plus_b_x_sqrt_c(vr.c1(), vr.c2(), vr.delta()); - - template - Sign operator()(const Voronoi_radius& vr, Algebraic_tag ) - { bool is_first_root = CGAL_NTS is_negative(vr.c2()); Sign s_beta = CGAL_NTS sign(vr.b()); @@ -93,7 +89,8 @@ public: public: Sign - operator()(const Bitangent_line& bl, const Weighted_point& q, Naive_tag) + operator()(const Bitangent_line& bl, const Weighted_point& q, + Sqrt_field_tag) { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::distance_from_bitangent_counter++; @@ -105,9 +102,8 @@ public: return CGAL_NTS sign(r); } - template Sign - operator()(const Bitangent_line& bl, const Weighted_point& q, Algebraic_tag) + operator()(const Bitangent_line& bl, const Weighted_point& q, Ring_tag) { #ifdef AG2_PROFILE_PREDICATES ag2_predicate_profiler::distance_from_bitangent_counter++; @@ -134,7 +130,7 @@ public: Sign operator()(const Bitangent_line& bl, - const Inverted_weighted_point& v, Naive_tag) + const Inverted_weighted_point& v, Sqrt_field_tag) { FT a = bl.a1() + bl.a2() * CGAL_NTS sqrt(bl.delta()); FT b = bl.b1() + bl.b2() * CGAL_NTS sqrt(bl.delta()); @@ -143,10 +139,9 @@ public: return CGAL_NTS sign(r); } - template Sign operator()(const Bitangent_line& bl, - const Inverted_weighted_point& v, Algebraic_tag) + const Inverted_weighted_point& v, Ring_tag) { FT A = bl.a1() * v.x() + bl.b1() * v.y() + bl.c1() * v.p() - v.weight() * bl.d(); @@ -195,7 +190,7 @@ public: private: Orientation orientation(const Bitangent_line& l, const Point& p, - Naive_tag) const + Sqrt_field_tag) const { FT A = l.a1() * p.x() + l.b1() * p.y() + l.c1(); FT B = l.a2() * p.x() + l.b2() * p.y() + l.c2(); @@ -203,10 +198,9 @@ private: return CGAL_NTS sign(P); } - template Orientation orientation(const Bitangent_line& l, const Point& p, - Algebraic_tag) const + Ring_tag) const { FT A = l.a1() * p.x() + l.b1() * p.y() + l.c1(); FT B = l.a2() * p.x() + l.b2() * p.y() + l.c2(); @@ -286,7 +280,7 @@ public: Orientation operator()(const Voronoi_circle& vc, const Point& p1, - const Point& p2, Naive_tag) + const Point& p2, Sqrt_field_tag) { FT a = vc.a1() + vc.a2() * CGAL_NTS sqrt(vc.delta()); FT b = vc.b1() + vc.b2() * CGAL_NTS sqrt(vc.delta()); @@ -294,10 +288,9 @@ public: return CGAL_NTS sign(det); } - template Orientation operator()(const Voronoi_circle& vc, const Point& p1, - const Point& p2, Algebraic_tag) + const Point& p2, Ring_tag) { FT dx = p2.x() - p1.x(); FT dy = p2.y() - p1.y(); @@ -378,7 +371,7 @@ private: public: Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - Naive_tag) + Sqrt_field_tag) { FT c1 = (vc1.c1() + vc1.c2() * CGAL_NTS sqrt(vc1.delta())) / vc1.d(); FT c2 = (vc2.c1() + vc2.c2() * CGAL_NTS sqrt(vc2.delta())) / vc2.d(); @@ -387,9 +380,12 @@ public: return r; } + // this is the naive way but without divisions and square roots; the + // degree becomes 36 in this case. + /* Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - Algebraic3_tag) + Ring_tag) { FT A = vc1.c1() * vc2.d() - vc2.c1() * vc1.d(); FT B = vc1.c2() * vc2.d(); @@ -402,11 +398,11 @@ public: if ( s == ZERO ) { return EQUAL; } return ( s == POSITIVE ) ? SMALLER : LARGER; } - + */ Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - Algebraic1_tag) + Ring_tag) { bool is_first_root1 = vc1.is_first_root(); bool is_first_root2 = vc2.is_first_root(); @@ -445,9 +441,11 @@ public: return ( r == LARGER ) ? SMALLER : LARGER; } + // this uses the DFMT trees; slightly slower but same degree (20). + /* Comparison_result operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2, - Algebraic2_tag) + Ring_tag) { bool is_first_root1 = vc1.is_first_root(); bool is_first_root2 = vc2.is_first_root(); @@ -473,7 +471,7 @@ public: if ( r == EQUAL ) { return EQUAL; } return ( r == LARGER ) ? SMALLER : LARGER; } - + */ }; @@ -893,7 +891,7 @@ public: } Sign chi2(const Bitangent_line& bl1, - const Bitangent_line& bl2, Naive_tag) const + const Bitangent_line& bl2, Sqrt_field_tag) const { FT sigma = bl1.dx() * bl2.dx() + bl1.dy() * bl2.dy(); FT delta = bl1.dx() * bl2.dy() - bl1.dy() * bl2.dx(); @@ -913,10 +911,9 @@ public: return CGAL_NTS sign(E); } - template< class Algebraic_tag> inline Sign chi2(const Bitangent_line& bl1, - const Bitangent_line& bl2, Algebraic_tag) const + const Bitangent_line& bl2, Ring_tag) const { return chi2(bl1.dx(), bl1.dy(), -bl1.dw(), bl1.d(), bl1.delta(), bl2.dx(), bl2.dy(), -bl2.dw(), bl2.d(), bl2.delta());