Skip to content

Re-implement next_k_array; add k_array_rank#379

Merged
mmcky merged 2 commits intomasterfrom
k_array
Jan 5, 2018
Merged

Re-implement next_k_array; add k_array_rank#379
mmcky merged 2 commits intomasterfrom
k_array

Conversation

@oyamad
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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