mirror of https://github.com/CGAL/cgal
speed up incident_cells_threadsafe
This commit is contained in:
parent
05d1cfa9b3
commit
9194bb0bca
|
|
@ -31,6 +31,7 @@
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
|
#include <boost/container/flat_set.hpp>
|
||||||
#include <boost/container/small_vector.hpp>
|
#include <boost/container/small_vector.hpp>
|
||||||
#include <boost/iterator/function_output_iterator.hpp>
|
#include <boost/iterator/function_output_iterator.hpp>
|
||||||
#include <CGAL/utility.h>
|
#include <CGAL/utility.h>
|
||||||
|
|
@ -830,13 +831,16 @@ private:
|
||||||
return it;
|
return it;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class IncidentFacetIterator>
|
template <class IncidentFacetIterator, typename CellsContainers>
|
||||||
void
|
void
|
||||||
incident_cells_3_threadsafe(Vertex_handle v, Cell_handle d,
|
incident_cells_3_threadsafe(Vertex_handle v, Cell_handle d,
|
||||||
std::vector<Cell_handle> &cells,
|
CellsContainers &cells,
|
||||||
IncidentFacetIterator facet_it) const
|
IncidentFacetIterator facet_it) const
|
||||||
{
|
{
|
||||||
boost::unordered_set<Cell_handle, Handle_hash_function> found_cells;
|
boost::container::flat_set<Cell_handle,
|
||||||
|
std::less<>,
|
||||||
|
boost::container::small_vector<Cell_handle, 128>> found_cells;
|
||||||
|
// boost::unordered_set<Cell_handle, Handle_hash_function> found_cells;
|
||||||
|
|
||||||
cells.push_back(d);
|
cells.push_back(d);
|
||||||
found_cells.insert(d);
|
found_cells.insert(d);
|
||||||
|
|
@ -1411,20 +1415,16 @@ public:
|
||||||
|
|
||||||
Visitor visit(v, output, this, f);
|
Visitor visit(v, output, this, f);
|
||||||
|
|
||||||
std::vector<Cell_handle> tmp_cells;
|
boost::container::small_vector<Cell_handle, 128> tmp_cells;
|
||||||
tmp_cells.reserve(64);
|
|
||||||
if ( dimension() == 3 )
|
if ( dimension() == 3 )
|
||||||
incident_cells_3_threadsafe(
|
incident_cells_3_threadsafe(
|
||||||
v, v->cell(), tmp_cells, visit.facet_it());
|
v, v->cell(), tmp_cells, visit.facet_it());
|
||||||
else
|
else
|
||||||
incident_cells_2(v, v->cell(), std::back_inserter(tmp_cells));
|
incident_cells_2(v, v->cell(), std::back_inserter(tmp_cells));
|
||||||
|
|
||||||
typename std::vector<Cell_handle>::iterator cit;
|
for(auto c : tmp_cells)
|
||||||
for(cit = tmp_cells.begin();
|
|
||||||
cit != tmp_cells.end();
|
|
||||||
++cit)
|
|
||||||
{
|
{
|
||||||
visit(*cit);
|
visit(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
return visit.result();
|
return visit.result();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue