Standard Iterator Categories for RangeSetBase
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- backend-api-design
Research direction
Start by inspecting RangeSetBase and the iterator entry points used by mesh.faces(), then review issue #66 for the const-correctness context. Compare the available iterator guarantees with std::transform and the intended parallel STL usage; completion should establish and validate the supported iterator behavior and typedefs.
Written by the indexing model from the issue text.
Description
Hi Folks,
Would it make sense to add stl iterator_categories (and all the other sundry stl iterator typedefs) for the RangeSetBase class? There are times when I would like to use stl algorithms on some entitie of the mesh, like:
std::transform(begin(mesh.faces()), end(mesh.faces()),...)
But, it seems we need category support for that. My guess is that std::forward_iterator_tag would be the most likely candidate, but maybe std::bidirectional_iterator_tag would work too?
Ultimately, I would like to be able to use the parallel version of the stl algorithms, which I currently do in some code. But, I end up first copying the entity handles to a std::vector with a range based for loop, and then use that sequence as my iteration range for the algorithm. From a performance standpoint, the penalty of copying is probably in the noise for cases where parallelizing things is a benefit, but it still seems wasteful. I only bring that up because I don't quite know all the details for how the parallel versions of the std algorithms partition things, etc... Therefore, I don't know how smart/safe/etc... a given iterator/container pair need to actually be to work correctly in the parallel versions of the algorithms. A vector of handles seems to work fine, but obviously that is the least restrictive container/iterator type.
As a last thought, this may also play into enhancing general const-correctness for the overall api as well. However, I seem to gather from #66 it is not as trival as sprinkling const everywhere.
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 183
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nmwsharp/geometry-central
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
nmwsharp/geometry-central#256 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
nmwsharp/geometry-central#255 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
nmwsharp/geometry-central#253 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 57/100
nmwsharp/geometry-central#247 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
nmwsharp/geometry-central#246 ·
All issues in nmwsharp/geometry-central
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
automated-analysis bug memory-safety
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·