From 84d0f6b9a610f08f6a2ff6760a6a03ecd8eeab5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 19 Nov 2024 17:46:22 +0100 Subject: [PATCH 1/8] use default_random --- .../Tetrahedral_remeshing/test_tetrahedral_remeshing_io.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_io.cpp b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_io.cpp index fa3220b0635..212d72f7112 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_io.cpp +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/test_tetrahedral_remeshing_io.cpp @@ -21,9 +21,10 @@ typedef Remeshing_triangulation::Cell_handle Cell_handle; int main(int argc, char* argv[]) { + const unsigned int nbv = (argc > 1) ? atoi(argv[1]) : 100; - CGAL::Random rng; + CGAL::Random rng = CGAL::get_default_random(); std::cout << "CGAL Random seed = " << CGAL::get_default_random().get_seed() << std::endl; std::vector points; From 56f57215b6aa96385cdcac12b7d166791fa6e56e Mon Sep 17 00:00:00 2001 From: mbarbier Date: Wed, 27 Nov 2024 09:19:23 +0000 Subject: [PATCH 2/8] Fixing ICPC usage with modern cmake and wrappers Related to conan's conan-io/conan-center-index#25843 replaced 'fp-model strict' by 'fp-model=strict' https://www.intel.com/content/www/us/en/docs/cpp-compiler/developer-guide-reference/2021-8/fp-model-fp.html for more compatibility with nvcc. as 'fp-model=strict' will be directly transmited to the compiler while 'fp-model strict' will have 'strict' being treated as a file input. Also added a CXX only filter for newer cmake 3.3+ --- Installation/CMakeLists.txt | 4 ++-- .../modules/CGAL_SetupCGALDependencies.cmake | 16 ++++++++++++---- Number_types/include/CGAL/Interval_nt.h | 4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 11ade3231f1..18f6f45c05a 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -429,12 +429,12 @@ if("${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES ) else() message( - STATUS "Using Intel Compiler version 11 or later. Adding -fp-model strict" + STATUS "Using Intel Compiler version 11 or later. Adding -fp-model=strict" ) if(WIN32) uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict") else() - uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model strict") + uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model=strict") endif() endif() endif() diff --git a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake index 60e2bd25c4d..e3dadc7b4e4 100644 --- a/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake +++ b/Installation/cmake/modules/CGAL_SetupCGALDependencies.cmake @@ -132,11 +132,19 @@ function(CGAL_setup_CGAL_flags target) $<$:/bigobj> # Use /bigobj by default ) elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") - message( STATUS "Using Intel Compiler. Adding -fp-model strict" ) - if(WIN32) - target_compile_options(${target} INTERFACE "/fp:strict") + # cuda knows how to deal with 'fp-model=strict' but not 'fp-model strict' + if(CMAKE_VERSION VERSION_LESS 3.3) + if(WIN32) + target_compile_options(${target} INTERFACE "/fp:strict") + else() + target_compile_options(${target} INTERFACE "-fp-model=strict") + endif() else() - target_compile_options(${target} INTERFACE "-fp-model" "strict") + if(WIN32) + target_compile_options(${target} INTERFACE "$<$:/fp:strict>") + else() + target_compile_options(${target} INTERFACE "$<$:-fp-model=strict>") + endif() endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "SunPro") message( STATUS "Using SunPro compiler, using STLPort 4." ) diff --git a/Number_types/include/CGAL/Interval_nt.h b/Number_types/include/CGAL/Interval_nt.h index 4a03e3ef882..f70312178b7 100644 --- a/Number_types/include/CGAL/Interval_nt.h +++ b/Number_types/include/CGAL/Interval_nt.h @@ -285,9 +285,9 @@ private: // the 2 negations and we get wrong rounding. typename Interval_nt<>::Internal_protector P; CGAL_assertion_msg(-CGAL_IA_MUL(-1.1, 10.1) != CGAL_IA_MUL(1.1, 10.1), - "Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?"); + "Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model=strict for Intel)?"); CGAL_assertion_msg(-CGAL_IA_DIV(-1., 10) != CGAL_IA_DIV(1., 10), - "Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model strict for Intel)?"); + "Wrong rounding: did you forget the -frounding-math option if you use GCC (or -fp-model=strict for Intel)?"); } }; From 1b7e7bea6a175d9f25b007bde8601d2173c66162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 28 Nov 2024 14:37:00 +0100 Subject: [PATCH 3/8] fix dynamic with default for graph inheriting from another graph --- .../graph/graph_traits_inheritance_macros.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h b/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h index 12faf7e2a0c..9a88014752d 100644 --- a/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h +++ b/BGL/include/CGAL/boost/graph/graph_traits_inheritance_macros.h @@ -72,16 +72,16 @@ struct property_map namespace CGAL { \ template \ typename boost::property_map >::type \ -get(DTAG t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g) \ +get(DTAG t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ { \ - return get(t, static_cast(g)); \ + return get(t, static_cast(g), default_value); \ } \ \ template \ typename boost::property_map >::const_type \ -get(DTAG t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g) \ +get(DTAG t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ { \ - return get(t, static_cast(g)); \ + return get(t, static_cast(g), default_value); \ }\ } //CGAL namespace @@ -131,16 +131,16 @@ struct property_map namespace CGAL { \ template \ typename boost::property_map >::type \ -get(DTAG t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g) \ +get(DTAG t, CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ { \ - return get(t, static_cast(g)); \ + return get(t, static_cast(g), default_value); \ } \ \ template \ typename boost::property_map >::const_type \ -get(DTAG t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g) \ +get(DTAG t, const CGAL_GRAPH_TRAITS_INHERITANCE_CLASS_NAME& g, const CGAL_XX_YATP& default_value = CGAL_XX_YATP()) \ { \ - return get(t, static_cast(g)); \ + return get(t, static_cast(g), default_value); \ }\ } //CGAL namespace From cab2412bee85151bbf6bafbe49bc776c6e4fbcda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 29 Nov 2024 21:13:11 +0100 Subject: [PATCH 4/8] add missing default for LCC --- ...properties_Linear_cell_complex_for_combinatorial_map.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex_for_combinatorial_map.h b/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex_for_combinatorial_map.h index 2689f86253c..842ff86f7cd 100644 --- a/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex_for_combinatorial_map.h +++ b/Linear_cell_complex/include/CGAL/boost/graph/properties_Linear_cell_complex_for_combinatorial_map.h @@ -443,11 +443,11 @@ template , \ TAG >::const_type \ -get(TAG, const Linear_cell_complex_for_combinatorial_map&) \ +get(TAG, const Linear_cell_complex_for_combinatorial_map&, const T& default_value = T()) \ { \ typedef Linear_cell_complex_for_combinatorial_map LCC;\ typedef typename boost::graph_traits::DESC DESC; \ - return internal::Dynamic_property_map();\ + return internal::Dynamic_property_map(default_value);\ } \ \ template , \ TAG >::type \ -get(TAG, Linear_cell_complex_for_combinatorial_map&) \ +get(TAG, Linear_cell_complex_for_combinatorial_map&, const T& default_value = T()) \ { \ typedef Linear_cell_complex_for_combinatorial_map LCC;\ typedef typename boost::graph_traits::DESC DESC; \ - return internal::Dynamic_property_map();\ + return internal::Dynamic_property_map(default_value);\ } \ } From 400e4a9d421192a6aa2771727c64c7873b697bff Mon Sep 17 00:00:00 2001 From: POUGET Marc Date: Mon, 2 Dec 2024 13:57:09 +0100 Subject: [PATCH 5/8] fixed mandatory code in CGAL_assert --- .../CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index da42c7429f9..04be8869a3b 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -78,12 +78,14 @@ namespace internal { intersection(*c_pq, *c_qr, std::back_inserter(inters)); CGAL_assertion(assign(pair, inters[0])); + assign(pair, inters[0]); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; CGAL_assertion(assign(pair, inters[1])); + assign(pair, inters[1]); return pair.first; } return pair.first; @@ -105,12 +107,14 @@ namespace internal { intersection(*l, *c, std::back_inserter(inters)); CGAL_assertion(assign(pair,inters[0])); + assign(pair,inters[0]); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; CGAL_assertion(assign(pair, inters[1])); + assign(pair, inters[1]); return pair.first; } return pair.first; @@ -241,11 +245,13 @@ namespace internal { std::pair pair; CGAL_assertion(assign(pair,inters[0])); + assign(pair,inters[0]); CGAL_assertion(pair.second == 1); if(_gt.less_y_2_object()(p, q)) return Line_arc_2(bis_pq,a,pair.first); CGAL_assertion(assign(pair,inters[1])); + assign(pair,inters[1]); CGAL_assertion(pair.second == 1); return Line_arc_2(bis_pq,a,pair.first); } @@ -262,6 +268,7 @@ namespace internal { std::pair pair; CGAL_assertion(assign(pair,inters[0])); + assign(pair,inters[0]); CGAL_assertion(pair.second == 1); Hyperbolic_point_2 approx_pinf(to_double(pair.first.x()), to_double(pair.first.y())); @@ -276,6 +283,7 @@ namespace internal { } CGAL_assertion(assign(pair,inters[1])); + assign(pair,inters[1]); if(_gt.orientation_2_object()(approx_c,approx_a,approx_pinf) == POSITIVE) return Circular_arc_2(*c_pq, pair.first, a); From 469434d8a67f2361cf35a27ecd61d929eedc5998 Mon Sep 17 00:00:00 2001 From: POUGET Marc Date: Mon, 2 Dec 2024 14:21:19 +0100 Subject: [PATCH 6/8] applied Seb suggestion --- ...bolic_Delaunay_triangulation_CK_traits_2.h | 48 +++++++++++-------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index 04be8869a3b..ea57ad56e8b 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -77,16 +77,18 @@ namespace internal { std::vector< Intersection_result > inters; intersection(*c_pq, *c_qr, std::back_inserter(inters)); - CGAL_assertion(assign(pair, inters[0])); - assign(pair, inters[0]); - if(pair.second == 1) + CGAL_assertion_code(bool ok=) + assign(pair, inters[0]); + CGAL_assertion(ok); + if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; - CGAL_assertion(assign(pair, inters[1])); - assign(pair, inters[1]); - return pair.first; + CGAL_assertion_code(bool ok=) + assign(pair, inters[1]); + CGAL_assertion(ok); + return pair.first; } return pair.first; } @@ -106,16 +108,18 @@ namespace internal { std::vector< Intersection_result > inters; intersection(*l, *c, std::back_inserter(inters)); - CGAL_assertion(assign(pair,inters[0])); - assign(pair,inters[0]); + CGAL_assertion_code(bool ok=) + assign(pair,inters[0]); + CGAL_assertion(ok); if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; - CGAL_assertion(assign(pair, inters[1])); - assign(pair, inters[1]); - return pair.first; + CGAL_assertion_code(bool ok=) + assign(pair, inters[1]); + CGAL_assertion(ok); + return pair.first; } return pair.first; } @@ -244,14 +248,16 @@ namespace internal { intersection(bis_pq, l_inf, std::back_inserter(inters)); std::pair pair; - CGAL_assertion(assign(pair,inters[0])); - assign(pair,inters[0]); - CGAL_assertion(pair.second == 1); + CGAL_assertion_code(bool ok=) + assign(pair,inters[0]); + CGAL_assertion(ok); + CGAL_assertion(pair.second == 1); if(_gt.less_y_2_object()(p, q)) return Line_arc_2(bis_pq,a,pair.first); - CGAL_assertion(assign(pair,inters[1])); - assign(pair,inters[1]); + CGAL_assertion_code(bool ok=) + assign(pair,inters[1]); + CGAL_assertion(ok); CGAL_assertion(pair.second == 1); return Line_arc_2(bis_pq,a,pair.first); } @@ -267,8 +273,9 @@ namespace internal { intersection(*c_pq, l_inf, std::back_inserter(inters)); std::pair pair; - CGAL_assertion(assign(pair,inters[0])); - assign(pair,inters[0]); + CGAL_assertion_code(bool ok=) + assign(pair,inters[0]); + CGAL_assertion(ok); CGAL_assertion(pair.second == 1); Hyperbolic_point_2 approx_pinf(to_double(pair.first.x()), to_double(pair.first.y())); @@ -282,8 +289,9 @@ namespace internal { return Circular_arc_2(*c_pq, pair.first, a); } - CGAL_assertion(assign(pair,inters[1])); - assign(pair,inters[1]); + CGAL_assertion_code(bool ok=) + assign(pair,inters[1]); + CGAL_assertion(ok); if(_gt.orientation_2_object()(approx_c,approx_a,approx_pinf) == POSITIVE) return Circular_arc_2(*c_pq, pair.first, a); From 08320bc1b792048e36091e0edf38bfe8feceb87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 3 Dec 2024 08:58:51 +0100 Subject: [PATCH 7/8] declare only once --- ...perbolic_Delaunay_triangulation_CK_traits_2.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index ea57ad56e8b..9f0660d0d30 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -249,15 +249,15 @@ namespace internal { std::pair pair; CGAL_assertion_code(bool ok=) - assign(pair,inters[0]); + assign(pair,inters[0]); CGAL_assertion(ok); - CGAL_assertion(pair.second == 1); + CGAL_assertion(pair.second == 1); if(_gt.less_y_2_object()(p, q)) return Line_arc_2(bis_pq,a,pair.first); - CGAL_assertion_code(bool ok=) - assign(pair,inters[1]); - CGAL_assertion(ok); + CGAL_assertion_code(ok=) + assign(pair,inters[1]); + CGAL_assertion(ok); CGAL_assertion(pair.second == 1); return Line_arc_2(bis_pq,a,pair.first); } @@ -274,7 +274,7 @@ namespace internal { std::pair pair; CGAL_assertion_code(bool ok=) - assign(pair,inters[0]); + assign(pair,inters[0]); CGAL_assertion(ok); CGAL_assertion(pair.second == 1); @@ -289,8 +289,8 @@ namespace internal { return Circular_arc_2(*c_pq, pair.first, a); } - CGAL_assertion_code(bool ok=) - assign(pair,inters[1]); + CGAL_assertion_code(ok=) + assign(pair,inters[1]); CGAL_assertion(ok); if(_gt.orientation_2_object()(approx_c,approx_a,approx_pinf) == POSITIVE) return Circular_arc_2(*c_pq, pair.first, a); From b33ce790b872b6abac2ff17d35a454389e7c6c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 3 Dec 2024 09:12:38 +0100 Subject: [PATCH 8/8] remove tabs --- ...rbolic_Delaunay_triangulation_CK_traits_2.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h index 9f0660d0d30..1dce4427198 100644 --- a/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h +++ b/Hyperbolic_triangulation_2/include/CGAL/Hyperbolic_Delaunay_triangulation_CK_traits_2.h @@ -78,17 +78,17 @@ namespace internal { intersection(*c_pq, *c_qr, std::back_inserter(inters)); CGAL_assertion_code(bool ok=) - assign(pair, inters[0]); - CGAL_assertion(ok); - if(pair.second == 1) + assign(pair, inters[0]); + CGAL_assertion(ok); + if(pair.second == 1) { if(_gt.has_on_bounded_side_2_object()(l_inf, pair.first)) return pair.first; CGAL_assertion_code(bool ok=) - assign(pair, inters[1]); + assign(pair, inters[1]); CGAL_assertion(ok); - return pair.first; + return pair.first; } return pair.first; } @@ -109,7 +109,7 @@ namespace internal { intersection(*l, *c, std::back_inserter(inters)); CGAL_assertion_code(bool ok=) - assign(pair,inters[0]); + assign(pair,inters[0]); CGAL_assertion(ok); if(pair.second == 1) { @@ -117,9 +117,9 @@ namespace internal { return pair.first; CGAL_assertion_code(bool ok=) - assign(pair, inters[1]); - CGAL_assertion(ok); - return pair.first; + assign(pair, inters[1]); + CGAL_assertion(ok); + return pair.first; } return pair.first; }