-
Notifications
You must be signed in to change notification settings - Fork 1
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
partial sort functionality? #1
Comments
I would also be interested in a (very fast) partialsortperm |
Sorry for the late answer. Due to a new job and a new baby I have other priorities right now. The basic inner function _sortperm!!(ix, v, vs, lo, hi, o::Ordering, offsets_l, offsets_r) already accepts lo and hi indices for partial sorting:
I think the easiest option would be trying to call that from your function at first. This way, you could get the core functionality working and skip dealing with all the code that deals with optimizations for special types. |
fantastic, thanks for the pointer. congratulations on the baby and job! |
Thanks, and congrats!! Is there an easy fix for my below M(not)WE for attempting to sort the first 10 elements of a vector containing 100 elements? Not sure how to use
|
Hi @adienes, have you managed to use the
but rerunning with
|
yes, I ran into the same conclusion; that it sorts slices of the input rather than a partialsort. I was not able to put in much time to try to find alternative approaches |
@LSchwerdt: Would you have a MWE on hand (or easily accessible) for demonstrating how to ensure at least |
I think this project is really cool! I have an application where I need to perform partial sorting (per here and here) and was trying to adapt your code to handle this case. Would you have any suggestions on where to start? I naively tried to modify
ssortperm!!
to acceptlo
andhi
based on the desired partial sort indices, e.g.,but I failed to get a correct implementation.
Do you think there's an easy fix? Or do you think it involve digging into the internals of
_sortperm_inplace_small_optimization!
?Thanks!
Jake
The text was updated successfully, but these errors were encountered: