-
Notifications
You must be signed in to change notification settings - Fork 5
Add sorting functions that track number of swaps #15
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
Conversation
|
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, |
| 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); }); |
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.
@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.
Wentzell
left a comment
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 pushed some cosmetic changes to the implementation in 0475889 |
No description provided.