Updates:
Labels: NeedsReview smichr
Comment #9 on issue 3501 by [email protected]: Missing partitions in
sympy.utilities.iterables.multiset_partitions
http://code.google.com/p/sympy/issues/detail?id=3501
I added a different routine. Perhaps the Knuth routine will find its way
back, but for now there is a little gem of a routine that seems to work
well:
l = len(list(multiset_partitions(n, 4)))
n l time(s)
5 10 0.0
6 65 0.0
7 350 0.01
8 1701 0.03
9 7770 0.11
10 34105 0.62
11 145750 3.82
12 611501 18.28
I also made it generate only unique partitions if a true multiset (not set)
is given, e.g.
```
list(multiset_partitions([1,1,1,2], 2))
[[[1, 1, 1], [2]], [[1, 1, 2], [1]], [[1, 1], [1, 2]]]
```
https://github.com/sympy/sympy/pull/1658
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.