speed-up is_edge with function_output_iterator.

This commit is contained in:
Laurent Rineau 2024-04-11 11:18:07 +02:00
parent 1ee8152353
commit 05d1cfa9b3
1 changed files with 11 additions and 11 deletions

View File

@ -32,6 +32,7 @@
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
#include <boost/container/small_vector.hpp> #include <boost/container/small_vector.hpp>
#include <boost/iterator/function_output_iterator.hpp>
#include <CGAL/utility.h> #include <CGAL/utility.h>
#include <CGAL/iterator.h> #include <CGAL/iterator.h>
#include <CGAL/STL_Extension/internal/Has_member_visited.h> #include <CGAL/STL_Extension/internal/Has_member_visited.h>
@ -2061,18 +2062,17 @@ is_edge(Vertex_handle u, Vertex_handle v,
if (u==v) if (u==v)
return false; return false;
std::vector<Cell_handle> cells; bool result = false;
cells.reserve(64);
incident_cells(u, std::back_inserter(cells));
for (typename std::vector<Cell_handle>::iterator cit = cells.begin(); incident_cells(u, boost::make_function_output_iterator([&](Cell_handle ch) {
cit != cells.end(); ++cit) if(ch->has_vertex(v, j)) {
if ((*cit)->has_vertex(v, j)) { c = ch;
c = *cit;
i = c->index(u); i = c->index(u);
return true; result = true;
} }
return false; }));
return result;
} }
template <class Vb, class Cb, class Ct> template <class Vb, class Cb, class Ct>