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

Re-implement next_k_array; add k_array_rank #379

Merged
merged 2 commits into from
Jan 5, 2018
Merged

Re-implement next_k_array; add k_array_rank #379

merged 2 commits into from
Jan 5, 2018

Conversation

oyamad
Copy link
Member

@oyamad oyamad commented Jan 4, 2018

  1. Re-implement next_k_array which is now based on "Algotirhm T" in Generating All Combinations by Knuth.

  2. Add k_array_rank and k_array_rank_jit:

    • k_array_rank works with pure Python's arbitrary precision integer.
    • k_array_rank_jit is Numba jit compiled and limited by the range of np.intp.
  3. _next_k_array in support_enumeration is replaced by the new next_k_array:

    • The previous _next_k_array is implemented by "Gosper's hack" (see game_theory: Add support_enumeration #263 (comment)) which has a limit in the size of the input array by the number of bits of np.int.
    • The new next_k_array has no such limitation.
    • The performance does not change almost at all.

oyamad added 2 commits January 5, 2018 10:15
instead of _next_k_combination and _next_k_array
@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 94.878% when pulling a215f1f on k_array into 475650b on master.

@oyamad oyamad added the ready label Jan 5, 2018
@mmcky
Copy link
Contributor

mmcky commented Jan 5, 2018

thanks @oyamad I like the approach to using util/combinatorics. I will merge later this afternoon.

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

Successfully merging this pull request may close these issues.

3 participants