-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rch - add combinations(), integer_partitions(), and partitions()
These are as described in TAoCP 7.2.1.3, 7.2.1.4, and 7.2.1.5. All three use coroutines. Each produce() call, combinations() and integer_partitions() return Array, partitions() returns a set of sets. partitions() could have been written to return a generator which would return each set from an individual partitioning in turn, I wasn't sure what the preferred behavior would be so I went simple if clunky.
- Loading branch information
1 parent
f002a96
commit 5e44b1a
Showing
1 changed file
with
150 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters