Added a combination generator for Enum #518

Open
wants to merge 2 commits into
from

Conversation

Projects
None yet
3 participants

Chimrod commented Jan 21, 2014

Implement an enumeration over combination #503

This an implementation of mathematical Combination ( https://en.wikipedia.org/wiki/Combination ), wich work with or without repetitions.

src/batEnum.mli
+(** [combination n k] returns an enumeration over combination of [k] elements
+ between [n] distincts elements.
+
+ If [repeat] is true, the combination may contains the same elements many
@hcarty

hcarty Jan 21, 2014

Contributor

This should be 'contain' rather than 'contains'

@Chimrod

Chimrod Jan 21, 2014

Sorry, english is not my mothertongue…

I push a correction ASAP

Member

c-cube commented Apr 11, 2014

Is it me, or could this be implemented as a BitSet.t generator that could then be used to select elements in an array? That would be more general this way...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment