mirror of https://github.com/CGAL/cgal
fix map type
This commit is contained in:
parent
49d6821d9b
commit
4dc2ad3f36
|
|
@ -1480,12 +1480,13 @@ void autorefine_triangle_soup(PointRange& soup_points,
|
||||||
// TODO: reuse the fact that maps per triangle are already sorted
|
// TODO: reuse the fact that maps per triangle are already sorted
|
||||||
|
|
||||||
#ifdef CGAL_LINKED_WITH_TBB
|
#ifdef CGAL_LINKED_WITH_TBB
|
||||||
std::conditional_t<parallel_execution,
|
typedef std::conditional_t<parallel_execution,
|
||||||
tbb::concurrent_map<EK::Point_3, std::size_t>,
|
tbb::concurrent_map<EK::Point_3, std::size_t>,
|
||||||
std::map<EK::Point_3, std::size_t>> point_id_map;
|
std::map<EK::Point_3, std::size_t>> Point_id_map;
|
||||||
#else
|
#else
|
||||||
std::map<EK::Point_3, std::size_t> point_id_map;
|
typedef std::map<EK::Point_3, std::size_t> Point_id_map;
|
||||||
#endif
|
#endif
|
||||||
|
Point_id_map point_id_map;
|
||||||
|
|
||||||
#if ! defined(CGAL_NDEBUG) || defined(CGAL_DEBUG_PMP_AUTOREFINE)
|
#if ! defined(CGAL_NDEBUG) || defined(CGAL_DEBUG_PMP_AUTOREFINE)
|
||||||
std::vector<EK::Point_3> exact_soup_points;
|
std::vector<EK::Point_3> exact_soup_points;
|
||||||
|
|
@ -1605,7 +1606,7 @@ void autorefine_triangle_soup(PointRange& soup_points,
|
||||||
#else
|
#else
|
||||||
//option 2 (without mutex)
|
//option 2 (without mutex)
|
||||||
/// Lambda concurrent_get_point_id()
|
/// Lambda concurrent_get_point_id()
|
||||||
tbb::concurrent_vector<tbb::concurrent_map<EK::Point_3, std::size_t>::iterator> iterators;
|
tbb::concurrent_vector<typename Point_id_map::iterator> iterators;
|
||||||
auto concurrent_get_point_id = [&](const typename EK::Point_3 pt)
|
auto concurrent_get_point_id = [&](const typename EK::Point_3 pt)
|
||||||
{
|
{
|
||||||
auto insert_res = point_id_map.insert(std::make_pair(pt, -1));
|
auto insert_res = point_id_map.insert(std::make_pair(pt, -1));
|
||||||
|
|
@ -1616,7 +1617,7 @@ void autorefine_triangle_soup(PointRange& soup_points,
|
||||||
|
|
||||||
//use map iterator triple for triangles to create them concurrently and safely
|
//use map iterator triple for triangles to create them concurrently and safely
|
||||||
soup_triangles_out.resize(offset + new_triangles.size());
|
soup_triangles_out.resize(offset + new_triangles.size());
|
||||||
std::vector<std::array<tbb::concurrent_map<EK::Point_3, std::size_t>::iterator, 3>> triangle_buffer(new_triangles.size());
|
std::vector<std::array<typename Point_id_map::iterator, 3>> triangle_buffer(new_triangles.size());
|
||||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, new_triangles.size()),
|
tbb::parallel_for(tbb::blocked_range<size_t>(0, new_triangles.size()),
|
||||||
[&](const tbb::blocked_range<size_t>& r) {
|
[&](const tbb::blocked_range<size_t>& r) {
|
||||||
for (size_t ti = r.begin(); ti != r.end(); ++ti) {
|
for (size_t ti = r.begin(); ti != r.end(); ++ti) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue