From 0a8ef644c2b7b5cacb32c4386358a2a993d5bbc7 Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Fri, 11 Mar 2022 22:48:44 +0000 Subject: [PATCH] Init hashtable size in SNC_FM_decorator --- Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h b/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h index fd9bbb62c24..6f60c188570 100644 --- a/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h +++ b/Nef_3/include/CGAL/Nef_3/SNC_FM_decorator.h @@ -110,14 +110,14 @@ struct Sort_sedges2 { template struct Halffacet_output { -Halffacet_output(CGAL::Unique_hash_map& F, std::vector& S) +Halffacet_output(const CGAL::Unique_hash_map& F, std::vector& S) : From(F), Support(S) { edge_number=0; Support[0]=E(); } typedef P Point; typedef V Vertex_handle; typedef unsigned Halfedge_handle; -CGAL::Unique_hash_map& From; +const CGAL::Unique_hash_map& From; std::vector& Support; unsigned edge_number; @@ -467,12 +467,11 @@ create_facet_objects(const Plane_3& plane_supporting_facet, Object_list_iterator start, Object_list_iterator end) const { CGAL_NEF_TRACEN(">>>>>create_facet_objects " << normalized(plane_supporting_facet)); - CGAL::Unique_hash_map FacetCycle(-1); + std::vector MinimalEdge; std::list SHalfedges; std::list SHalfloops; - CGAL::Unique_hash_map From; Segment_list Segments; SHalfedge_handle e; SHalfloop_handle l; @@ -503,6 +502,7 @@ create_facet_objects(const Plane_3& plane_supporting_facet, CGAL_error_msg("Damn wrong handle."); } + CGAL::Unique_hash_map FacetCycle(-1, SHalfedges.size()); /* We iterate all shalfedges and assign a number for each facet cycle. After that iteration for an edge |e| the number of its facet cycle is |FacetCycle[e]| and for a facet cycle |c| we know @@ -606,6 +606,7 @@ create_facet_objects(const Plane_3& plane_supporting_facet, // Insertion of SHalfedges into Segments is shifted below in order // to guarantee that there are no gaps in the overlay. + CGAL::Unique_hash_map From(SHalfedge_handle(), SHalfedges.size()); // SHalfedges.sort(Sort_sedges2()); SHalfedges.sort(Sort_sedges());