-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor space filling curves surrounding code #1180
Conversation
template <typename ExecutionSpace, typename Values, typename SpaceFillingCurve, | ||
typename Box> | ||
inline auto computeSpaceFillingCurvePermutation(ExecutionSpace const &space, | ||
Values const &values, | ||
SpaceFillingCurve const &curve, | ||
Box const &scene_bounding_box) | ||
{ | ||
auto linear_ordering_indices = | ||
projectOntoSpaceFillingCurve(space, values, curve, scene_bounding_box); | ||
return sortObjects(space, linear_ordering_indices); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Saves little code to bundle two distinct operations.
I am not convinced it is a good idea to introduce it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does a bit more than that in that it also reduces the amount of used memory as linear_ordering_indices
are deallocated automatically once this function returns. This behavior is similar to the original sortPredicatesAlongSpaceFillingCurve
.
If a passed function argument is a prvalue, it will be destroyed once we return, as returning a reference to its member does not extend its lifetime.
aaff2d0
to
6160156
Compare
6160156
to
8a7d92b
Compare
getGeometry
for prvaluesIf a passed function argument is a prvalue, it will be destroyed once we return, as returning a reference to its member does not extend its lifetime.
projectOntoSpaceFillingCurve
fromArborX_TreeConstruction.hpp
toArborX_SpaceFillingCurve.hpp
It will also be used by the tree traversal now
computeSpaceFillingCurvePermutation
that combinesprojectOntoSpaceFillingCurve
with sorting to further reduce the amount of codePredicateIndexables
to easily iterate over predicate geometries