-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Simplify using APIv1 through APIv2 interface #1051
Conversation
@dalg24 Thoughts? |
1284e65
to
7e80566
Compare
Right now, it is inconvenient to get the old behavior. One has to write ```c++ ArborX::BVH<MemorySpace, ArborX::PairValueIndex<Box>> tree(space, ArborX::Experimental::attach_indices(boxes)); tree.query(space, queries, ArborX::LegacyDefaultCallback{}, indices, offsets); ``` The presence of the `LegacyDefaultCallback` is really annoying. This patch changes this. It automatically adds LegacyDefaultCallback if the following 3 conditions are satisfied: 1. A user does not provide a callback 2. The index is constructed on PairValueIndex 2. The output value_type matches the index_type in the PairValueIndex.
7e80566
to
3030aa8
Compare
3030aa8
to
1cf1a0d
Compare
1cf1a0d
to
b257854
Compare
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.
Did you try to deduce the integral type to use instead of only enabling for unsigned
I didn't enable it only for As the user is the one in control for both types, we cannot do anything on our side imho. |
Exactly I was thinking about doing the conversion. Why do you think we shouldn't? |
I am concerned about losing precision. What if the hierarchy is created on Converting |
We say that all attached indexes being representable as the integral value type of the view is a precondition |
You mean in the documentation? This feels like prone to subtle errors. Could theoretically use something like |
After a discussion, we agreed to relax the requirements on type matching, and simply require that the value type in the output view is integral. Rationale: we already do if for the |
2df3a20
to
92d5e96
Compare
7432c99
to
9a32bf4
Compare
Right now, it is inconvenient to get the old behavior. One has to write
ArborX::BVH<MemorySpace, ArborX::PairValueIndex<Box>> tree(space, ArborX::Experimental::attach_indices(boxes)); tree.query(space, queries, ArborX::LegacyDefaultCallback{}, indices, offsets);
The presence of the
LegacyDefaultCallback
is really annoying.This patch changes this. It automatically adds LegacyDefaultCallback
if the following 3 conditions are satisfied: