From 8f2baf44ea5a675b6e0a24601dde565d7d168d4c Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 14 Aug 2025 12:41:27 +0200 Subject: [PATCH 1/6] warning fix improving test output in ksp --- .../include/CGAL/KSP_3/Data_structure.h | 10 ------ .../kinetic_3d_test_all.cpp | 34 +++++++++++++++---- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h b/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h index 8514cff93d8..662b0ff3200 100644 --- a/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h +++ b/Kinetic_space_partition/include/CGAL/KSP_3/Data_structure.h @@ -363,11 +363,6 @@ public: if (m_intersection_graph.iedge_is_on_bbox(edge)) return 0; - // Count faces - std::size_t numfaces = 0; - for (std::size_t i = 0; i < m_support_planes.size(); i++) - numfaces += m_support_planes[i].data().mesh.number_of_faces(); - Support_plane& sp = m_support_planes[sp_idx]; To_exact to_exact; @@ -550,11 +545,6 @@ public: template void fill_event_queue(Queue& queue) { - // Count faces - std::size_t faces = 0; - for (std::size_t i = 0; i < m_support_planes.size(); i++) - faces += m_support_planes[i].data().mesh.number_of_faces(); - for (std::size_t sp_idx = 6; sp_idx < m_support_planes.size(); sp_idx++) { std::vector border; m_support_planes[sp_idx].get_border(m_intersection_graph, border); diff --git a/Kinetic_space_partition/test/Kinetic_space_partition/kinetic_3d_test_all.cpp b/Kinetic_space_partition/test/Kinetic_space_partition/kinetic_3d_test_all.cpp index 1fb8898a153..ec20f21d091 100644 --- a/Kinetic_space_partition/test/Kinetic_space_partition/kinetic_3d_test_all.cpp +++ b/Kinetic_space_partition/test/Kinetic_space_partition/kinetic_3d_test_all.cpp @@ -11,6 +11,9 @@ using EPICK = CGAL::Exact_predicates_inexact_constructions_kernel; using EPECK = CGAL::Exact_predicates_exact_constructions_kernel; std::size_t different = 0; +std::size_t no_input = 0; +std::size_t failed = 0; +std::size_t passed = 0; template bool run_test( @@ -33,7 +36,7 @@ bool run_test( input_file_ply.close(); else { std::cerr << "ERROR: can't read the OFF/PLY file " << filename << "!" << std::endl; - different++; + no_input++; return false; } @@ -56,7 +59,9 @@ bool run_test( std::cout << ksp.number_of_volumes() << std::endl; - if (results[i][0] != count[0] || results[i][1] != count[2] || results[i][2] != count[3]) { + if (ksp.number_of_volumes() == 0) + failed++; + else if (results[i][0] != count[0] || results[i][1] != count[2] || results[i][2] != count[3]) { std::cout << "TEST differs: Partitioning has not expected number of vertices, faces or volumes for k = " << ks[i] << std::endl; std::cout << "Expectation:" << std::endl; @@ -66,7 +71,10 @@ bool run_test( different++; } - else std::cout << "TEST PASSED k = " << ks[i] << " " << input_filename << std::endl; + else { + passed++; + std::cout << "TEST PASSED k = " << ks[i] << " " << input_filename << std::endl; + } } return true; @@ -277,11 +285,25 @@ void run_all_tests() { results[2] = { 1395, 3115, 882 }; run_test("data/real-data-test/test-40-polygons.ply", { 1, 2, 3 }, results); + std::cout << "\n"; + const auto kernel_name = boost::typeindex::type_id().pretty_name(); - if (different != 0) { - std::cout << std::endl << kernel_name << " " << different << " TESTS differ from typical values!" << std::endl << std::endl; + if (no_input != 0) { + std::cout << kernel_name << " " << no_input << " TESTS failed due to missing input files!\n"; } - std::cout << std::endl << kernel_name << " TESTS SUCCESS!" << std::endl << std::endl; + + if (failed != 0) { + std::cout << kernel_name << " " << failed << " TESTS failed! The space partition was empty!\n"; + } + + if (different != 0) { + std::cout << kernel_name << " " << different << " TESTS differ from typical values!\n"; + } + + if (passed != 0) + std::cout << kernel_name << " " << passed << " TESTS passed!\n"; + + std::cout << "\n" << kernel_name << " TESTS FINISHED!" << std::endl; } int main(const int /* argc */, const char** /* argv */) { From ea15e10289b109ffe8fe7dcad9b7568e50f6cc85 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Mon, 1 Sep 2025 13:21:53 +0200 Subject: [PATCH 2/6] removing unused variables or adding CGAL_USE --- Lab/demo/Lab/triangulate_primitive.h | 5 ----- Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h | 6 +----- Partition_2/include/CGAL/partition_is_valid_2.h | 1 + .../internal/Dehn_hyperbolic_octagon_translation_word.h | 3 --- Point_set_processing_3/include/CGAL/IO/write_las_points.h | 8 +++++++- .../include/CGAL/Polyline_simplification_2/simplify.h | 3 +-- SMDS_3/include/CGAL/IO/File_maya.h | 7 +++---- .../Surface_mesh_simplification/internal/Edge_collapse.h | 2 ++ .../Segment_Delaunay_graph_degeneracy_testers.h | 2 ++ 9 files changed, 17 insertions(+), 20 deletions(-) diff --git a/Lab/demo/Lab/triangulate_primitive.h b/Lab/demo/Lab/triangulate_primitive.h index 54fceb64eb3..8093ed4e3bc 100644 --- a/Lab/demo/Lab/triangulate_primitive.h +++ b/Lab/demo/Lab/triangulate_primitive.h @@ -145,14 +145,9 @@ private: Vertex_handle previous, first, last_inserted; // Iterate the points of the facet and decide if they must be inserted in the CDT - typename Kernel::FT x(0), y(0), z(0); - for(std::size_t i = 0;i& idPoint = idPoints[i]; - x += idPoint.first.x(); - y += idPoint.first.y(); - z += idPoint.first.z(); Vertex_handle vh; // Always insert the first point, then only insert if the distance with the previous is reasonable. diff --git a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h index 2c0539b9be0..8d452ee8036 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h +++ b/Mesh_3/include/CGAL/Mesh_3/Sliver_perturber.h @@ -1285,8 +1285,6 @@ perturb_vertex( PVertex pv CGAL_assertion(pv.is_perturbable()); - int num_new_vertices_to_treat = 0; - Cell_vector slivers; slivers.reserve(8); if (!helper_.try_lock_and_get_incident_slivers( @@ -1349,8 +1347,7 @@ perturb_vertex( PVertex pv pv.increment_try_nb(); // update modified vertices - num_new_vertices_to_treat += - update_priority_queue(modified_vertices, sliver_bound, visitor, bad_vertices); + update_priority_queue(modified_vertices, sliver_bound, visitor, bad_vertices); } else { @@ -1372,7 +1369,6 @@ perturb_vertex( PVertex pv if (pv.is_perturbable()) { enqueue_task(pv, sliver_bound, visitor, bad_vertices); - ++num_new_vertices_to_treat; } } else diff --git a/Partition_2/include/CGAL/partition_is_valid_2.h b/Partition_2/include/CGAL/partition_is_valid_2.h index f6a5f2bbd7f..1c33e9e42b0 100644 --- a/Partition_2/include/CGAL/partition_is_valid_2.h +++ b/Partition_2/include/CGAL/partition_is_valid_2.h @@ -157,6 +157,7 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, int poly_num = 0; for (; poly_first != poly_last; poly_first++, poly_num++) { + CGAL_USE(poly_num); vtx_begin = (*poly_first).vertices_begin(); vtx_end = (*poly_first).vertices_end(); #ifdef CGAL_PARTITION_CHECK_DEBUG diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h index 709da137caf..bfdf687f2ec 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_triangulation_2/internal/Dehn_hyperbolic_octagon_translation_word.h @@ -89,7 +89,6 @@ private: { Word_idx_type start = 0; Word_idx_type mstart = 0; - Word_idx_type end = 1; Word_idx_type max = 1; Word_idx_type len = 1; std::vector tmp, mvec; @@ -98,7 +97,6 @@ private: { if(is_next_relation_index(w[i], w[i-1])) { - end++; len++; tmp.push_back(w[i]); if(len > max) { @@ -112,7 +110,6 @@ private: tmp.clear(); tmp.push_back(w[i]); start = i; - end = i; len = 0; } } diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index f3a96c919fd..56d8d84b2e3 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -103,7 +103,13 @@ namespace LAS { inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::Withheld_flag&) { r.set_withheld_flag(v); } inline void output_value(LASpoint& r, const float& v, const LAS_property::Scan_angle&) - { r.set_scan_angle_rank(char(v)); } + { +#if LAS_TOOLS_VERSION < 250517 + r.set_scan_angle_rank(v); +#else + r.set_scan_angle(v); +#endif + } inline void output_value(LASpoint& r, const unsigned char& v, const LAS_property::User_data&) { r.set_user_data(v); } inline void output_value(LASpoint& r, const unsigned short& v, const LAS_property::Point_source_ID&) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index 9e7fe636d01..b2828d617d0 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -232,10 +232,9 @@ public: void initialize_costs() { - int n=0; Constraint_iterator cit = pct.constraints_begin(), e = pct.constraints_end(); for(; cit!=e; ++cit){ - n+= initialize_costs(*cit); + initialize_costs(*cit); } } diff --git a/SMDS_3/include/CGAL/IO/File_maya.h b/SMDS_3/include/CGAL/IO/File_maya.h index 682f9540642..bc49db38dd8 100644 --- a/SMDS_3/include/CGAL/IO/File_maya.h +++ b/SMDS_3/include/CGAL/IO/File_maya.h @@ -150,10 +150,10 @@ output_to_maya(std::ostream& os, { facets_sstr << " setAttr -s " << number_of_triangles << " \".fc[0:" << number_of_triangles-1 << "]\" -type \"polyFaces\" \n"; - int c = 0; + for( Facet_iterator fit = c3t3.facets_in_complex_begin(); fit != c3t3.facets_in_complex_end(); - ++fit, ++c) + ++fit) { int indices[3]; //Weighted_point points[3]; @@ -207,10 +207,9 @@ output_to_maya(std::ostream& os, { facets_sstr << " setAttr -s " << 4*c3t3.number_of_cells_in_complex() << " \".fc[0:" << 4*c3t3.number_of_cells_in_complex()-1 << "]\" -type \"polyFaces\" \n"; - int c = 0; for( Cell_iterator cit = c3t3.cells_in_complex_begin(); cit != c3t3.cells_in_complex_end(); - ++cit, ++c) + ++cit) { for (int facet_i = 0 ; facet_i < 4 ; ++facet_i) { diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index d53b3458d15..91a585dc683 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -668,6 +668,8 @@ loop() CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " uncomputable cost." ); } } + + CGAL_assertion_code(CGAL_USE(non_collapsable_count)); } template diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h index a0247015aaf..34eca5b4923 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h @@ -209,6 +209,8 @@ class Segment_Delaunay_graph_face_tester_2 ++ec; } while ( ec != ec_start ); + CGAL_USE(n_inf); + if ( deg == n_degen ) { return true; } if ( n_non_degen != 2 ) { return false; } From e84de2cead75769e635e732a9e0047990b90ecdc Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Wed, 3 Sep 2025 17:16:07 +0200 Subject: [PATCH 3/6] some fixes --- Point_set_processing_3/include/CGAL/IO/write_las_points.h | 2 +- .../Surface_mesh_simplification/internal/Edge_collapse.h | 8 -------- .../Segment_Delaunay_graph_degeneracy_testers.h | 6 +----- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 56d8d84b2e3..b053c1d38d6 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -105,7 +105,7 @@ namespace LAS { inline void output_value(LASpoint& r, const float& v, const LAS_property::Scan_angle&) { #if LAS_TOOLS_VERSION < 250517 - r.set_scan_angle_rank(v); + r.set_scan_angle_rank(I8_QUANTIZE(v)); #else r.set_scan_angle(v); #endif diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h index 91a585dc683..896644d1797 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/internal/Edge_collapse.h @@ -588,8 +588,6 @@ loop() { CGAL_SMS_TRACE(0, "Collapsing edges..."); - CGAL_assertion_code(size_type non_collapsable_count = 0); - // Pops and processes each edge from the PQ std::optional opt_h; @@ -635,8 +633,6 @@ loop() } else { - CGAL_assertion_code(++non_collapsable_count); - m_visitor.OnNonCollapsable(profile); CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" ); @@ -656,8 +652,6 @@ loop() } else { - CGAL_assertion_code(++non_collapsable_count); - m_visitor.OnNonCollapsable(profile); CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" ); @@ -668,8 +662,6 @@ loop() CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " uncomputable cost." ); } } - - CGAL_assertion_code(CGAL_USE(non_collapsable_count)); } template diff --git a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h index 34eca5b4923..0008a930bf9 100644 --- a/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h +++ b/Voronoi_diagram_2/include/CGAL/Voronoi_diagram_2/Segment_Delaunay_graph_degeneracy_testers.h @@ -188,7 +188,6 @@ class Segment_Delaunay_graph_face_tester_2 Edge_circulator ec = ec_start; size_type deg = 0; // vertex degree size_type n_degen = 0; // number of degenerate/non-infinite edges - size_type n_inf = 0; // number of infinite edges // number of non-degenerate/non-infinite edges size_type n_non_degen = 0; @@ -196,8 +195,7 @@ class Segment_Delaunay_graph_face_tester_2 Edge_tester e_tester; do { if ( e_tester(dual, ec) ) { ++n_degen; } - else if ( dual.is_infinite(ec) ) { ++n_inf; } - else { + else if ( !dual.is_infinite(ec) ) { if ( !dual.is_infinite(ec) ) { if ( n_non_degen < 2 ) { e[n_non_degen] = *ec; @@ -209,8 +207,6 @@ class Segment_Delaunay_graph_face_tester_2 ++ec; } while ( ec != ec_start ); - CGAL_USE(n_inf); - if ( deg == n_degen ) { return true; } if ( n_non_degen != 2 ) { return false; } From 978023183c2109792917a7edc2cce099b716989d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 10 Sep 2025 09:23:07 +0100 Subject: [PATCH 4/6] Undo change as another one is made in PR #9040 --- .../include/CGAL/Polyline_simplification_2/simplify.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h index b2828d617d0..0a4819afcb4 100644 --- a/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h +++ b/Polyline_simplification_2/include/CGAL/Polyline_simplification_2/simplify.h @@ -232,9 +232,10 @@ public: void initialize_costs() { + int n=0; Constraint_iterator cit = pct.constraints_begin(), e = pct.constraints_end(); for(; cit!=e; ++cit){ - initialize_costs(*cit); + n+=initialize_costs(*cit); } } From db096a938be2ed014f867217a0103b69185cd130 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 11 Sep 2025 15:30:50 +0200 Subject: [PATCH 5/6] reverted change to Partition_2 (unused variable) --- Partition_2/include/CGAL/partition_is_valid_2.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Partition_2/include/CGAL/partition_is_valid_2.h b/Partition_2/include/CGAL/partition_is_valid_2.h index 1c33e9e42b0..f6a5f2bbd7f 100644 --- a/Partition_2/include/CGAL/partition_is_valid_2.h +++ b/Partition_2/include/CGAL/partition_is_valid_2.h @@ -157,7 +157,6 @@ partition_is_valid_2 (InputIterator point_first, InputIterator point_last, int poly_num = 0; for (; poly_first != poly_last; poly_first++, poly_num++) { - CGAL_USE(poly_num); vtx_begin = (*poly_first).vertices_begin(); vtx_end = (*poly_first).vertices_end(); #ifdef CGAL_PARTITION_CHECK_DEBUG From 9cefab759d91787daf3da01e217e55eddc5e8ab8 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Thu, 18 Sep 2025 16:33:34 +0200 Subject: [PATCH 6/6] adding dependencies for print_MPFR_version.cpp --- Installation/cmake/modules/FindMPFR.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Installation/cmake/modules/FindMPFR.cmake b/Installation/cmake/modules/FindMPFR.cmake index b0507120ce0..891b2a7edbd 100644 --- a/Installation/cmake/modules/FindMPFR.cmake +++ b/Installation/cmake/modules/FindMPFR.cmake @@ -46,6 +46,9 @@ if (NOT MPFR_in_cache) if ( NOT MPFR_INCLUDE_DIR OR NOT MPFR_LIBRARIES_DIR ) include( MPFRConfig OPTIONAL ) endif() + + set(MPFR_DEPENDENCY_INCLUDE_DIR ${GMP_INCLUDE_DIR}) + set(MPFR_DEPENDENCY_LIBRARIES ${GMP_LIBRARIES}) endif()