Add sorting functions that track number of swaps#15
Merged
Wentzell merged 8 commits intoTRIQS:unstablefrom Dec 3, 2025
Merged
Conversation
Contributor
|
Hey @hmenke, I've created a PR hmenke#1 to your sorting branch with some changes. The commits should be more or less independent of each other. I've changed quite a few but mostly trivial things (the sorting functions should remain more or less untouched). Feel free to merge whatever commits you agree with. Best, |
hmenke
commented
Dec 2, 2025
Comment on lines
+376
to
+378
| static std::default_random_engine eng{std::random_device{}()}; | ||
| auto cont = C(std::uniform_int_distribution<std::size_t>(0, n)(eng)); | ||
| std::ranges::generate(cont, [&]() { return std::uniform_int_distribution<typename C::value_type>(a, b)(eng); }); |
Member
Author
There was a problem hiding this comment.
@Thoemi09 I want to do completely non-deterministic randomized testing here, in particular on the length of the container. The first bug that I found when I wrote the test was that my functions didn't correctly sort the empty range. Even better would be fuzzing but I don't think TRIQS has any setup for that.
Thoemi09
approved these changes
Dec 2, 2025
Member
|
I pushed some cosmetic changes to the implementation in 0475889 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.