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

Additional utility APIs #120

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Conversation

james7132
Copy link
Collaborator

This PR adds the following APIs, and refactors a few existing ones to use them as implementation details:

  • contains_any_in_range - Checks if any bit in a range is set.
  • contains_all_in_range - Checks if all bits in a range are set.
  • minimum finds the smallest bit that has been set, if any are.
  • maximum finds the largest bit that has been set, if any are.
  • is_full checks if every bit in the bitset has been set.
  • count_zeroes is the corollary to count_ones, where it counts the bits that haven't been set in a range.
  • remove_range clears a range of set bits. set_range now just chooses between insert_range and remove_range internally. Moves the branch out of the loop.

@james7132 james7132 merged commit e820380 into petgraph:master Mar 20, 2024
14 checks passed
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.

1 participant