On Wednesday, August 29, 2012 4:53:33 PM UTC-7, Anne Schilling wrote:
>
> In principle, reading the documentation of Partitions the command
>
> sage: RestrictedPartitions(5,[3,2,1], 3).list()
> [[3, 1, 1], [2, 2, 1]]
>
> should be achieved by
>
> sage: Partitions(5, parts_in = [3,2,1], max_length=3)
> Partitions of the integer 5 with parts in [1, 2, 3]
>
> but unfortunately max_length is not taken into account:
>
> sage: Partitions(5, parts_in = [3,2,1], max_length=3).list()
> [[3, 2], [3, 1, 1], [2, 2, 1], [2, 1, 1, 1], [1, 1, 1, 1, 1]]
>
> Is this a bug?
>
The documentation for Partitions says
Right now, the "parts_in", "starting", and "ending" keyword
arguments are mutually exclusive, both of each other and of other
keyword arguments. If you specify, say, "parts_in", all other
keyword arguments will be ignored; "starting" and "ending" work the
same way.
So it's not a bug: it's documented. (Not ideal behavior, I think, but at
least it's documented.)
--
John
--
You received this message because you are subscribed to the Google Groups
"sage-combinat-devel" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sage-combinat-devel/-/HvSrQi6Wn4kJ.
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/sage-combinat-devel?hl=en.