Skip to content

Conversation

@hmenke
Copy link
Member

@hmenke hmenke commented Nov 27, 2025

No description provided.

@hmenke hmenke requested review from Thoemi09 and Wentzell November 27, 2025 18:47
@hmenke hmenke added the enhancement New feature or request label Nov 27, 2025
@Thoemi09
Copy link
Contributor

Thoemi09 commented Dec 1, 2025

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,
Thomas

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); });
Copy link
Member Author

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.

Copy link
Member

@Wentzell Wentzell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @hmenke for adding this important new feature and @Thoemi09 your improvements.

@Wentzell Wentzell merged commit 8fe8c00 into TRIQS:unstable Dec 3, 2025
4 checks passed
@Wentzell
Copy link
Member

Wentzell commented Dec 3, 2025

I pushed some cosmetic changes to the implementation in 0475889

@hmenke hmenke deleted the sorting branch December 4, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants