JuliaMath / Combinatorics.jl

A combinatorics library for Julia
http://juliamath.github.io/Combinatorics.jl/dev/
Other
216 stars 59 forks source link

Combine combinations and with_replacement_combinations #65

Open ararslan opened 6 years ago

ararslan commented 6 years ago

It might be worthwhile to combine the combinations and with_replacement_combinations functions. I could see a potential API as

combinations(x, n)               # No replacement
combinations(x, n, replace=true) # With replacement

Having separate functions was probably worthwhile in The Olden Days, when keyword arguments were a performance killer and value-based dispatch with Val didn't exist.

Nosferican commented 6 years ago

Might be nice to have this for permutations as well.

ignaciomartin commented 5 years ago

I subscribe to this proposal, both for combinations and for permutations. It could be interesting to use the same R arguments:
https://rdrr.io/cran/arrangements/man/permutations.html

Moelf commented 4 years ago

from google search to this issue, thus bump