From 7a6cae6e7b34c3b56adc409f5d38435af3c9e715 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Sat, 10 Feb 2024 22:56:06 +0100 Subject: [PATCH 1/4] Store index/dimension in 8 bits --- .../include/CGAL/TDS_full_cell_mirror_storage_policy.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h b/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h index f3e3bf770d14..748e82286e91 100644 --- a/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h +++ b/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h @@ -14,8 +14,8 @@ #include - #include +#include namespace CGAL { @@ -30,7 +30,7 @@ struct TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_ typedef TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_cell_default_storage_policy > Base; typedef typename Base::Vertex_handle_array Vertex_handle_array; typedef typename Base::Full_cell_handle_array Full_cell_handle_array; - typedef typename internal::S_or_D_array< int, typename Base::Dimen_plus > Int_array; + typedef typename internal::S_or_D_array< std::uint_least8_t, typename Base::Dimen_plus > Int_array; private: Int_array mirror_vertices_; @@ -42,7 +42,7 @@ struct TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_ void set_mirror_index(const int i, const int index) { - mirror_vertices_[i] = index; + mirror_vertices_[i] = static_cast(index); } int mirror_index(const int i) const { From 2cd718a0e775fe95f4f6eb2afae927f2f812fdfe Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Wed, 14 Feb 2024 09:36:15 +0100 Subject: [PATCH 2/4] Use a signed type for the index value -1 is used --- .../include/CGAL/TDS_full_cell_mirror_storage_policy.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h b/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h index 748e82286e91..63176f5ed30f 100644 --- a/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h +++ b/Triangulation/include/CGAL/TDS_full_cell_mirror_storage_policy.h @@ -30,7 +30,7 @@ struct TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_ typedef TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_cell_default_storage_policy > Base; typedef typename Base::Vertex_handle_array Vertex_handle_array; typedef typename Base::Full_cell_handle_array Full_cell_handle_array; - typedef typename internal::S_or_D_array< std::uint_least8_t, typename Base::Dimen_plus > Int_array; + typedef typename internal::S_or_D_array< std::int_least8_t, typename Base::Dimen_plus > Int_array; private: Int_array mirror_vertices_; @@ -42,7 +42,7 @@ struct TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_ void set_mirror_index(const int i, const int index) { - mirror_vertices_[i] = static_cast(index); + mirror_vertices_[i] = static_cast(index); } int mirror_index(const int i) const { From b01bb60534a064c795f63c7384df49a2f963f32a Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Wed, 14 Feb 2024 11:42:21 +0100 Subject: [PATCH 3/4] Document limit on dimension. --- .../doc/Triangulation/CGAL/Triangulation_ds_full_cell.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h b/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h index 148985c11b77..9aab53b759f0 100644 --- a/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h +++ b/Triangulation/doc/Triangulation/CGAL/Triangulation_ds_full_cell.h @@ -37,7 +37,7 @@ indices are not stored).
  • `CGAL::TDS_full_cell_default_storage_policy`. In that case, the mirror indices are not stored.
  • `CGAL::TDS_full_cell_mirror_storage_policy`. In that case, the mirror -indices are stored. +indices are stored. This last policy is not supported when the dimension is larger than 127. See the user manual for how to choose the second option. From 00e046346b8190e1d4c0979ff7500e559caa9974 Mon Sep 17 00:00:00 2001 From: Marc Glisse Date: Wed, 14 Feb 2024 11:46:02 +0100 Subject: [PATCH 4/4] Announce breaking change --- Installation/CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index be4ec7fd2b9f..208450afaf5c 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -76,6 +76,9 @@ Release date: October 2023 - Added three functions `vertices()` to the class `Triangulation_3`. Each of them returns an array containing the vertices of the given triangulation simplex. +### [dD Triangulations](https://doc.cgal.org/6.0/Manual/packages.html#PkgTriangulations) +- **Breaking change**: `CGAL::TDS_full_cell_mirror_storage_policy` is now unsupported in dimension larger than 127. + [Release 5.6](https://github.com/CGAL/cgal/releases/tag/v5.6) -----------