replace ccr_::enumerate with flexible for_each

enumerate is unusual and would only work effectively with random access iterators

this for_each takes advantage of tbb blocked_range
replace ccr_::enumerate with flexible for_each

enumerate is unusual and would only work effectively with random access iterators

this for_each takes advantage of tbb blocked_range
This commit is contained in:
tamasmeszaros 2020-08-05 15:49:36 +02:00
parent 9486901b93
commit 929cea59f3
7 changed files with 169 additions and 125 deletions

View file

@ -320,10 +320,10 @@ PointSet normals(const PointSet& points,
PointSet ret(range.size(), 3);
// for (size_t ridx = 0; ridx < range.size(); ++ridx)
ccr::enumerate(
range.begin(), range.end(),
[&ret, &mesh, &points, thr, eps](unsigned el, size_t ridx) {
ccr::for_each(size_t(0), range.size(),
[&ret, &mesh, &points, thr, eps, &range](size_t ridx) {
thr();
unsigned el = range[ridx];
auto eidx = Eigen::Index(el);
int faceid = 0;
Vec3d p;