On Sat, Feb 12, 2011 at 02:32:09AM +0800, D. S. McNeil wrote:
> My single most common use involves parts_in, though, and that's what doesn't
> work: Partitions(10, min_length=2, max_length=6, parts_in=[1,2,3,5])
> is a completely
> consistent set of constraints, but it silently drops two of them, as
> the docs warn.  (I'm telling
> you what you already know, of course, but this was the first case
> which started to cause
> me problems.)  There are lots of OEIS sequences which involve
> partitions restricted to
> some set, so I have to write Partitions(10,
> parts_in=[1,2,3,5]).filter(lambda x: 2<= len(x) <= 6)
> or some such variant, which it'd be really nice to avoid..  I even
> have lots of use cases where
> it'd be nice to be able to use min_part and parts_in simultaneously,
> cases where it's more natural
> to build the parts_in list once.

Ah, ok; that's a different story. Structurally, parts_in can't be
treated by the generic IntegerListsLex tool, so the rewrite of the
latter is not going to improve the situation. One instead needs to
treat it specifically, or probably best using species as they could
handle efficiently parts_in together with min_length and
max_length. Patch welcome!

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to