You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimize permutations by implementing it via multiset_permutations (#186)
* perf: optimize `permutations` by implementing it via `multiset_permutations`
As it currently stands, `multiset_permutations` is more efficient than
`permutations`; see #151. We can exploit it to optimize `permutations`.
* fix: use explicit NamedTuple notation tu support Julia 1.0
* fix: don't use `isnothing` to support Julia 1.0
* fix: collect the indices into a `Vector`
Without this fix there are issues with `OffsetArray`: `eachindex`
returns an `OffsetArrays.IdOffsetRange`, which causes troubles when
passed to `multiset_permutations` because
`f = [sum(c == x for c in a)::Int for x in m]`
becomes an `OffsetArray` instead of a Vector`.
0 commit comments