-
Couldn't load subscription status.
- Fork 116
[oneDPL][ranges] Add nth_element parallel range algorithm #633
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
base: main
Are you sure you want to change the base?
[oneDPL][ranges] Add nth_element parallel range algorithm #633
Conversation
e21c85f to
f63665d
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.
Looks correct.
| merge (ExecutionPolicy&& pol, R1&& r1, R2&& r2, OutR&& result, Comp comp = {}, | ||
| Proj1 proj1 = {}, Proj2 proj2 = {}); | ||
| // nth_element |
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.
In #644 we are adding a new section for partitioning algorithms.
nth_element is effectively a partitioning algorithm - it rearranges the elements of a range such that every element "to the right" is "not greater" (with respect to the comparator) than any element "to the left" (though, elements equal to the Nth one can be found at any side of it), On the other hand, the requirements for nth_element are much closer to sort than to partition.
Should we keep this algorithms in the group with sort or move it to the partition group?
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.
I think it fits better in partitioning than sort.
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.
Let's merge #644 first, and then add nth_element into the partition operations group.
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.
Done
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.
Formulation looks good. Moving to partitioning section makes sense though.
| merge (ExecutionPolicy&& pol, R1&& r1, R2&& r2, OutR&& result, Comp comp = {}, | ||
| Proj1 proj1 = {}, Proj2 proj2 = {}); | ||
| // nth_element |
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.
I think it fits better in partitioning than sort.
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.
LGTM
Adding
nth_elementinto oneDPL specification.