Skip to content
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

changed default sorting method from 'stable' to None, i.e. 'quicksort' (which actually is introsort) #59

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

jorenham
Copy link
Owner

As stated in https://numpy.org/doc/stable/reference/generated/numpy.sort.html, NumPy replaces quicksort with introsort in 1.17, which is O(n log(n)), just like stablesort. This is the default algorithm, i.e. used when np.sort(..., kind=None).
Since Lmo generally deals with i.i.d. samples, stablesort also has no practical advantage over introsort, hence making it a better default for Lmo.

@jorenham jorenham changed the title Prefer numpy's default sorting algo by default changed default sorting method from 'stable' to None, i.e. 'quicksort' (which actually is introsort) Oct 30, 2023
@jorenham jorenham merged commit 9f5fbf4 into master Oct 30, 2023
4 checks passed
@jorenham jorenham deleted the quicksort-default branch October 30, 2023 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant