Skip to content

Extrema algorithms with repeated values #6627

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

Open
K-ballo opened this issue Mar 1, 2025 · 2 comments · May be fixed by #6684
Open

Extrema algorithms with repeated values #6627

K-ballo opened this issue Mar 1, 2025 · 2 comments · May be fixed by #6684

Comments

@K-ballo
Copy link
Member

K-ballo commented Mar 1, 2025

Extrema algorithms (min_element/max_element/minmax_element) have specific semantics in case of repeated values. The existing unit tests don't cover these, as they only use random_iota as the input range. In particular:

  • min_element is required to return the first min value,
  • max_element is required to return the first max value,
  • minmax_element is required to return the first min value and the last max value.

Tests for these cases should be added, and the implementations adjusted as needed.

@ajaygaur01
Copy link

added a PR for min_element kindly check

@harith-hacky03
Copy link
Contributor

@hkaiser @K-ballo Created PR for semantics check of these functions , Can you please verify it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants