From 0e823324c9507e1457f1639b836998ac4f85ff0a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Oct 2022 15:49:17 +0200 Subject: [PATCH 01/42] Allow to use an Epick-like kernel with float as FT --- .../Kernel_23/include/CGAL/_approx_equal.h | 4 ++++ .../CGAL/_test_cls_aff_transformation_2.h | 2 +- .../CGAL/_test_cls_aff_transformation_3.h | 2 +- .../include/CGAL/_test_cls_circle_2.h | 2 +- .../include/CGAL/_test_cls_sphere_3.h | 2 +- .../CGAL/_test_fct_points_implicit_sphere.h | 2 +- .../include/CGAL/_test_further_fct_point_2.h | 2 +- .../CGAL/Mesh_2/Lipschitz_sizing_field_2.h | 3 ++- .../Mesh_3/mesh_cubes_intersection.cpp | 3 +-- .../mesh_cubes_intersection_with_features.cpp | 3 +-- .../examples/Mesh_3/mesh_implicit_domains.cpp | 2 +- .../Mesh_3/mesh_implicit_domains_2.cpp | 2 +- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 6 +++--- .../CGAL/Mesh_3/Protect_edges_sizing_field.h | 4 ++-- .../Mesh_3/test_mesh_criteria_creation.cpp | 18 +++++++++--------- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 2 +- .../segment_cell_traverser_3.cpp | 12 ++++++------ 17 files changed, 37 insertions(+), 34 deletions(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_approx_equal.h b/Kernel_23/test/Kernel_23/include/CGAL/_approx_equal.h index 361d0800554..3cae842a0cd 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_approx_equal.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_approx_equal.h @@ -12,6 +12,10 @@ bool approx_equal(double a, double b) { return std::abs(boost::math::float_distance(a, b)) <= 1; } +bool approx_equal(float a, float b) { + return std::abs(boost::math::float_distance(a, b)) <= 1; +} + struct Xyz_tag {}; struct Xy_tag {}; diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index 4db9a3f3baf..433b9a8065f 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -29,7 +29,7 @@ _test_cls_aff_transformation_2(const R& ) typedef typename R::RT RT; typedef typename R::FT FT; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; typename R::Aff_transformation_2 ia; CGAL::Aff_transformation_2 a1(ia); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h index 0bfa059fa06..c7d24eed9a5 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h @@ -28,7 +28,7 @@ _test_cls_aff_transformation_3(const R& ) typedef typename R::RT RT; typedef typename R::FT FT; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; typename R::Aff_transformation_3 ia; CGAL::Aff_transformation_3 a1(ia); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_circle_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_circle_2.h index 6f9a1fe7be4..8c157a39307 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_circle_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_circle_2.h @@ -77,7 +77,7 @@ _test_cls_circle_2(const R& ) typename R::Circle_2 ic; CGAL::Circle_2 c0; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; RT n0 = 0; RT n1 = 16; diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_sphere_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_sphere_3.h index c71651a9439..4bc48fea9fe 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_sphere_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_sphere_3.h @@ -32,7 +32,7 @@ _test_cls_sphere_3(const R& ) typename R::Sphere_3 ic; CGAL::Sphere_3 c0; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; RT n0 = 0; RT n1 = 16; RT n2 = -4; diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_points_implicit_sphere.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_points_implicit_sphere.h index 137c092f1c7..7b0be2a4b12 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_points_implicit_sphere.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_points_implicit_sphere.h @@ -26,7 +26,7 @@ _test_fct_points_implicit_sphere(const R&) typedef typename R::FT FT; typedef CGAL::Tetrahedron_3 Tetrahedron; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; const RT RT0(0); const RT RT4(4); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_further_fct_point_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_further_fct_point_2.h index 5439cdbd8a8..846ab657875 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_further_fct_point_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_further_fct_point_2.h @@ -94,7 +94,7 @@ _test_further_fct_point_2(const R& ) using CGAL::testsuite::approx_equal; using CGAL::testsuite::Direction_2_tag; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; assert( approx_equal((p5 - CGAL::ORIGIN).direction(), dir5, Direction_2_tag()) ); diff --git a/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h b/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h index 156f0710185..77e2940b247 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h @@ -54,6 +54,7 @@ public: typedef Apollonius_graph_traits_2 Apollonius_traits; typedef Apollonius_graph_2 Apollonius_graph; typedef typename Apollonius_traits::Site_2 Site; + typedef typename Sizing_field_2::FT FT; public: typedef std::list Site_set_2; @@ -144,7 +145,7 @@ public: return *this; } - double operator()(const Point& p) const + FT operator()(const Point& p) const { if(points.empty() || points.size() == 1) return K; diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp index 90577147ecb..ca54e5b0178 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection.cpp @@ -24,8 +24,7 @@ using namespace CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point; -typedef K::FT FT; -typedef FT (*Function)(const Point&); +typedef double (*Function)(const Point&); typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper Function_wrapper; typedef Function_wrapper::Function_vector Function_vector; diff --git a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp index fd9f1780c62..da2a86d290b 100644 --- a/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_cubes_intersection_with_features.cpp @@ -25,8 +25,7 @@ using namespace CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef K::Point_3 Point; -typedef K::FT FT; -typedef FT (*Function)(const Point&); +typedef double (*Function)(const Point&); typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper Function_wrapper; typedef Function_wrapper::Function_vector Function_vector; diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp index 4d9187f5692..7701932deb2 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains.cpp @@ -22,7 +22,7 @@ typedef CGAL::Sequential_tag Concurrency_tag; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef FT_to_point_function_wrapper Function; +typedef FT_to_point_function_wrapper Function; typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper Function_wrapper; typedef Function_wrapper::Function_vector Function_vector; diff --git a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp index e3ec7922475..6a83c18fe52 100644 --- a/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp +++ b/Mesh_3/examples/Mesh_3/mesh_implicit_domains_2.cpp @@ -16,7 +16,7 @@ using namespace CGAL::parameters; // Domain typedef CGAL::Exact_predicates_inexact_constructions_kernel K; -typedef FT_to_point_function_wrapper Function; +typedef FT_to_point_function_wrapper Function; typedef CGAL::Implicit_multi_domain_to_labeling_function_wrapper Function_wrapper; typedef Function_wrapper::Function_vector Function_vector; diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 2ad57f27cc0..b44b47a7f41 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -937,7 +937,7 @@ public: * Warning: Here we don't check if cells are in c3t3 */ template - FT min_sliver_value(const Cell_vector& cells, + double min_sliver_value(const Cell_vector& cells, const SliverCriterion& criterion, const bool use_cache = true) const; @@ -3720,7 +3720,7 @@ number_of_incident_slivers(const Vertex_handle& v, template template -typename C3T3_helpers::FT +double C3T3_helpers:: min_sliver_value(const Cell_vector& cells, const SliverCriterion& criterion, @@ -3741,7 +3741,7 @@ min_sliver_value(const Cell_vector& cells, // //return *(std::min_element(make_transform_iterator(cells.begin(),sc_value), // make_transform_iterator(cells.end(),sc_value))); - FT min_value = criterion.get_max_value(); + double min_value = criterion.get_max_value(); for(typename Cell_vector::const_iterator it = cells.begin(); it != cells.end(); ++it) diff --git a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h index e12f3418da5..165c23df9c2 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h +++ b/Mesh_3/include/CGAL/Mesh_3/Protect_edges_sizing_field.h @@ -1366,8 +1366,8 @@ refine_balls() FT ra = get_radius(va); FT rb = get_radius(vb); - FT sa_new = (std::min)(ab/distance_divisor, ra); - FT sb_new = (std::min)(ab/distance_divisor, rb); + FT sa_new = (std::min)(FT(ab/distance_divisor), ra); + FT sb_new = (std::min)(FT(ab/distance_divisor), rb); // In case of va or vb have already been in conflict, keep minimal size if ( new_sizes.find(va) != new_sizes.end() ) diff --git a/Mesh_3/test/Mesh_3/test_mesh_criteria_creation.cpp b/Mesh_3/test/Mesh_3/test_mesh_criteria_creation.cpp index a29caa1ed73..b628560bbde 100644 --- a/Mesh_3/test/Mesh_3/test_mesh_criteria_creation.cpp +++ b/Mesh_3/test/Mesh_3/test_mesh_criteria_creation.cpp @@ -81,20 +81,20 @@ int main() Mc ec3(edge_sizing_field = 3.); assert( ec3.edge_criteria_object().sizing_field(bp1,1,index) == 3 ); - Mc ec4(edge_size = 4.1, - edge_sizing_field = Esf(4.2)); - assert( ec4.edge_criteria_object().sizing_field(bp1,1,index) == 4.1 ); + Mc ec4(edge_size = 4., + edge_sizing_field = Esf(5.)); + assert( ec4.edge_criteria_object().sizing_field(bp1,1,index) == 4. ); Mc ec5(sizing_field = 5.); assert( ec5.edge_criteria_object().sizing_field(bp1,1,index) == 5 ); - Mc ec6(sizing_field = 6.1, - edge_sizing_field = 6.2); - assert( ec6.edge_criteria_object().sizing_field(bp1,1,index) == 6.2 ); + Mc ec6(sizing_field = 6., + edge_sizing_field = 7.); + assert( ec6.edge_criteria_object().sizing_field(bp1,1,index) == 7. ); - Mc ec7(sizing_field = 7.1, - edge_size = 7.2); - assert( ec7.edge_criteria_object().sizing_field(bp1,1,index) == 7.2 ); + Mc ec7(sizing_field = 7., + edge_size = 8.); + assert( ec7.edge_criteria_object().sizing_field(bp1,1,index) == 8. ); // ----------------------------------- diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 3270d321e9b..d70460e1757 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -380,7 +380,7 @@ struct Tester if(!c3t3.is_in_complex(f)) continue; - max_sqd = (std::max)(max_sqd, + max_sqd = (std::max)(max_sqd, aabb_tree.squared_distance(CGAL::centroid(tr.triangle(f)))); } double hdist = std::sqrt(max_sqd); diff --git a/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp b/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp index e2caf46431e..c816a9a9a58 100644 --- a/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp +++ b/Triangulation_3/examples/Triangulation_3/segment_cell_traverser_3.cpp @@ -32,12 +32,12 @@ int main(int argc, char* argv[]) } //bbox - double xmin = points[0].x(); - double xmax = points[0].x(); - double ymin = points[0].y(); - double ymax = points[0].y(); - double zmin = points[0].z(); - double zmax = points[0].z(); + auto xmin = points[0].x(); + auto xmax = points[0].x(); + auto ymin = points[0].y(); + auto ymax = points[0].y(); + auto zmin = points[0].z(); + auto zmax = points[0].z(); for(const Point_3& p : points) { From 4e3d51cd2e7f986e584956ad7ff11b4b78f0440c Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Oct 2022 15:50:36 +0200 Subject: [PATCH 02/42] If FT is float then 1e-9 is bigger than the relative precision of float. --- Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp | 4 +++- Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp index 0d151fc1b9b..91a5aec31b9 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image.cpp @@ -1,3 +1,4 @@ +#define CGAL_MESH_3_VERBOSE 1 // Copyright (c) 2009 INRIA Sophia-Antipolis (France). // All rights reserved. // @@ -48,7 +49,7 @@ public: << CGAL::get_default_random().get_seed() << std::endl; Mesh_domain domain = Mesh_domain::create_labeled_image_mesh_domain (image, - 1e-9, + 1e-6, CGAL::parameters::p_rng = &CGAL::get_default_random()); // Set mesh criteria @@ -78,6 +79,7 @@ public: int main() { + std::cerr.precision(17); Image_tester<> test_epic; std::cerr << "Mesh generation from a 3D image:\n"; test_epic.image(); diff --git a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp index ed1a1fbd14b..8107c4cefb5 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp +++ b/Mesh_3/test/Mesh_3/test_meshing_3D_image_deprecated.cpp @@ -1,3 +1,4 @@ +#define CGAL_MESH_3_VERBOSE 1 #include #include "test_meshing_utilities.h" @@ -33,7 +34,7 @@ public: std::cout << "\tSeed is\t" << CGAL::get_default_random().get_seed() << std::endl; - Mesh_domain domain(image, 1e-9, &CGAL::get_default_random()); + Mesh_domain domain(image, 1e-6, &CGAL::get_default_random()); // Set mesh criteria Facet_criteria facet_criteria(25, 20*image.vx(), 5*image.vx()); From 026049cf8ed2649a7a64f5e63f45176acff7abe6 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 10 Oct 2022 16:15:01 +0200 Subject: [PATCH 03/42] Switch to Epick-with-float using a new macro If `CGAL_EPICK_SINGLE_PRECISION` is defined, then the number type of `CGAL::Epick` is `float` instead of `double`. --- .../CGAL/Exact_predicates_inexact_constructions_kernel.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h index 7574c83412e..c2428965769 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h @@ -26,9 +26,15 @@ namespace CGAL { // The following is equivalent to Filtered_kernel< Simple_cartesian >, // but it's shorter in terms of template name length (for error messages, mangling...). +#ifndef CGAL_EPICK_SINGLE_PRECISION +using Epick_number_type = double; +#else +using Epick_number_type = float; +#endif + class Epick : public Filtered_kernel_adaptor< - Type_equality_wrapper< Simple_cartesian::Base::Type, Epick >, + Type_equality_wrapper< Simple_cartesian::Base::Type, Epick >, #ifdef CGAL_NO_STATIC_FILTERS false > #else From 63f6c9de77ce35fdcc8a95b57677b31ce912d8fa Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 11 Oct 2022 10:56:48 +0200 Subject: [PATCH 04/42] avoid usage of min(double, float) --- .../experimental/Sizing_field_with_aabb_tree.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h index 0dcff62901b..41e4cf3d5df 100644 --- a/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h +++ b/Mesh_3/include/CGAL/Mesh_3/experimental/Sizing_field_with_aabb_tree.h @@ -177,7 +177,7 @@ struct Sizing_field_with_aabb_tree << ", index=#" << CGAL::IO::oformat(id) << "): "; } #endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY - double result = d_; + FT result = d_; if(dim == 0) { if(dt.dimension() < 1) { #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY @@ -218,7 +218,7 @@ struct Sizing_field_with_aabb_tree } const FT dist = CGAL_NTS sqrt(CGAL::squared_distance( nearest, p)); // std::cerr << (std::min)(dist / FT(1.5), d_) << "\n"; - result = (std::min)(dist / FT(2), result); + result = (std::min)(dist * FT(0.5), result); // now search in the AABB tree typename Corners_indices::const_iterator ids_it = corners_indices.find(p); @@ -240,10 +240,10 @@ struct Sizing_field_with_aabb_tree if(projection_traits.found()) { result = - (std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * + (std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * CGAL_NTS sqrt(CGAL::squared_distance(p, - projection_traits.closest_point())), + projection_traits.closest_point()))), result); #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY { @@ -312,10 +312,10 @@ struct Sizing_field_with_aabb_tree projection_traits.closest_point_and_primitive().second)) == 0); result = - (std::min)(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * + (std::min)(FT(0.9 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * CGAL_NTS sqrt(CGAL::squared_distance(p, - projection_traits.closest_point())), + projection_traits.closest_point()))), result); #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY @@ -479,9 +479,9 @@ struct Sizing_field_with_aabb_tree std::cerr << " closest_point: " << closest_intersection << "\n" << " distance = " << CGAL_NTS sqrt(sqd_intersection) << std::endl; #endif // CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY - double new_result = - (std::min)(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * - CGAL_NTS sqrt(sqd_intersection), + FT new_result = + (std::min)(FT(0.45 / CGAL::sqrt(CGAL::Mesh_3::internal::weight_modifier) * + CGAL_NTS sqrt(sqd_intersection)), d_); #ifdef CGAL_MESH_3_PROTECTION_HIGH_VERBOSITY From 2696c11a8ff2b5c2abb9a528d28a8a87f8a57e4b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 11 Oct 2022 10:58:08 +0200 Subject: [PATCH 05/42] double/float inconsistency --- .../CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index 745f89bb1d2..a34f0b847bc 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -48,6 +48,7 @@ class Tetrahedral_remeshing_smoother typedef typename Tr::Geom_traits Gt; typedef typename Gt::Vector_3 Vector_3; typedef typename Gt::Point_3 Point_3; + typedef typename Gt::FT FT; private: typedef CGAL::Tetrahedral_remeshing::internal::FMLS FMLS; @@ -332,9 +333,9 @@ private: const CellRange& inc_cells, const Tr& /* tr */, #ifdef CGAL_TETRAHEDRAL_REMESHING_VERBOSE - double& total_move) + FT& total_move) #else - double&) + FT&) #endif { const typename Tr::Point backup = v->point(); //backup v's position From d279255f46294fee8b6fa43be0d2ad4deacc97a0 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Mon, 24 Oct 2022 10:23:19 +0200 Subject: [PATCH 06/42] fix number type --- SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h index 812bc87214c..ae6c070bec5 100644 --- a/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h +++ b/SMDS_3/include/CGAL/SMDS_3/tet_soup_to_c3t3.h @@ -576,7 +576,7 @@ bool build_triangulation_from_file(std::istream& is, is >> nv; for(int i=0; i> x >> y >> z >> ref; points.push_back(Point_3(x,y,z)); } From 752899b3fc4d26edcecaba353e446a5b879682d3 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 25 Oct 2022 17:29:31 +0200 Subject: [PATCH 07/42] more double/float conversions --- .../include/CGAL/Optimal_bounding_box/internal/evolution.h | 2 +- Point_set_processing_3/include/CGAL/scanline_orient_normals.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/evolution.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/evolution.h index 4680993e372..cbd67ca908b 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/evolution.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/evolution.h @@ -85,7 +85,7 @@ public: Simplex offspring; for(int j=0; j<4; ++j) { - const FT r{m_rng.get_double()}; + const FT r{m_rng.uniform_01()}; const FT fitnessA = m_population[group1[i]][j].fitness(); const FT fitnessB = m_population[group2[i]][j].fitness(); const FT threshold = (fitnessA < fitnessB) ? uweight : lweight; diff --git a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h index 02f956f2416..cafa7c3da5e 100644 --- a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h @@ -327,7 +327,7 @@ void orient_scanline (Iterator begin, Iterator end, const Point_3& p = get (point_map, *it); mean_x += p.x(); mean_y += p.y(); - max_z = (std::max)(max_z, p.z()); + max_z = (std::max)(max_z, (double)p.z()); ++ nb; } From f550bde444bf86a8aa514996512bdd167f8b176e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 25 Oct 2022 17:30:32 +0200 Subject: [PATCH 08/42] more double/float conversions --- .../include/CGAL/bilateral_smooth_point_set.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index 86fa5d23b19..fcf8a732db2 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -89,8 +89,8 @@ compute_denoise_projection( FT project_weight_sum = FT(0.0); Vector normal_sum = CGAL::NULL_VECTOR; - FT cos_sigma = cos(sharpness_angle * CGAL_PI / 180.0); - FT sharpness_bandwidth = CGAL::square((CGAL::max)(1e-8, 1 - cos_sigma)); + FT cos_sigma = cos((FT)(sharpness_angle * CGAL_PI / 180.0)); + FT sharpness_bandwidth = CGAL::square((CGAL::max)(FT(1e-8), FT(1.) - cos_sigma)); for (typename PointRange::iterator it : neighbor_pwns) { @@ -150,7 +150,7 @@ compute_max_spacing( boost::make_function_output_iterator ([&](const typename NeighborQuery::input_iterator& it) { - double dist2 = CGAL::squared_distance (get(point_map, vt), get(point_map, *it)); + FT dist2 = CGAL::squared_distance (get(point_map, vt), get(point_map, *it)); max_distance = (CGAL::max)(dist2, max_distance); })); From 63f9aa27e903dc3984acca0c53f01a4f9fd82788 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Wed, 26 Oct 2022 12:03:00 +0200 Subject: [PATCH 09/42] use c-cast instead of {}-cast * cast double to float is forbidden with {} because it loses information * cast double to float or to exact types is OK * numeric_limits does not work for exact types FT * using explicitely numeric_limits, is not an option either because casting it to exact FT would not work --- .../Optimal_bounding_box/internal/fitness_function.h | 12 ++++++++---- .../CGAL/Optimal_bounding_box/internal/optimize_2.h | 10 +++++++--- .../CGAL/Optimal_bounding_box/internal/population.h | 4 +++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h index 6d53f4308f3..e9372409e63 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h @@ -39,8 +39,10 @@ compute_fitness(const typename Traits::Matrix& R, // rotation matrix CGAL_assertion(points.size() >= 3); FT xmin, ymin, zmin, xmax, ymax, zmax; - xmin = ymin = zmin = FT{(std::numeric_limits::max)()}; - xmax = ymax = zmax = FT{std::numeric_limits::lowest()}; + //cast from double to float looses data, so cast with {} is not allowed + //cast from double to exact types also works + xmin = ymin = zmin = (FT)(std::numeric_limits::max)(); + xmax = ymax = zmax = (FT)std::numeric_limits::lowest(); for(const Point& pt : points) { @@ -81,8 +83,10 @@ compute_fitness_if_smaller(const typename Traits::Matrix& R, // rotation matrix CGAL_assertion(points.size() >= 3); FT xmin, ymin, zmin, xmax, ymax, zmax; - xmin = ymin = zmin = FT{(std::numeric_limits::max)()}; - xmax = ymax = zmax = FT{std::numeric_limits::lowest()}; + //cast from double to float looses data, so cast with {} is not allowed + //cast from double to exact types also works + xmin = ymin = zmin = (FT)(std::numeric_limits::max)(); + xmax = ymax = zmax = (FT)std::numeric_limits::lowest(); // compute every 1%, with a minimum of 1000 iterations const std::size_t pn = points.size(); diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h index 12b37586a41..126e4fb247a 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h @@ -104,7 +104,9 @@ compute_2D_deviation(const PointRange& points, if(theta > 0.25 * CGAL_PI) // @todo is there a point to this theta = 0.5 * CGAL_PI - theta; - return std::make_pair(pol.area(), FT{theta}); + //cast from double to float looses data, so cast with {} is not allowed + //cast from double to exact types also works + return std::make_pair(pol.area(), FT(theta)); } template @@ -123,8 +125,10 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot, rotated_points.reserve(points.size()); FT xmin, ymin, zmin, xmax, ymax, zmax; - xmin = ymin = zmin = FT{(std::numeric_limits::max)()}; - xmax = ymax = zmax = FT{std::numeric_limits::lowest()}; + //cast from double to float looses data, so cast with {} is not allowed + //cast from double to exact types also works + xmin = ymin = zmin = (FT)(std::numeric_limits::max)(); + xmax = ymax = zmax = (FT)std::numeric_limits::lowest(); for(const Point& pt : points) { diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h index b43430889b7..f0bea15b52c 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h @@ -121,7 +121,9 @@ public: Vertex& get_best_vertex() { std::size_t simplex_id = static_cast(-1), vertex_id = static_cast(-1); - FT best_fitness = FT{(std::numeric_limits::max)()}; + //cast from double to float looses data, so cast with {} is not allowed + //cast from double to exact types also works + FT best_fitness = (FT)(std::numeric_limits::max)(); for(std::size_t i=0, ps=m_simplices.size(); i Date: Wed, 26 Oct 2022 18:19:46 +0200 Subject: [PATCH 10/42] fix more float/double conversions code that uses eigen can use doubles when needed --- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 2 +- .../voronoi_covariance_3.h | 21 +++++++++---------- .../CGAL/hierarchy_simplify_point_set.h | 8 +++---- .../internal/Smoothing/curvature_flow_impl.h | 2 +- .../ARAP_parameterizer_3.h | 2 +- .../Fixed_border_parameterizer_3.h | 2 +- .../Iterative_authalic_parameterizer_3.h | 2 +- .../MVC_post_processor_3.h | 2 +- .../Orbifold_Tutte_parameterizer_3.h | 2 +- .../Two_vertices_parameterizer_3.h | 12 +++++------ .../internal/validity.h | 11 +++++----- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index b44b47a7f41..a6277e4301b 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -3477,7 +3477,7 @@ get_least_square_surface_plane(const Vertex_handle& v, point, Dimension_tag<2>(), tr_.geom_traits(), - Default_diagonalize_traits()); + Default_diagonalize_traits()); return std::make_pair(plane, ref_facet.first->get_facet_surface_center(ref_facet.second)); diff --git a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h index 93b3f93581a..2e80dc376b2 100644 --- a/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h +++ b/Point_set_processing_3/include/CGAL/Point_set_processing_3/internal/Voronoi_covariance_3/voronoi_covariance_3.h @@ -84,10 +84,11 @@ namespace CGAL { const Point &b, const Point &c) { - internal::covariance_matrix_tetrahedron (a[0], a[1], a[2], - b[0], b[1], b[2], - c[0], c[1], c[2], - _result); + internal::covariance_matrix_tetrahedron( + (FT)a[0], (FT)a[1], (FT)a[2], + (FT)b[0], (FT)b[1], (FT)b[2], + (FT)c[0], (FT)c[1], (FT)c[2], + _result); } const Result_type &result() const @@ -192,31 +193,29 @@ namespace CGAL { const Sphere &sphere, FT covariance[6]) { - typename internal::Covariance_accumulator_3 ca; + typename internal::Covariance_accumulator_3 ca; internal::tessellate_and_intersect(dt, v, sphere, ca); std::copy (ca.result().begin(), ca.result().end(), covariance); } template - std::array + std::array voronoi_covariance_3 (const DT &dt, typename DT::Vertex_handle v, const Sphere &sphere) { - typedef typename DT::Geom_traits::FT FT; - typename internal::Covariance_accumulator_3 ca; + typename internal::Covariance_accumulator_3 ca; return internal::tessellate_and_intersect(dt, v, sphere, ca).result(); } template - typename DT::Geom_traits::FT + double voronoi_volume_3 (const DT &dt, typename DT::Vertex_handle v, const Sphere &sphere) { - typedef typename DT::Geom_traits::FT FT; - typename internal::Volume_accumulator_3 va; + typename internal::Volume_accumulator_3 va; return internal::tessellate_and_intersect(dt, v, sphere, va).result(); } diff --git a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h index 2d6c60c9245..942c60071fb 100644 --- a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h @@ -242,7 +242,7 @@ namespace CGAL { } // Compute the covariance matrix of the set - std::array covariance = {{ 0., 0., 0., 0., 0., 0. }}; + std::array covariance = {{ 0., 0., 0., 0., 0., 0. }}; for (typename std::list::iterator it = current_cluster->first.begin (); it != current_cluster->first.end (); ++ it) @@ -257,8 +257,8 @@ namespace CGAL { covariance[5] += d.z () * d.z (); } - std::array eigenvalues = {{ 0., 0., 0. }}; - std::array eigenvectors = {{ 0., 0., 0., + std::array eigenvalues = {{ 0., 0., 0. }}; + std::array eigenvectors = {{ 0., 0., 0., 0., 0., 0., 0., 0., 0. }}; // Linear algebra = get eigenvalues and eigenvectors for @@ -279,7 +279,7 @@ namespace CGAL { // The plane which splits the point set into 2 point sets: // * Normal to the eigenvector with highest eigenvalue // * Passes through the centroid of the set - Vector v (eigenvectors[6], eigenvectors[7], eigenvectors[8]); + Vector v ((FT)eigenvectors[6], (FT)eigenvectors[7], (FT)eigenvectors[8]); std::size_t current_cluster_size = 0; typename std::list::iterator it = current_cluster->first.begin (); diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h index 66ecda4314e..d7da84020e5 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/curvature_flow_impl.h @@ -126,7 +126,7 @@ public: const Eigen_vector& bx, const Eigen_vector& by, const Eigen_vector& bz, SparseLinearSolver& solver) { - FT D; + double D; // calls compute once to factorize with the preconditioner if(!solver.factor(A, D)) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h index 3002d4beffe..fa84c143e39 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/ARAP_parameterizer_3.h @@ -1128,7 +1128,7 @@ private: // Solve "A*Xu = Bu". On success, the solution is (1/Du) * Xu. // Solve "A*Xv = Bv". On success, the solution is (1/Dv) * Xv. - NT Du, Dv; + double Du, Dv; if(!get_linear_algebra_traits().linear_solver(A, Bu, Xu, Du) || !get_linear_algebra_traits().linear_solver(A, Bv, Xv, Dv)) { std::cerr << "Could not solve linear system" << std::endl; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h index d25d7c36fa7..2172a8e3e4c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Fixed_border_parameterizer_3.h @@ -270,7 +270,7 @@ public: // Solve "A*Xu = Bu". On success, solution is (1/Du) * Xu. // Solve "A*Xv = Bv". On success, solution is (1/Dv) * Xv. - NT Du = 0, Dv = 0; + double Du = 0, Dv = 0; if(!get_linear_algebra_traits().linear_solver(A, Bu, Xu, Du) || !get_linear_algebra_traits().linear_solver(A, Bv, Xv, Dv)) { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h index 24cf892b964..a395ec3ac2d 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Iterative_authalic_parameterizer_3.h @@ -936,7 +936,7 @@ public: // solve linear equations // Solve "A*Xu = Bu". On success, solution is (1/Du) * Xu. // Solve "A*Xv = Bv". On success, solution is (1/Dv) * Xv. - NT Du = 0, Dv = 0; + double Du = 0, Dv = 0; if(!get_linear_algebra_traits().linear_solver(A, Bu, Xu, Du) || !get_linear_algebra_traits().linear_solver(A, Bv, Xv, Dv)) { diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h index 665f2077fd4..b528c9d6579 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/MVC_post_processor_3.h @@ -598,7 +598,7 @@ private: { Error_code status = OK; - NT Du, Dv; + double Du, Dv; if(!get_linear_algebra_traits().linear_solver(A, Bu, Xu, Du) || !get_linear_algebra_traits().linear_solver(A, Bv, Xv, Dv)) { status = ERROR_CANNOT_SOLVE_LINEAR_SYSTEM; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h index 1eb0b485d45..cd2c9fea58b 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Orbifold_Tutte_parameterizer_3.h @@ -836,7 +836,7 @@ private: const int big_n = M.row_dimension(); const std::size_t n = 2 * num_vertices(mesh); - NT D; + double D; Vector Xf(big_n); CGAL::Timer task_timer; diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h index f43b70f66eb..e26ee7473b9 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h @@ -143,13 +143,13 @@ public: for(vertex_descriptor vd : vertices) { const Point_3& position = get(ppmap,vd); - xmin = (std::min)(position.x(), xmin); - ymin = (std::min)(position.y(), ymin); - zmin = (std::min)(position.z(), zmin); + xmin = (std::min)((double)position.x(), xmin); + ymin = (std::min)((double)position.y(), ymin); + zmin = (std::min)((double)position.z(), zmin); - xmax = (std::max)(position.x(), xmax); - ymax = (std::max)(position.y(), ymax); - zmax = (std::max)(position.z(), zmax); + xmax = (std::max)((double)position.x(), xmax); + ymax = (std::max)((double)position.y(), ymax); + zmax = (std::max)((double)position.z(), zmax); } // Find longest bounding box axes diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h index 23519e878bf..f6c6e3a6aa9 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -272,11 +273,11 @@ bool is_one_to_one_mapping(const TriangleMesh& mesh, const Point_2& p1 = get(uvmap, vd1); const Point_2& p2 = get(uvmap, vd2); - Bbox_2 b = p0.bbox(); - b += p1.bbox(); - b += p2.bbox(); - - boxes.push_back(Box(b, fd)); + NT bx[2] = { (std::min)(p0[0], p1[0]), + (std::min)(p0[1], p1[1]) }; + NT by[2] = { (std::max)(p0[0], p1[0]), + (std::max)(p0[1], p1[1]) }; + boxes.push_back(Box(bx, by, fd)); } std::vector boxes_ptr; From 51a1179d3ba37d295206d3e804a3d18f34eba748 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 27 Oct 2022 21:42:03 +0200 Subject: [PATCH 11/42] Add c++20 std::remove_cvref, for convenience @mglisse Next time you need it... it is now here. --- STL_Extension/include/CGAL/type_traits.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/STL_Extension/include/CGAL/type_traits.h b/STL_Extension/include/CGAL/type_traits.h index f62325ebc8b..7595aa13d5b 100644 --- a/STL_Extension/include/CGAL/type_traits.h +++ b/STL_Extension/include/CGAL/type_traits.h @@ -27,6 +27,14 @@ struct is_same_or_derived : >::type {}; +template< class T > +struct remove_cvref { + typedef std::remove_cv_t> type; +}; + +template< class T > +using remove_cvref_t = typename remove_cvref::type; + } #endif // CGAL_TYPE_TRAITS_H From c6858101198bb843d253388da14b3fa67183f7c0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 27 Oct 2022 21:42:59 +0200 Subject: [PATCH 12/42] Add Construct_point_on_3(Line_3), for efficiency --- Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h | 5 +++++ Kernel_23/include/CGAL/Kernel/function_objects.h | 4 ++++ Kernel_23/include/CGAL/Line_3.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h index 566d7643bcd..cf7a7cbed11 100644 --- a/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h +++ b/Kernel_23/doc/Kernel_23/Concepts/FunctionObjectConcepts.h @@ -5922,6 +5922,11 @@ public: Kernel::Point_3 operator()(const Kernel::Line_3& l, const Kernel::FT i); + /*! + returns `point(0)` on `l`, identical to `operator()(l,0)`. + */ + Kernel::Point_3 operator()(const Kernel::Line_3& l); + /*! returns an arbitrary point on `h`. */ diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index ead2582c6bc..ea17830ff03 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -2176,6 +2176,10 @@ namespace CommonKernelFunctors { public: typedef Point_3 result_type; + const Point_3& + operator()( const Line_3& l) const + { return l.rep().point(); } + Point_3 operator()( const Line_3& l, const FT i) const { return l.rep().point(i); } diff --git a/Kernel_23/include/CGAL/Line_3.h b/Kernel_23/include/CGAL/Line_3.h index 929d658cdc7..53f902c2104 100644 --- a/Kernel_23/include/CGAL/Line_3.h +++ b/Kernel_23/include/CGAL/Line_3.h @@ -106,7 +106,7 @@ public: Point_3 point() const { - return R().construct_point_on_3_object()(*this, 0); + return R().construct_point_on_3_object()(*this); } Point_3 point(const FT i) const From 1c5454dcbe2dd0bedbca36f488b84185d59999d2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 27 Oct 2022 11:42:13 +0200 Subject: [PATCH 13/42] Add Converting_construction to Simple_precision_epick The difficulty is to detect/define which constructions are "trivial" and must not be wrapped into `Converting_construction`. Otherwise the use of `Cartesian_converter`, that uses trivial constructions itself, can lead to loops and infinite call stacks. --- .../Cartesian/Is_a_trivial_construction.h | 487 ++++++++++++++++++ .../include/CGAL/Cartesian_converter.h | 7 + .../include/CGAL/Converting_construction.h | 64 +++ Installation/include/CGAL/config.h | 5 +- ..._predicates_inexact_constructions_kernel.h | 82 ++- .../include/CGAL/Kd_tree_rectangle.h | 4 +- 6 files changed, 628 insertions(+), 21 deletions(-) create mode 100644 Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h create mode 100644 Filtered_kernel/include/CGAL/Converting_construction.h diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h b/Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h new file mode 100644 index 00000000000..d3a7acf564e --- /dev/null +++ b/Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h @@ -0,0 +1,487 @@ +// Copyright (c) 2022 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_CARTESIAN_IS_TRIVIAL_CONSTRUCTION_H +#define CGAL_CARTESIAN_IS_TRIVIAL_CONSTRUCTION_H + +#include +#include +#include +#include +#include + +namespace CGAL { +namespace CartesianFunctors { + +template +struct Is_a_trivial_construction_base +{ + // If the return type of the construction, with the specified arguments, is a + // reference or an iterator, them the construction is necessarily trivial. + using return_type = decltype(std::declval()(std::declval()...)); + enum { + value = std::is_reference::value || CGAL::is_iterator::value + }; +}; + +template +struct Is_a_trivial_construction : public Is_a_trivial_construction_base +{}; + +template +struct Is_a_trivial_construction, Args...> + : public Tag_true +{}; + +template +struct Is_a_trivial_construction, Args...> + : public Tag_true +{}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + + static Tag_true trivial(Return_base_tag, Origin); + static Tag_true trivial(Return_base_tag, RT, RT); + static Tag_true trivial(Origin); + static Tag_true trivial(RT, RT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + + static Tag_true trivial(Return_base_tag, Origin); + static Tag_true trivial(Return_base_tag, RT, RT, RT); + static Tag_true trivial(Origin); + static Tag_true trivial(RT, RT, RT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::FT FT; + typedef typename K::Point_2 Point_2; + + static Tag_true trivial(Return_base_tag, Origin); + static Tag_true trivial(Return_base_tag, Point_2, FT); + static Tag_true trivial(Return_base_tag, FT, FT); + static Tag_true trivial(Point_2, FT); + static Tag_true trivial(Origin); + static Tag_true trivial(FT, FT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + + static Tag_true trivial(Return_base_tag, Origin); + static Tag_true trivial(Return_base_tag, Point_3, FT); + static Tag_true trivial(Return_base_tag, FT, FT, FT); + static Tag_true trivial(Point_3, FT); + static Tag_true trivial(Origin); + static Tag_true trivial(FT, FT, FT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + typedef typename K::Point_2 Point_2; + + static Tag_true trivial(Return_base_tag, Null_vector); + static Tag_true trivial(Return_base_tag, Origin, Point_2); + static Tag_true trivial(Return_base_tag, RT, RT); + static Tag_true trivial(Null_vector); + static Tag_true trivial(Origin, Point_2); + static Tag_true trivial(RT, RT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + typedef typename K::Point_3 Point; + typedef typename K::Line_3 Line; + + static Tag_true trivial(Return_base_tag, Null_vector); + static Tag_true trivial(Return_base_tag, Origin, Point); + static Tag_true trivial(Return_base_tag, RT, RT, RT); + static Tag_true trivial(Return_base_tag, Line); + static Tag_true trivial(Null_vector); + static Tag_true trivial(Origin, Point); + static Tag_true trivial(RT, RT, RT); + static Tag_true trivial(Line); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + typedef typename K::Vector_2 Vector; + + static Tag_true trivial(Return_base_tag, RT, RT); + static Tag_true trivial(Return_base_tag, Vector); + static Tag_true trivial(RT, RT); + static Tag_true trivial(Vector); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + typedef typename K::Vector_3 Vector; + + static Tag_true trivial(Return_base_tag, RT, RT, RT); + static Tag_true trivial(Return_base_tag, Vector); + static Tag_true trivial(RT, RT, RT); + static Tag_true trivial(Vector); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + + static Tag_true trivial(Return_base_tag, RT, RT, RT); + static Tag_true trivial(RT, RT, RT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_3 Point; + typedef typename K::Vector_3 Vector; + typedef typename K::Direction_3 Direction; + + static Tag_true trivial(Return_base_tag, Point, Vector); + static Tag_true trivial(Return_base_tag, Point, Direction); + static Tag_true trivial(Point, Vector); + static Tag_true trivial(Point, Direction); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_2 Point; + + static Tag_true trivial(Return_base_tag, Point, Point); + static Tag_true trivial(Point, Point); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_3 Point; + + static Tag_true trivial(Return_base_tag, Point, Point); + static Tag_true trivial(Point, Point); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true {}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::FT FT; + typedef typename K::Point_2 Point; + + static Tag_true trivial(Return_base_tag, Point, FT, Orientation); + static Tag_true trivial(Return_base_tag, Point, Orientation); + static Tag_true trivial(Point, FT, Orientation); + static Tag_true trivial(Point, Orientation); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_2 Point_2; + typedef typename K::Circle_2 Circle_2; + + static Tag_true trivial(Point_2); + static Tag_true trivial(Circle_2); + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_3 Point_3; + typedef typename K::Circle_3 Circle_3; + typedef typename K::Sphere_3 Sphere_3; + + static Tag_true trivial(Point_3); + static Tag_true trivial(Circle_3); + static Tag_true trivial(Sphere_3); + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_2 Point; + typedef typename K::RT RT; + + static Tag_true trivial(Return_base_tag, Point, Point); + static Tag_true trivial(Return_base_tag, Point, Point, int); + static Tag_true trivial(Return_base_tag, Point, Point, Point, Point); + static Tag_true trivial(Return_base_tag, RT, RT, RT, RT); + static Tag_true trivial(Point, Point); + static Tag_true trivial(Point, Point, int); + static Tag_true trivial(Point, Point, Point, Point); + static Tag_true trivial(RT, RT, RT, RT); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_3 Point; + typedef typename K::RT RT; + + static Tag_true trivial(Return_base_tag, Point, Point); + static Tag_true trivial(Return_base_tag, Point, Point, int); + static Tag_true trivial(Return_base_tag, Point, Point, Point, Point, Point, Point); + static Tag_true trivial(Return_base_tag, RT, RT, RT, RT, RT, RT); + static Tag_true trivial(Point, Point); + static Tag_true trivial(Point, Point, int); + static Tag_true trivial(Point, Point, Point, Point, Point, Point); + static Tag_true trivial(RT, RT, RT, RT, RT, RT); +\ + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_2 Point; + + static Tag_true trivial(Return_base_tag, Point, Point); + static Tag_true trivial(Point, Point); +\ + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Point_3 Point; + + static Tag_true trivial(Return_base_tag, Point, Point); + static Tag_true trivial(Point, Point); +\ + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true +{}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true +{}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::RT RT; + typedef typename K::Circle_3 Circle; + + static Tag_true trivial(Return_base_tag, RT, RT, RT, RT); + static Tag_true trivial(Return_base_tag, Circle); + static Tag_true trivial(RT, RT, RT, RT); + static Tag_true trivial(Circle); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::FT FT; + typedef typename K::Point_3 Point_3; + typedef typename K::Circle_3 Circle_3; + + static Tag_true trivial(Return_base_tag, Point_3, FT, Orientation); + static Tag_true trivial(Return_base_tag, Point_3, Orientation); + static Tag_true trivial(Return_base_tag, Circle_3); + static Tag_true trivial(Point_3, FT, Orientation); + static Tag_true trivial(Point_3, Orientation); + static Tag_true trivial(Circle_3); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> +{ + typedef typename K::Plane_3 Plane_3; + typedef typename K::Sphere_3 Sphere_3; + + static Tag_true trivial(Return_base_tag, Plane_3, Sphere_3, int); + static Tag_true trivial(Plane_3, Sphere_3, int); + static Tag_true trivial(Sphere_3, Plane_3, int); + + static Tag_false trivial(...); + + enum { value = decltype(trivial(std::declval>()...))::value || + Is_a_trivial_construction_base, Args...>::value + }; +}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true +{}; + +template +struct Is_a_trivial_construction, Args...> : public Tag_true +{}; + +} // end namespace CartesianFunctors +} // end namespace CGAL + +#endif // CGAL_CARTESIAN_IS_TRIVIAL_CONSTRUCTION_H \ No newline at end of file diff --git a/Cartesian_kernel/include/CGAL/Cartesian_converter.h b/Cartesian_kernel/include/CGAL/Cartesian_converter.h index 916697a972d..cde883c91c0 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian_converter.h +++ b/Cartesian_kernel/include/CGAL/Cartesian_converter.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -108,6 +109,12 @@ public: return n; } + Return_base_tag + operator()(Return_base_tag o) const + { + return o; + } + const Bbox_2& operator()(const Bbox_2& b) const { diff --git a/Filtered_kernel/include/CGAL/Converting_construction.h b/Filtered_kernel/include/CGAL/Converting_construction.h new file mode 100644 index 00000000000..89a10a9be97 --- /dev/null +++ b/Filtered_kernel/include/CGAL/Converting_construction.h @@ -0,0 +1,64 @@ +// Copyright (c) 2022 GeometryFactory Sarl (France). +// All rights reserved. +// +// This file is part of CGAL (www.cgal.org) +// +// $URL$ +// $Id$ +// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial +// +// +// Author(s) : Laurent Rineau + +#ifndef CGAL_CONVERTING_CONSTRUCTION_H +#define CGAL_CONVERTING_CONSTRUCTION_H + +#include +#include +#include +#include + +namespace CGAL { + +template +struct Converting_construction +{ + CGAL_NO_UNIQUE_ADDRESS Source_construction source_construction; + CGAL_NO_UNIQUE_ADDRESS Target_construction construct; + CGAL_NO_UNIQUE_ADDRESS Converter convert; + CGAL_NO_UNIQUE_ADDRESS Backward_converter backward_convert; + + template ::value>* = nullptr> + decltype(auto) operator()(Args&&... args) const { + return source_construction(std::forward(args)...); + } + + template ::value>* = nullptr> + auto operator()(Args&&... args) const { + return backward_convert(construct(convert(args)...)); + } +}; + +template +struct Converting_constructions_kernel_adaptor : public Kernel_A +{ + using A_to_B = Cartesian_converter; + using B_to_A = Cartesian_converter; + +#define CGAL_Kernel_cons(C,Cf) \ + using C = Converting_construction; \ + C Cf() const { return C(); } + +#include + +}; + +} // end namespace CGAL + +#endif // CGAL_CONVERTING_CONSTRUCTION_H diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index a2d01e9293a..01b47d4b8ce 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -357,7 +357,10 @@ using std::max; #define CGAL_NORETURN [[noreturn]] // Macro to specify [[no_unique_address]] if supported -#if __has_cpp_attribute(no_unique_address) +#if _MSC_VER >= 1929 +// see https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#c20-no_unique_address +# define CGAL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] +#elif __has_cpp_attribute(no_unique_address) # define CGAL_NO_UNIQUE_ADDRESS [[no_unique_address]] #else # define CGAL_NO_UNIQUE_ADDRESS diff --git a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h index c2428965769..ae628e58ef5 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h @@ -19,34 +19,80 @@ #include #include +#include #include namespace CGAL { -// The following is equivalent to Filtered_kernel< Simple_cartesian >, -// but it's shorter in terms of template name length (for error messages, mangling...). +constexpr bool epick_use_static_filter = +#ifdef CGAL_NO_STATIC_FILTERS + false; +#else + true; +#endif #ifndef CGAL_EPICK_SINGLE_PRECISION -using Epick_number_type = double; -#else -using Epick_number_type = float; -#endif +// Here Epick is a class, and Double_precision_epick an alias to it. +class Epick; +class Single_precision_epick; +using Double_precision_epick = Epick; +#else // CGAL_EPICK_SINGLE_PRECISION +// Here, Epick is an alias to Single_precision_epick. +class Single_precision_epick; +class Double_precision_epick; +using Epick = Single_precision_epick; +#endif // CGAL_EPICK_SINGLE_PRECISION -class Epick - : public Filtered_kernel_adaptor< - Type_equality_wrapper< Simple_cartesian::Base::Type, Epick >, -#ifdef CGAL_NO_STATIC_FILTERS - false > -#else - true > -#endif +namespace internal { + + // Basic objects, constructions, and predicates, using `double` for `FT`. + using Double_precision_epick_base = + Simple_cartesian::Base::Type; + + // Add the type equality property, by changing the objects types + using Double_precision_epick_base_with_type_equality = + Type_equality_wrapper; + + // Change the predicates to filtered predicates (with static filters or not) + using Double_precision_epick_with_filtered_predicates = + Filtered_kernel_adaptor; + + // Same, but with objects using `float` for FT + using Single_precision_epick_base = + Simple_cartesian::Base::Type; + using Single_precision_epick_base_with_type_equality = + Type_equality_wrapper; + using Single_precision_epick_with_filtered_predicates = + Filtered_kernel_adaptor; +}; + +#ifndef CGAL_EPICK_SINGLE_PRECISION +// The following is equivalent to Filtered_kernel< Simple_cartesian >, +// but it's shorter in terms of template name length (for error messages, mangling...). +class Epick : public internal::Double_precision_epick_with_filtered_predicates {}; - -typedef Epick Exact_predicates_inexact_constructions_kernel; +#else // CGAL_EPICK_SINGLE_PRECISION +class Double_precision_epick : public internal::Double_precision_epick_with_filtered_predicates +{}; +#endif // CGAL_EPICK_SINGLE_PRECISION template <> -struct Triangulation_structural_filtering_traits { - typedef Tag_true Use_structural_filtering_tag; +struct Triangulation_structural_filtering_traits { + using Use_structural_filtering_tag = Tag_true; +}; + +using Exact_predicates_inexact_constructions_kernel = Epick; + + +// This kernel is Epick with the difference that its `FT` is `float`. +class Single_precision_epick + : public Converting_constructions_kernel_adaptor +{}; + +template <> +struct Triangulation_structural_filtering_traits { + using Use_structural_filtering_tag = Tag_true; }; } //namespace CGAL diff --git a/Spatial_searching/include/CGAL/Kd_tree_rectangle.h b/Spatial_searching/include/CGAL/Kd_tree_rectangle.h index d0db23ceb1c..ef2f13476d9 100644 --- a/Spatial_searching/include/CGAL/Kd_tree_rectangle.h +++ b/Spatial_searching/include/CGAL/Kd_tree_rectangle.h @@ -40,7 +40,7 @@ namespace CGAL { operator()(P p) { T h; - typename Construct_cartesian_const_iterator_d::result_type pit = construct_it(*p); + auto pit = construct_it(*p); for (int i = 0; i < dim; ++i, ++pit) { h=(*pit); if (h < lower[i]) lower[i] = h; @@ -126,7 +126,7 @@ namespace CGAL { if (begin ==end) return; // initialize with values of first point - typename Construct_cartesian_const_iterator_d::result_type bit = construct_it(**begin); + auto bit = construct_it(**begin); for (int i=0; i < D::value; ++i, ++bit) { lower_[i]= *bit; upper_[i]=lower_[i]; From 2f9e031da712e1a97dcad4946fe8130bcc67ac94 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 28 Oct 2022 10:43:04 +0200 Subject: [PATCH 14/42] Fix parts of PMP with Simple_precision_epick --- .../Polygon_mesh_processing/point_inside_example.cpp | 6 +++--- .../internal/Smoothing/mesh_smoothing_impl.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp index 879325a1d5f..e0fb5d220a0 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp @@ -22,9 +22,9 @@ double max_coordinate(const Polyhedron& poly) for(Polyhedron::Vertex_handle v : vertices(poly)) { Point p = v->point(); - max_coord = (std::max)(max_coord, p.x()); - max_coord = (std::max)(max_coord, p.y()); - max_coord = (std::max)(max_coord, p.z()); + max_coord = (std::max)(max_coord, p.x()); + max_coord = (std::max)(max_coord, p.y()); + max_coord = (std::max)(max_coord, p.z()); } return max_coord; } diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h index 16f8de52d49..a3a7e03ff4f 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h @@ -426,10 +426,10 @@ public: const FT S_av = compute_average_area_around(v); - const FT initial_x = vp.x(); - const FT initial_y = vp.y(); - const FT initial_z = vp.z(); - FT x = initial_x, y = initial_y, z = initial_z; + const double initial_x = vp.x(); + const double initial_y = vp.y(); + const double initial_z = vp.z(); + double x = initial_x, y = initial_y, z = initial_z; ceres::Problem problem; @@ -466,7 +466,7 @@ public: // std::cout << "y : " << initial_y << " -> " << y << "\n"; // std::cout << "z : " << initial_z << " -> " << z << "\n"; - return Vector(x - initial_x, y - initial_y, z - initial_z); + return Vector(FT(x - initial_x), FT(y - initial_y), FT(z - initial_z))l; #else CGAL_USE(v); return CGAL::NULL_VECTOR; From 9a881390a6a8ccaae4baeba43e0c4b04d4ff45e3 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Nov 2022 16:23:33 +0100 Subject: [PATCH 15/42] Rename Is_a_trivial_construction (remove `_a`) --- ...nstruction.h => Is_trivial_construction.h} | 118 +++++++++--------- .../include/CGAL/Converting_construction.h | 6 +- 2 files changed, 62 insertions(+), 62 deletions(-) rename Cartesian_kernel/include/CGAL/Cartesian/{Is_a_trivial_construction.h => Is_trivial_construction.h} (66%) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h similarity index 66% rename from Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h rename to Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h index d3a7acf564e..3e04f031bfc 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Is_a_trivial_construction.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h @@ -23,7 +23,7 @@ namespace CGAL { namespace CartesianFunctors { template -struct Is_a_trivial_construction_base +struct Is_trivial_construction_base { // If the return type of the construction, with the specified arguments, is a // reference or an iterator, them the construction is necessarily trivial. @@ -34,21 +34,21 @@ struct Is_a_trivial_construction_base }; template -struct Is_a_trivial_construction : public Is_a_trivial_construction_base +struct Is_trivial_construction : public Is_trivial_construction_base {}; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; @@ -60,12 +60,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; @@ -77,12 +77,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::FT FT; typedef typename K::Point_2 Point_2; @@ -97,12 +97,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; @@ -117,12 +117,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; typedef typename K::Point_2 Point_2; @@ -137,12 +137,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; typedef typename K::Point_3 Point; @@ -160,12 +160,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; typedef typename K::Vector_2 Vector; @@ -178,12 +178,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; typedef typename K::Vector_3 Vector; @@ -196,12 +196,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; @@ -211,12 +211,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_3 Point; typedef typename K::Vector_3 Vector; @@ -230,12 +230,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_2 Point; @@ -245,12 +245,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_3 Point; @@ -260,33 +260,33 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true {}; +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::FT FT; typedef typename K::Point_2 Point; @@ -299,12 +299,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_2 Point_2; typedef typename K::Circle_2 Circle_2; @@ -314,12 +314,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_3 Point_3; typedef typename K::Circle_3 Circle_3; @@ -331,12 +331,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_2 Point; typedef typename K::RT RT; @@ -353,12 +353,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_3 Point; typedef typename K::RT RT; @@ -375,12 +375,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_2 Point; @@ -390,12 +390,12 @@ struct Is_a_trivial_construction, static Tag_false trivial(...); enum { value = decltype(trivial(std::declval>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Point_3 Point; @@ -405,20 +405,20 @@ struct Is_a_trivial_construction, static Tag_false trivial(...); enum { value = decltype(trivial(std::declval>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> : public Tag_true +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::RT RT; typedef typename K::Circle_3 Circle; @@ -431,12 +431,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::FT FT; typedef typename K::Point_3 Point_3; @@ -452,12 +452,12 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> +struct Is_trivial_construction, Args...> { typedef typename K::Plane_3 Plane_3; typedef typename K::Sphere_3 Sphere_3; @@ -469,16 +469,16 @@ struct Is_a_trivial_construction>()...))::value || - Is_a_trivial_construction_base, Args...>::value + Is_trivial_construction_base, Args...>::value }; }; template -struct Is_a_trivial_construction, Args...> : public Tag_true +struct Is_trivial_construction, Args...> : public Tag_true {}; template -struct Is_a_trivial_construction, Args...> : public Tag_true +struct Is_trivial_construction, Args...> : public Tag_true {}; } // end namespace CartesianFunctors diff --git a/Filtered_kernel/include/CGAL/Converting_construction.h b/Filtered_kernel/include/CGAL/Converting_construction.h index 89a10a9be97..2f6da83df49 100644 --- a/Filtered_kernel/include/CGAL/Converting_construction.h +++ b/Filtered_kernel/include/CGAL/Converting_construction.h @@ -15,7 +15,7 @@ #include #include -#include +#include #include namespace CGAL { @@ -30,13 +30,13 @@ struct Converting_construction CGAL_NO_UNIQUE_ADDRESS Backward_converter backward_convert; template ::value>* = nullptr> + std::enable_if_t::value>* = nullptr> decltype(auto) operator()(Args&&... args) const { return source_construction(std::forward(args)...); } template ::value>* = nullptr> + std::enable_if_t::value>* = nullptr> auto operator()(Args&&... args) const { return backward_convert(construct(convert(args)...)); } From 0f28931760edea699d9a9d66d496f0d572714911 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 7 Nov 2022 16:43:48 +0100 Subject: [PATCH 16/42] Add a newline --- .../include/CGAL/Cartesian/Is_trivial_construction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h index 3e04f031bfc..867638fe527 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h @@ -484,4 +484,4 @@ struct Is_trivial_construction Date: Tue, 8 Nov 2022 11:04:38 +0100 Subject: [PATCH 17/42] Use template aliases to factorize code --- ..._predicates_inexact_constructions_kernel.h | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h index ae628e58ef5..57b70f04b0f 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h @@ -46,33 +46,28 @@ using Epick = Single_precision_epick; namespace internal { // Basic objects, constructions, and predicates, using `double` for `FT`. - using Double_precision_epick_base = - Simple_cartesian::Base::Type; + template + using Epick_base = + typename Simple_cartesian::template Base::Type; // Add the type equality property, by changing the objects types - using Double_precision_epick_base_with_type_equality = - Type_equality_wrapper; + template + using Epick_base_with_type_equality = + Type_equality_wrapper, Kernel>; // Change the predicates to filtered predicates (with static filters or not) - using Double_precision_epick_with_filtered_predicates = - Filtered_kernel_adaptor; - - // Same, but with objects using `float` for FT - using Single_precision_epick_base = - Simple_cartesian::Base::Type; - using Single_precision_epick_base_with_type_equality = - Type_equality_wrapper; - using Single_precision_epick_with_filtered_predicates = - Filtered_kernel_adaptor; + template + using Epick_with_filtered_predicates = + Filtered_kernel_adaptor, epick_use_static_filter>; }; #ifndef CGAL_EPICK_SINGLE_PRECISION // The following is equivalent to Filtered_kernel< Simple_cartesian >, // but it's shorter in terms of template name length (for error messages, mangling...). -class Epick : public internal::Double_precision_epick_with_filtered_predicates +class Epick : public internal::Epick_with_filtered_predicates {}; #else // CGAL_EPICK_SINGLE_PRECISION -class Double_precision_epick : public internal::Double_precision_epick_with_filtered_predicates +class Double_precision_epick : public internal::Epick_with_filtered_predicates {}; #endif // CGAL_EPICK_SINGLE_PRECISION @@ -86,8 +81,9 @@ using Exact_predicates_inexact_constructions_kernel = Epick; // This kernel is Epick with the difference that its `FT` is `float`. class Single_precision_epick - : public Converting_constructions_kernel_adaptor + : public Converting_constructions_kernel_adaptor< + internal::Epick_with_filtered_predicates, + Double_precision_epick> {}; template <> From b56a79eacffa4bf9abbf192fae7e445f0f88e0a0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 11:06:44 +0100 Subject: [PATCH 18/42] Compute_[abcd]_[23] return references That simplifies the code, and is more correct. --- .../CGAL/Cartesian/Is_trivial_construction.h | 21 ------------------- .../include/CGAL/Kernel/function_objects.h | 14 ++++++------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h index 867638fe527..76ab457d5e0 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h @@ -264,27 +264,6 @@ struct Is_trivial_construction -struct Is_trivial_construction, Args...> : public Tag_true {}; - -template -struct Is_trivial_construction, Args...> : public Tag_true {}; - -template -struct Is_trivial_construction, Args...> : public Tag_true {}; - -template -struct Is_trivial_construction, Args...> : public Tag_true {}; - -template -struct Is_trivial_construction, Args...> : public Tag_true {}; - -template -struct Is_trivial_construction, Args...> : public Tag_true {}; - -template -struct Is_trivial_construction, Args...> : public Tag_true {}; - template struct Is_trivial_construction, Args...> { diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index ea17830ff03..85517c2676b 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -1042,7 +1042,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Line_2& l) const { return l.rep().a(); @@ -1058,7 +1058,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Plane_3& l) const { return l.rep().a(); @@ -1075,7 +1075,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Line_2& l) const { return l.rep().b(); @@ -1091,7 +1091,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Plane_3& l) const { return l.rep().b(); @@ -1108,7 +1108,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Line_2& l) const { return l.rep().c(); @@ -1124,7 +1124,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Plane_3& l) const { return l.rep().c(); @@ -1140,7 +1140,7 @@ namespace CommonKernelFunctors { public: typedef RT result_type; - RT + const RT& operator()(const Plane_3& l) const { return l.rep().d(); From 0e898d90941245b412a0e2912e09e7bc315c71eb Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 12:00:13 +0100 Subject: [PATCH 19/42] decltype(auto) for Bbox_[23] In the cartesian converter, the conversion of a bbox (2D or 3D) returns a reference. --- Filtered_kernel/include/CGAL/Converting_construction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Filtered_kernel/include/CGAL/Converting_construction.h b/Filtered_kernel/include/CGAL/Converting_construction.h index 2f6da83df49..42076b5d20f 100644 --- a/Filtered_kernel/include/CGAL/Converting_construction.h +++ b/Filtered_kernel/include/CGAL/Converting_construction.h @@ -37,7 +37,7 @@ struct Converting_construction template ::value>* = nullptr> - auto operator()(Args&&... args) const { + decltype(auto) operator()(Args&&... args) const { return backward_convert(construct(convert(args)...)); } }; From 3600173ed453f06bf4433e394517c63536d79bf5 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 12:01:44 +0100 Subject: [PATCH 20/42] Missing includes, for users of Epick (even if those headers are probably already included elsewhere) --- .../CGAL/Exact_predicates_inexact_constructions_kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h index 57b70f04b0f..c80d13cc286 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h @@ -21,6 +21,8 @@ #include #include #include +#include +#include namespace CGAL { From 3933d0bec8b7e4366d2124149d51931288765ea4 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 12:07:14 +0100 Subject: [PATCH 21/42] Fix a 16 years old todo Sylvain Pion, wrote in August 2006: > FIXME : Use Qrt<> here At that time `Qrt` stood for `Qualified_result_of` (sic, maybe it was named "qualified result type" at a time). Now that we can use C++14, we have `decltype(auto)` instead. --- Kernel_23/include/CGAL/Line_2.h | 7 +++---- Kernel_23/include/CGAL/Triangle_3.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Kernel_23/include/CGAL/Line_2.h b/Kernel_23/include/CGAL/Line_2.h index 528740a01a9..3f757981eb2 100644 --- a/Kernel_23/include/CGAL/Line_2.h +++ b/Kernel_23/include/CGAL/Line_2.h @@ -89,18 +89,17 @@ public: : RLine_2(typename R::Construct_line_2()(Return_base_tag(), p,v)) {} - // FIXME : Use Qrt<> here. - RT a() const + decltype(auto) a() const { return R().compute_a_2_object()(*this); } - RT b() const + decltype(auto) b() const { return R().compute_b_2_object()(*this); } - RT c() const + decltype(auto) c() const { return R().compute_c_2_object()(*this); } diff --git a/Kernel_23/include/CGAL/Triangle_3.h b/Kernel_23/include/CGAL/Triangle_3.h index 1496121d9fe..92adba1fb86 100644 --- a/Kernel_23/include/CGAL/Triangle_3.h +++ b/Kernel_23/include/CGAL/Triangle_3.h @@ -106,7 +106,7 @@ public: return R().construct_bbox_3_object()(*this); } - FT squared_area() const // TODO : use Qrt + decltype(auto) squared_area() const { return R().compute_squared_area_3_object()(*this); } From 51a5ce0c440f2d5a4fae8d86002431922cea043a Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 12:08:58 +0100 Subject: [PATCH 22/42] Test Simple_precision_epick ... and adapt the code of the testsuite. In particular, there are lots of cases of inexact constructions that are compared to exact results. --- .../test/Kernel_23/Filtered_cartesian.cpp | 6 ++++-- .../CGAL/_test_cls_aff_transformation_2.h | 20 +++++++++++-------- .../CGAL/_test_cls_aff_transformation_3.h | 2 +- .../Kernel_23/include/CGAL/_test_cls_line_3.h | 2 +- .../include/CGAL/_test_fct_weighted_point_3.h | 2 +- .../include/CGAL/_test_mf_plane_3_to_2d.h | 6 +++--- 6 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp index d8b24523c15..46b0f480e5a 100644 --- a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp +++ b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp @@ -71,8 +71,10 @@ main() std::cout << "Testing with Epeck:\n"; test(); - std::cout << "Testing with Epick:\n"; - test(); + std::cout << "Testing with Double_precision_epick:\n"; + test(); + std::cout << "Testing with Simple_precision_epick:\n"; + test(); return 0; } diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index 433b9a8065f..d0665d64cc6 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -19,6 +19,7 @@ #define CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H #include +#include template bool @@ -280,10 +281,13 @@ _test_cls_aff_transformation_2(const R& ) assert( pnt.transform(gat1) == pnt.transform(co1) ); assert( lin.transform(gat1) == lin.transform(co1) ); co1 = gat1 * gat1.inverse() ; - assert( vec == vec.transform(co1) ); - assert( pnt == pnt.transform(co1) ); - assert( dir == dir.transform(co1) ); - assert( lin == lin.transform(co1) ); + assert( vec == vec.transform(co1) || nonexact ); + assert( (vec - vec.transform(co1)).squared_length() < 1e-10); + assert( pnt == pnt.transform(co1) || nonexact ); + assert( (pnt - pnt.transform(co1)).squared_length() < 1e-10); + assert( dir == dir.transform(co1) || nonexact); + assert( (dir.to_vector() - dir.transform(co1).to_vector()).squared_length() < 1e-10); + assert( lin == lin.transform(co1) || nonexact ); // even assert( translate.is_even() ); @@ -340,10 +344,10 @@ _test_cls_aff_transformation_2(const R& ) assert( pnt == pnt.transform(co1) ); assert( lin == lin.transform(co1) ); co1 = rot3 * rot3 * rot3.inverse(); - assert( vec.transform(rot3) == vec.transform(co1) ); - assert( dir.transform(rot3) == dir.transform(co1) ); - assert( pnt.transform(rot3) == pnt.transform(co1) ); - assert( lin.transform(rot3) == lin.transform(co1) ); + assert( vec.transform(rot3) == vec.transform(co1) || nonexact ); + assert( dir.transform(rot3) == dir.transform(co1) || nonexact ); + assert( pnt.transform(rot3) == pnt.transform(co1) || nonexact ); + assert( lin.transform(rot3) == lin.transform(co1) || nonexact ); //circle tp2 = p2.transform( translate ); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h index c7d24eed9a5..7a3bc746bb4 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_3.h @@ -97,7 +97,7 @@ _test_cls_aff_transformation_3(const R& ) n5, n11, n10, n4, n3, n6, n12, n2, n3 ); - assert( p1 == (p1.transform(gat1)).transform(gat1.inverse() ) ); + assert( p1 == (p1.transform(gat1)).transform(gat1.inverse() ) || nonexact ); CGAL::Aff_transformation_3 gat2( n7, n9, n8, n2, n5, n11, n10, n4, diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_line_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_line_3.h index 10c97edda08..896f588d62f 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_line_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_line_3.h @@ -29,7 +29,7 @@ _test_cls_line_3(const R& ) typedef typename R::RT RT; typedef typename R::FT FT; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; typename R::Line_3 il; CGAL::Line_3 l0( il ); CGAL_USE(l0); diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_weighted_point_3.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_weighted_point_3.h index d0cb8d29da3..4abc761fc7f 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_weighted_point_3.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_fct_weighted_point_3.h @@ -31,7 +31,7 @@ _test_fct_weighted_point_3(const R& ) std::cout << "Testing functions Weighted_point_3" ; typedef typename R::RT RT; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; CGAL::Point_3 p1(RT(18), RT(15), RT(-21), RT(3) ); // 6, 5, -7 CGAL::Point_3 p2(RT(18), RT(15), RT( 12), RT(3) ); // 6, 5, 4 diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_mf_plane_3_to_2d.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_mf_plane_3_to_2d.h index 15ec54556b8..3d81d0ff05d 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_mf_plane_3_to_2d.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_mf_plane_3_to_2d.h @@ -29,7 +29,7 @@ _test_mf_plane_3_to_2d(const R& ) typedef CGAL::Point_3< R> Point_3; typedef CGAL::Point_2< R> Point_2; - const bool nonexact = std::is_same::value; + const bool nonexact = std::is_floating_point::value; RT n0 = 0; RT n1 = 7; @@ -68,11 +68,11 @@ _test_mf_plane_3_to_2d(const R& ) Point_3 p6( n4, n5, n0, n8); Plane_3 pl3( p4, p5, p6); assert( p4 == pl3.to_3d( pl3.to_2d( p4)) || nonexact ); - assert( p5 == pl3.to_3d( pl3.to_2d( p5)) ); + assert( p5 == pl3.to_3d( pl3.to_2d( p5)) || nonexact ); assert( p6 == pl3.to_3d( pl3.to_2d( p6)) || nonexact ); Plane_3 pl4( p4, p6, p5); assert( p4 == pl4.to_3d( pl4.to_2d( p4)) || nonexact ); - assert( p5 == pl4.to_3d( pl4.to_2d( p5)) ); + assert( p5 == pl4.to_3d( pl4.to_2d( p5)) || nonexact ); assert( p6 == pl4.to_3d( pl4.to_2d( p6)) || nonexact ); Point_3 p7 = CGAL::midpoint( p1, p2); From 7d250c5a2cec9c33c21b9644ee4a2a9932c192e0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 15:18:31 +0100 Subject: [PATCH 23/42] Fix the testsuite for Homogenous --- .../Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index d0665d64cc6..6ec6eae3c16 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -285,8 +285,11 @@ _test_cls_aff_transformation_2(const R& ) assert( (vec - vec.transform(co1)).squared_length() < 1e-10); assert( pnt == pnt.transform(co1) || nonexact ); assert( (pnt - pnt.transform(co1)).squared_length() < 1e-10); + +auto unit = [](CGAL::Vector_2 v) { return v / CGAL::approximate_sqrt(v*v); }; assert( dir == dir.transform(co1) || nonexact); - assert( (dir.to_vector() - dir.transform(co1).to_vector()).squared_length() < 1e-10); + assert( (unit(dir.to_vector()) - unit(dir.transform(co1).to_vector())).squared_length() < 1e-5); + assert( lin == lin.transform(co1) || nonexact ); // even From a6050f4bb36a1e81775333fc8b6a40dc4f5951f0 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 15:57:53 +0100 Subject: [PATCH 24/42] Fix the comment --- .../CGAL/Exact_predicates_inexact_constructions_kernel.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h index c80d13cc286..341c663007d 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h @@ -47,7 +47,8 @@ using Epick = Single_precision_epick; namespace internal { - // Basic objects, constructions, and predicates, using `double` for `FT`. + // Basic objects, constructions, and predicates, using the same base class as + // Simple_cartesian: Cartesian_base without reference counting. template using Epick_base = typename Simple_cartesian::template Base::Type; From fa83872f81bfaf2b0e7d06af95dc3e1168bb20b8 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 8 Nov 2022 16:02:17 +0100 Subject: [PATCH 25/42] Remove the trailing white space I added by error --- .../Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index 6ec6eae3c16..7fb47bb4566 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -289,7 +289,7 @@ _test_cls_aff_transformation_2(const R& ) auto unit = [](CGAL::Vector_2 v) { return v / CGAL::approximate_sqrt(v*v); }; assert( dir == dir.transform(co1) || nonexact); assert( (unit(dir.to_vector()) - unit(dir.transform(co1).to_vector())).squared_length() < 1e-5); - + assert( lin == lin.transform(co1) || nonexact ); // even From 13882cc28192af4ee18afee7eb0e99b87f2a6965 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 8 Nov 2022 17:29:15 +0100 Subject: [PATCH 26/42] avoid C-cast --- .../CGAL/Optimal_bounding_box/internal/fitness_function.h | 8 ++++---- .../CGAL/Optimal_bounding_box/internal/optimize_2.h | 4 ++-- .../CGAL/Optimal_bounding_box/internal/population.h | 2 +- .../internal/Voronoi_covariance_3/voronoi_covariance_3.h | 6 +++--- .../include/CGAL/bilateral_smooth_point_set.h | 2 +- .../include/CGAL/hierarchy_simplify_point_set.h | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h index e9372409e63..2eab0c64061 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/fitness_function.h @@ -41,8 +41,8 @@ compute_fitness(const typename Traits::Matrix& R, // rotation matrix FT xmin, ymin, zmin, xmax, ymax, zmax; //cast from double to float looses data, so cast with {} is not allowed //cast from double to exact types also works - xmin = ymin = zmin = (FT)(std::numeric_limits::max)(); - xmax = ymax = zmax = (FT)std::numeric_limits::lowest(); + xmin = ymin = zmin = FT((std::numeric_limits::max)()); + xmax = ymax = zmax = FT(std::numeric_limits::lowest()); for(const Point& pt : points) { @@ -85,8 +85,8 @@ compute_fitness_if_smaller(const typename Traits::Matrix& R, // rotation matrix FT xmin, ymin, zmin, xmax, ymax, zmax; //cast from double to float looses data, so cast with {} is not allowed //cast from double to exact types also works - xmin = ymin = zmin = (FT)(std::numeric_limits::max)(); - xmax = ymax = zmax = (FT)std::numeric_limits::lowest(); + xmin = ymin = zmin = FT((std::numeric_limits::max)()); + xmax = ymax = zmax = FT(std::numeric_limits::lowest()); // compute every 1%, with a minimum of 1000 iterations const std::size_t pn = points.size(); diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h index 126e4fb247a..4ff08af8d1d 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/optimize_2.h @@ -127,8 +127,8 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot, FT xmin, ymin, zmin, xmax, ymax, zmax; //cast from double to float looses data, so cast with {} is not allowed //cast from double to exact types also works - xmin = ymin = zmin = (FT)(std::numeric_limits::max)(); - xmax = ymax = zmax = (FT)std::numeric_limits::lowest(); + xmin = ymin = zmin = FT((std::numeric_limits::max)()); + xmax = ymax = zmax = FT(std::numeric_limits::lowest()); for(const Point& pt : points) { diff --git a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h index f0bea15b52c..8223f7afed5 100644 --- a/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h +++ b/Optimal_bounding_box/include/CGAL/Optimal_bounding_box/internal/population.h @@ -123,7 +123,7 @@ public: std::size_t simplex_id = static_cast(-1), vertex_id = static_cast(-1); //cast from double to float looses data, so cast with {} is not allowed //cast from double to exact types also works - FT best_fitness = (FT)(std::numeric_limits::max)(); + FT best_fitness = FT((std::numeric_limits::max)()); for(std::size_t i=0, ps=m_simplices.size(); i::iterator it = current_cluster->first.begin (); From 0daa432b1029ee8c92f5047381846f85b0f535f2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 8 Nov 2022 17:29:54 +0100 Subject: [PATCH 27/42] remove unnecessary include --- .../CGAL/Surface_mesh_parameterization/internal/validity.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h index f6c6e3a6aa9..9a0c2e438ab 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h @@ -18,7 +18,6 @@ #include #include -#include #include #include From aab981e74f10709314ebaa7d421ad8be3072b0b2 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 8 Nov 2022 17:39:53 +0100 Subject: [PATCH 28/42] use CGAL::to_double because cast-to-double may not be available for all number types --- Mesh_3/test/Mesh_3/test_meshing_utilities.h | 4 ++-- .../include/CGAL/scanline_orient_normals.h | 2 +- .../Polygon_mesh_processing/point_inside_example.cpp | 6 +++--- .../Two_vertices_parameterizer_3.h | 12 ++++++------ 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Mesh_3/test/Mesh_3/test_meshing_utilities.h b/Mesh_3/test/Mesh_3/test_meshing_utilities.h index 68cec598802..a9c545a7555 100644 --- a/Mesh_3/test/Mesh_3/test_meshing_utilities.h +++ b/Mesh_3/test/Mesh_3/test_meshing_utilities.h @@ -380,8 +380,8 @@ struct Tester if(!c3t3.is_in_complex(f)) continue; - max_sqd = (std::max)(max_sqd, - aabb_tree.squared_distance(CGAL::centroid(tr.triangle(f)))); + max_sqd = (std::max)(max_sqd, + CGAL::to_double(aabb_tree.squared_distance(CGAL::centroid(tr.triangle(f))))); } double hdist = std::sqrt(max_sqd); std::cout << "\tHausdorff distance to polyhedron is " << hdist << std::endl; diff --git a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h index eae37044f96..ad3a71beb2b 100644 --- a/Point_set_processing_3/include/CGAL/scanline_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/scanline_orient_normals.h @@ -328,7 +328,7 @@ void orient_scanline (Iterator begin, Iterator end, const Point_3& p = get (point_map, *it); mean_x += p.x(); mean_y += p.y(); - max_z = (std::max)(max_z, (double)p.z()); + max_z = (std::max)(max_z, CGAL::to_double(p.z())); ++ nb; } diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp index e0fb5d220a0..93b158ce192 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/point_inside_example.cpp @@ -22,9 +22,9 @@ double max_coordinate(const Polyhedron& poly) for(Polyhedron::Vertex_handle v : vertices(poly)) { Point p = v->point(); - max_coord = (std::max)(max_coord, p.x()); - max_coord = (std::max)(max_coord, p.y()); - max_coord = (std::max)(max_coord, p.z()); + max_coord = (std::max)(max_coord, CGAL::to_double(p.x())); + max_coord = (std::max)(max_coord, CGAL::to_double(p.y())); + max_coord = (std::max)(max_coord, CGAL::to_double(p.z())); } return max_coord; } diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h index e26ee7473b9..88ecb8dc706 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/Two_vertices_parameterizer_3.h @@ -143,13 +143,13 @@ public: for(vertex_descriptor vd : vertices) { const Point_3& position = get(ppmap,vd); - xmin = (std::min)((double)position.x(), xmin); - ymin = (std::min)((double)position.y(), ymin); - zmin = (std::min)((double)position.z(), zmin); + xmin = (std::min)(CGAL::to_double(position.x()), xmin); + ymin = (std::min)(CGAL::to_double(position.y()), ymin); + zmin = (std::min)(CGAL::to_double(position.z()), zmin); - xmax = (std::max)((double)position.x(), xmax); - ymax = (std::max)((double)position.y(), ymax); - zmax = (std::max)((double)position.z(), zmax); + xmax = (std::max)(CGAL::to_double(position.x()), xmax); + ymax = (std::max)(CGAL::to_double(position.y()), ymax); + zmax = (std::max)(CGAL::to_double(position.z()), zmax); } // Find longest bounding box axes From 6b4bd0b653bf5ec41ee0157bf11767d8f23ca82e Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 8 Nov 2022 17:43:41 +0100 Subject: [PATCH 29/42] make conversion explicit with CGAL::to_double --- .../internal/Smoothing/mesh_smoothing_impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h index 2dd9a6998b6..1792d4e29df 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/internal/Smoothing/mesh_smoothing_impl.h @@ -428,9 +428,9 @@ public: const FT S_av = compute_average_area_around(v); - const double initial_x = vp.x(); - const double initial_y = vp.y(); - const double initial_z = vp.z(); + const double initial_x = CGAL::to_double(vp.x()); + const double initial_y = CGAL::to_double(vp.y()); + const double initial_z = CGAL::to_double(vp.z()); double x = initial_x, y = initial_y, z = initial_z; ceres::Problem problem; From 705e71341435cae24515fa31f07a43efc7c9f796 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 8 Nov 2022 17:52:39 +0100 Subject: [PATCH 30/42] reintroduce lost p2 --- .../Surface_mesh_parameterization/internal/validity.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h index 9a0c2e438ab..9b41bb25649 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h @@ -272,10 +272,10 @@ bool is_one_to_one_mapping(const TriangleMesh& mesh, const Point_2& p1 = get(uvmap, vd1); const Point_2& p2 = get(uvmap, vd2); - NT bx[2] = { (std::min)(p0[0], p1[0]), - (std::min)(p0[1], p1[1]) }; - NT by[2] = { (std::max)(p0[0], p1[0]), - (std::max)(p0[1], p1[1]) }; + NT bx[2] = { (std::min)(p0[0], (std::min)(p1[0], p2[0])), + (std::min)(p0[1], (std::min)(p1[1], p2[1])) }; + NT by[2] = { (std::max)(p0[0], (std::max)(p1[0], p2[0])), + (std::max)(p0[1], (std::max)(p1[1], p2[1])) }; boxes.push_back(Box(bx, by, fd)); } From e8492690c2eb659f3376728124ed3c70f47b2d90 Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Tue, 8 Nov 2022 18:02:21 +0100 Subject: [PATCH 31/42] use emplace_back --- .../CGAL/Surface_mesh_parameterization/internal/validity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h index 9b41bb25649..b016a2b965c 100644 --- a/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h +++ b/Surface_mesh_parameterization/include/CGAL/Surface_mesh_parameterization/internal/validity.h @@ -276,7 +276,7 @@ bool is_one_to_one_mapping(const TriangleMesh& mesh, (std::min)(p0[1], (std::min)(p1[1], p2[1])) }; NT by[2] = { (std::max)(p0[0], (std::max)(p1[0], p2[0])), (std::max)(p0[1], (std::max)(p1[1], p2[1])) }; - boxes.push_back(Box(bx, by, fd)); + boxes.emplace_back(bx, by, fd); } std::vector boxes_ptr; From 9a7757c86ef9f1b426eca77605c9801ad82af4fb Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 9 Nov 2022 09:47:04 +0100 Subject: [PATCH 32/42] decltype(auto) -> auto to avoid references to temp Visual Studio diagnoses: ``` C4172 : returning address of local variable or temporary ``` (reverts 0e898d90941245b412a0e2912e09e7bc315c71eb) --- Filtered_kernel/include/CGAL/Converting_construction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Filtered_kernel/include/CGAL/Converting_construction.h b/Filtered_kernel/include/CGAL/Converting_construction.h index 42076b5d20f..2f6da83df49 100644 --- a/Filtered_kernel/include/CGAL/Converting_construction.h +++ b/Filtered_kernel/include/CGAL/Converting_construction.h @@ -37,7 +37,7 @@ struct Converting_construction template ::value>* = nullptr> - decltype(auto) operator()(Args&&... args) const { + auto operator()(Args&&... args) const { return backward_convert(construct(convert(args)...)); } }; From 2e90313b07383413663e066d05d4fe09b30553d7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Wed, 9 Nov 2022 10:50:01 +0100 Subject: [PATCH 33/42] In cpp20 namespace: CGAL::cpp20::remove_cvref --- .../CGAL/Cartesian/Is_trivial_construction.h | 44 +++++++++---------- STL_Extension/include/CGAL/type_traits.h | 18 +++++--- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h index 76ab457d5e0..cbea914c35e 100644 --- a/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h +++ b/Cartesian_kernel/include/CGAL/Cartesian/Is_trivial_construction.h @@ -59,7 +59,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -76,7 +76,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -96,7 +96,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -116,7 +116,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -136,7 +136,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -159,7 +159,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -177,7 +177,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -195,7 +195,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -210,7 +210,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -229,7 +229,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -244,7 +244,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -259,7 +259,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -277,7 +277,7 @@ struct Is_trivial_construction static Tag_false trivial(...); - enum { value = decltype(trivial(std::declval>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -292,7 +292,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -309,7 +309,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -331,7 +331,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -353,7 +353,7 @@ struct Is_trivial_construction>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -368,7 +368,7 @@ struct Is_trivial_construction, A \ static Tag_false trivial(...); - enum { value = decltype(trivial(std::declval>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -383,7 +383,7 @@ struct Is_trivial_construction, A \ static Tag_false trivial(...); - enum { value = decltype(trivial(std::declval>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -409,7 +409,7 @@ struct Is_trivial_construction, static Tag_false trivial(...); - enum { value = decltype(trivial(std::declval>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -430,7 +430,7 @@ struct Is_trivial_construction static Tag_false trivial(...); - enum { value = decltype(trivial(std::declval>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; @@ -447,7 +447,7 @@ struct Is_trivial_construction static Tag_false trivial(...); - enum { value = decltype(trivial(std::declval>()...))::value || + enum { value = decltype(trivial(std::declval>()...))::value || Is_trivial_construction_base, Args...>::value }; }; diff --git a/STL_Extension/include/CGAL/type_traits.h b/STL_Extension/include/CGAL/type_traits.h index 7595aa13d5b..59aae8a0307 100644 --- a/STL_Extension/include/CGAL/type_traits.h +++ b/STL_Extension/include/CGAL/type_traits.h @@ -27,14 +27,18 @@ struct is_same_or_derived : >::type {}; -template< class T > -struct remove_cvref { - typedef std::remove_cv_t> type; -}; +namespace cpp20 { -template< class T > -using remove_cvref_t = typename remove_cvref::type; + template< class T > + struct remove_cvref { + typedef std::remove_cv_t> type; + }; -} + template< class T > + using remove_cvref_t = typename remove_cvref::type; + +} // end namespace cpp20 + +} // end namespace CGAL #endif // CGAL_TYPE_TRAITS_H From bf114a45093ed22a922903b88bc824865a781e32 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 22 Nov 2022 16:13:35 +0100 Subject: [PATCH 34/42] Remove CGAL_EPICK_SINGLE_PRECISION --- .../Exact_predicates_inexact_constructions_kernel.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h index 341c663007d..783d7e8277b 100644 --- a/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h +++ b/Kernel_23/include/CGAL/Exact_predicates_inexact_constructions_kernel.h @@ -33,17 +33,10 @@ constexpr bool epick_use_static_filter = true; #endif -#ifndef CGAL_EPICK_SINGLE_PRECISION // Here Epick is a class, and Double_precision_epick an alias to it. class Epick; class Single_precision_epick; using Double_precision_epick = Epick; -#else // CGAL_EPICK_SINGLE_PRECISION -// Here, Epick is an alias to Single_precision_epick. -class Single_precision_epick; -class Double_precision_epick; -using Epick = Single_precision_epick; -#endif // CGAL_EPICK_SINGLE_PRECISION namespace internal { @@ -64,15 +57,10 @@ namespace internal { Filtered_kernel_adaptor, epick_use_static_filter>; }; -#ifndef CGAL_EPICK_SINGLE_PRECISION // The following is equivalent to Filtered_kernel< Simple_cartesian >, // but it's shorter in terms of template name length (for error messages, mangling...). class Epick : public internal::Epick_with_filtered_predicates {}; -#else // CGAL_EPICK_SINGLE_PRECISION -class Double_precision_epick : public internal::Epick_with_filtered_predicates -{}; -#endif // CGAL_EPICK_SINGLE_PRECISION template <> struct Triangulation_structural_filtering_traits { From 6ef0a847b4b3344a7d052041d75b848758a11d45 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 22 Nov 2022 16:23:49 +0100 Subject: [PATCH 35/42] Revert previous change --- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index d92705f7b27..068420d1b58 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -937,7 +937,7 @@ public: * Warning: Here we don't check if cells are in c3t3 */ template - double min_sliver_value(const Cell_vector& cells, + FT min_sliver_value(const Cell_vector& cells, const SliverCriterion& criterion, const bool use_cache = true) const; @@ -3720,7 +3720,7 @@ number_of_incident_slivers(const Vertex_handle& v, template template -double +typename C3T3_helpers::FT C3T3_helpers:: min_sliver_value(const Cell_vector& cells, const SliverCriterion& criterion, @@ -3741,12 +3741,12 @@ min_sliver_value(const Cell_vector& cells, // //return *(std::min_element(make_transform_iterator(cells.begin(),sc_value), // make_transform_iterator(cells.end(),sc_value))); - double min_value = criterion.get_max_value(); + FT min_value = criterion.get_max_value(); for(typename Cell_vector::const_iterator it = cells.begin(); it != cells.end(); ++it) { - min_value = (std::min)(criterion(*it), min_value); + min_value = (std::min)(criterion(*it), min_value); } return min_value; } From 1e6ff1b98618c34a2338eb7da5e885b708dca56d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 22 Nov 2022 16:24:06 +0100 Subject: [PATCH 36/42] Fix a warning about uninitialized value --- Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h index 068420d1b58..7d44ec96f92 100644 --- a/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h +++ b/Mesh_3/include/CGAL/Mesh_3/C3T3_helpers.h @@ -3465,7 +3465,7 @@ get_least_square_surface_plane(const Vertex_handle& v, // In some cases point is not a real surface point if ( triangles.empty() ) - return std::make_pair(boost::none, Bare_point()); + return std::make_pair(boost::none, Bare_point(ORIGIN)); // Compute least square fitting plane Plane_3 plane; From 36cf65d327dc91843e7000320aecc80fb4f4cc74 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 22 Nov 2022 16:38:19 +0100 Subject: [PATCH 37/42] FT as return type is enforced by the base class --- Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h b/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h index 77e2940b247..59b8e51a436 100644 --- a/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h +++ b/Mesh_2/include/CGAL/Mesh_2/Lipschitz_sizing_field_2.h @@ -145,12 +145,12 @@ public: return *this; } - FT operator()(const Point& p) const + FT operator()(const Point& p) const override { if(points.empty() || points.size() == 1) - return K; + return FT(K); Site ns = (*ag.nearest_neighbor(p)).site(); - return K * weighted_distance(p, ns); + return FT(K * weighted_distance(p, ns)); } void set_K(double k) From 60b5642b7c15634ff41dd146cbaf6311993e4ed6 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 18 Apr 2023 11:40:12 +0200 Subject: [PATCH 38/42] only use msvc::no_unique_address with C++20 or later --- Installation/include/CGAL/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/include/CGAL/config.h b/Installation/include/CGAL/config.h index c88c0c5a32c..b4b65e75e18 100644 --- a/Installation/include/CGAL/config.h +++ b/Installation/include/CGAL/config.h @@ -346,7 +346,7 @@ using std::max; #define CGAL_NORETURN [[noreturn]] // Macro to specify [[no_unique_address]] if supported -#if _MSC_VER >= 1929 +#if _MSC_VER >= 1929 && _MSVC_LANG >= 202002L // see https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/#c20-no_unique_address # define CGAL_NO_UNIQUE_ADDRESS [[msvc::no_unique_address]] #elif __has_cpp_attribute(no_unique_address) From af5468c3a84b6fb099c9906e407a678d8ef4a6f9 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 20 Apr 2023 21:15:19 +0200 Subject: [PATCH 39/42] fix runtime error with single precision (float) --- .../Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index 69f89bf9cc5..ab258f0a3d3 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -639,7 +639,7 @@ auto unit = [](CGAL::Vector_2 v) { return v / CGAL::approximate_sqrt(v*v); }; assert(p1 == p.transform(comp1) || nonexact); p1 = p.transform(refl); p1 = p1.transform(trans); - assert(p1 == p.transform(comp2)); + assert(p1 == p.transform(comp2) || nonexact); //with scaling CGAL::Aff_transformation_2 scal(CGAL::SCALING, 2); comp1 = refl*scal; From 42297b06a4536b805dd089e376d08b602b911ff4 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Mon, 24 Apr 2023 14:49:42 +0200 Subject: [PATCH 40/42] fix runtime error with single precision (float), cont. --- .../Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h index ab258f0a3d3..767bb34b381 100644 --- a/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h +++ b/Kernel_23/test/Kernel_23/include/CGAL/_test_cls_aff_transformation_2.h @@ -635,7 +635,7 @@ auto unit = [](CGAL::Vector_2 v) { return v / CGAL::approximate_sqrt(v*v); }; comp2(trans*refl); p1 = p.transform(trans); p1 = p1.transform(refl); - assert(p1 == CGAL::Point_2(1,-2)); + assert(p1 == CGAL::Point_2(1,-2) || nonexact); assert(p1 == p.transform(comp1) || nonexact); p1 = p.transform(refl); p1 = p1.transform(trans); @@ -668,7 +668,7 @@ auto unit = [](CGAL::Vector_2 v) { return v / CGAL::approximate_sqrt(v*v); }; comp2 = refl2*refl; p1 = p.transform(refl2); p1 = p1.transform(refl); - assert(p1 == p.transform(comp1)); + assert(p1 == p.transform(comp1) || nonexact); p1 = p.transform(refl); p1 = p1.transform(refl2); assert(p1 == p.transform(comp2) || nonexact); From f530f697522d2a8c0d7aa08779e6e9ce5e013e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 2 May 2023 15:23:17 +0200 Subject: [PATCH 41/42] try to suppress warnings --- Kernel_23/test/Kernel_23/Filtered_cartesian.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp index a6bd0f9bd7f..192b563391c 100644 --- a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp +++ b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp @@ -25,6 +25,7 @@ #include #include +#include #include @@ -76,8 +77,16 @@ main() test(); std::cout << "Testing with Double_precision_epick:\n"; test(); + +# if defined(BOOST_MSVC) +# pragma warning(push) +# pragma warning(disable: 4244) +# endif std::cout << "Testing with Simple_precision_epick:\n"; test(); +# if defined(BOOST_MSVC) +# pragma warning(pop) +# endif return 0; } From c1ceeaed55a5750c4eb930bd10db903ee3cc138f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 May 2023 18:21:29 +0200 Subject: [PATCH 42/42] try be less aggressive --- Kernel_23/test/Kernel_23/Filtered_cartesian.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp index 192b563391c..4ba63964050 100644 --- a/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp +++ b/Kernel_23/test/Kernel_23/Filtered_cartesian.cpp @@ -25,7 +25,6 @@ #include #include -#include #include