diff --git a/Generalized_map/include/CGAL/Generalized_map.h b/Generalized_map/include/CGAL/Generalized_map.h index 541c0619d5a..d8b4bf9b514 100644 --- a/Generalized_map/include/CGAL/Generalized_map.h +++ b/Generalized_map/include/CGAL/Generalized_map.h @@ -103,7 +103,8 @@ namespace CGAL { typedef typename Base::Use_index Use_index; typedef typename Base::Dart_range Dart_range; typedef typename Base::Dart_const_range Dart_const_range; - + using Hash_function=typename Base::Hash_function; + static const size_type NB_MARKS = Base::NB_MARKS; static const size_type INVALID_MARK = NB_MARKS; @@ -199,8 +200,8 @@ namespace CGAL { typename Converters, typename DartInfoConverter, typename PointConverter> void generic_copy(GMap2& amap, - std::unordered_map* origin_to_copy, - std::unordered_map* copy_to_origin, + std::unordered_map* origin_to_copy, + std::unordered_map* copy_to_origin, const Converters& converters, const DartInfoConverter& dartinfoconverter, const PointConverter& pointconverter, @@ -231,7 +232,7 @@ namespace CGAL { // Create an mapping between darts of the two maps (originals->copies). // (here we cannot use CGAL::Unique_hash_map because it does not provide // iterators... - std::unordered_map local_dartmap; + std::unordered_map local_dartmap; if (origin_to_copy==nullptr) // Use local_dartmap if user does not provides its own unordered_map { origin_to_copy=&local_dartmap; } @@ -269,7 +270,7 @@ namespace CGAL { unsigned int min_dim=(dimension::iterator + typename std::unordered_map::iterator dartmap_iter, dartmap_iter_end=origin_to_copy->end(); for (dartmap_iter=origin_to_copy->begin(); dartmap_iter!=dartmap_iter_end; ++dartmap_iter) @@ -305,9 +306,9 @@ namespace CGAL { typename PointConverter> void copy(GMap2& amap, std::unordered_map - * origin_to_copy, + * origin_to_copy, std::unordered_map - * copy_to_origin, + * copy_to_origin, const Converters& converters, const DartInfoConverter& dartinfoconverter, const PointConverter& pointconverter, @@ -327,9 +328,9 @@ namespace CGAL { typename PointConverter> void copy_from_const(const GMap2& amap, std::unordered_map - * origin_to_copy, + * origin_to_copy, std::unordered_map - * copy_to_origin, + * copy_to_origin, const Converters& converters, const DartInfoConverter& dartinfoconverter, const PointConverter& pointconverter, @@ -348,9 +349,9 @@ namespace CGAL { template void copy(GMap2& amap, std::unordered_map - * origin_to_copy, + * origin_to_copy, std::unordered_map - * copy_to_origin, + * copy_to_origin, const Converters& converters, const DartInfoConverter& dartinfoconverter, bool copy_marks=true, @@ -368,9 +369,9 @@ namespace CGAL { template void copy_from_const(const GMap2& amap, std::unordered_map - * origin_to_copy, + * origin_to_copy, std::unordered_map - * copy_to_origin, + * copy_to_origin, const Converters& converters, const DartInfoConverter& dartinfoconverter, bool copy_marks=true, @@ -388,9 +389,9 @@ namespace CGAL { template void copy(GMap2& amap, std::unordered_map - * origin_to_copy, + * origin_to_copy, std::unordered_map - * copy_to_origin, + * copy_to_origin, const Converters& converters, bool copy_marks=true, bool copy_perforated_darts=false, @@ -405,9 +406,9 @@ namespace CGAL { template void copy_from_const(const GMap2& amap, std::unordered_map - * origin_to_copy, + * origin_to_copy, std::unordered_map - * copy_to_origin, + * copy_to_origin, const Converters& converters, bool copy_marks=true, bool copy_perforated_darts=false, @@ -422,9 +423,9 @@ namespace CGAL { template void copy(GMap2& amap, std::unordered_map - * origin_to_copy=nullptr, + * origin_to_copy=nullptr, std::unordered_map - * copy_to_origin=nullptr, + * copy_to_origin=nullptr, bool copy_marks=true, bool copy_perforated_darts=false, size_type mark_perforated=INVALID_MARK) @@ -438,9 +439,9 @@ namespace CGAL { template void copy_from_const(const GMap2& amap, std::unordered_map - * origin_to_copy=nullptr, + * origin_to_copy=nullptr, std::unordered_map - * copy_to_origin=nullptr, + * copy_to_origin=nullptr, bool copy_marks=true, bool copy_perforated_darts=false, size_type mark_perforated=INVALID_MARK) @@ -2488,8 +2489,7 @@ namespace CGAL { { CGAL_assertion( is_without_boundary(dimension) ); - CGAL::Unique_hash_map< Dart_handle, Dart_handle, - typename Self::Hash_function > dual; + CGAL::Unique_hash_map< Dart_handle, Dart_handle,Hash_function > dual; Dart_handle d, d2, res = amap.null_handle; // We clear amap. TODO return a new amap ? @@ -2582,7 +2582,7 @@ namespace CGAL { unsigned int i = 0; CGAL::Unique_hash_map bijection; + Hash_function> bijection; while (match && !toTreat1.empty()) { diff --git a/Generalized_map/test/Generalized_map/Generalized_map_3_test.h b/Generalized_map/test/Generalized_map/Generalized_map_3_test.h index ea8aa8128c7..ee4206dad86 100644 --- a/Generalized_map/test/Generalized_map/Generalized_map_3_test.h +++ b/Generalized_map/test/Generalized_map/Generalized_map_3_test.h @@ -107,7 +107,7 @@ bool test_GMAP_3() trace_test_begin(); InitDartInfo::run(gmap); - /* TODO GMAP gmap2(gmap); + GMAP gmap2(gmap); if ( !check_number_of_cells_3(gmap2, 12, 20, 9, 2, 1) ) return false; if ( !gmap.is_isomorphic_to(gmap2) ) @@ -115,7 +115,7 @@ bool test_GMAP_3() std::cout<<"Error: gmap and gmap2 are not isomorphic (after copy).\n"; assert(false); return false; - } */ + } trace_test_begin(); gmap.template close<2>(); @@ -143,12 +143,12 @@ bool test_GMAP_3() gmap.template remove_cell<2>(gmap.alpha(dh9, 1, 0, 1, 2)); if ( !check_number_of_cells_3(gmap, 12, 20, 9, 2, 1) ) return false; - /*TODO if ( !gmap.is_isomorphic_to(gmap2) ) + if ( !gmap.is_isomorphic_to(gmap2) ) { std::cout<<"Error: gmap and gmap2 are not isomorphic (after close and removals).\n"; assert(false); return false; - } */ + } gmap.clear(); if (!test_vertex_insertion(gmap)) diff --git a/Generalized_map/test/Generalized_map/Generalized_map_4_test.h b/Generalized_map/test/Generalized_map/Generalized_map_4_test.h index 9b2e33d5f99..1efee4f91cc 100644 --- a/Generalized_map/test/Generalized_map/Generalized_map_4_test.h +++ b/Generalized_map/test/Generalized_map/Generalized_map_4_test.h @@ -108,7 +108,7 @@ bool test_GMAP_4() trace_test_begin(); InitDartInfo::run(gmap); - /* TODO GMAP gmap2(gmap); + GMAP gmap2(gmap); if ( !check_number_of_cells_4(gmap2, 12, 20, 9, 2, 2, 1) ) return false; if ( !gmap.is_isomorphic_to(gmap2) ) @@ -116,7 +116,7 @@ bool test_GMAP_4() std::cout<<"Error: gmap and gmap2 are not isomorphic (after copy).\n"; assert(false); return false; - } */ + } trace_test_begin(); gmap.template close<2>(); @@ -156,12 +156,12 @@ bool test_GMAP_4() if ( !check_number_of_cells_4(gmap, 12, 20, 9, 2, 2, 1) ) return false; - /* if ( !gmap.is_isomorphic_to(gmap2) ) + if ( !gmap.is_isomorphic_to(gmap2) ) { std::cout<<"Error: gmap and gmap2 are not isomorphic (after close and removals).\n"; assert(false); return false; - } */ + } gmap.clear(); if (!test_vertex_insertion(gmap))