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

combinations: count and size_hint #729

Merged
merged 14 commits into from
Aug 18, 2023

Commits on Aug 16, 2023

  1. LazyBuffer::size_hint

    Philippe-Cholet committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    80a22ac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d9f20e9 View commit details
    Browse the repository at this point in the history
  3. Remaining combinations for an unknown n

    Because we give combinations in the lexicographic order, we can use the indices to count the remaining combinations to come.
    We are gonna heavily test it thought.
    Philippe-Cholet committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    bd0b080 View commit details
    Browse the repository at this point in the history
  4. LazyBuffer::fill

    The whole point of the lazy buffer is to not fill the pool all at once but in some cases we want to, and then it's better than do it with `while lazy_buffer.get_next() {}` that would be weird.
    Philippe-Cholet committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    76efb25 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    85c7980 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    ed998ba View commit details
    Browse the repository at this point in the history
  7. Remove LazyBuffer::fill, count instead

    `pool.it.count()` consumes `pool` before we call `remaining_for` so it can not be a method and therefore becomes a free function.
    Philippe-Cholet committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    2ab0ff1 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2023

  1. Configuration menu
    Copy the full SHA
    1f48da7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    95c3e27 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    da190e3 View commit details
    Browse the repository at this point in the history
  4. Combinations::count: unwrap instead of expect

    And add todo
    Philippe-Cholet committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    baf6708 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    d8d4d61 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    cfb2ec9 View commit details
    Browse the repository at this point in the history
  7. Test checked_binomial

    Only test for `n <= 500` but only a few values of the last row do not already have overflow on a 64 bits computer.
    NOTE: Not faster with an array updated in-place.
    Philippe-Cholet committed Aug 18, 2023
    Configuration menu
    Copy the full SHA
    65e08d4 View commit details
    Browse the repository at this point in the history