Hi Vincent!
On Tue, Jan 04, 2011 at 09:21:55PM +0100, Vincent Delecroix wrote:
> I'm still in my iteration challenges... I put pointers to itertools
> wherever it is needed for speed (i.e. choose_nk, subset, subword) as
> well as additional _fast_iterator in some combinatorial classes
> (SetPartitions). But now, most of the iterators yield tuples and not
> lists. The timing is better by a factor > 590 for the below example.
Eh eh, beautiful!
> Just as a remark, the old version of SetPartitions was not able to
> give me the FIRST element of SetPartitions(19, [12,3,3,2])...
:-)
> I think I will prepare a cleaned patch for this and submit it to Sage
> trac, but you have to say to me if this is a problem that generators
> (at least _fast_iterator versions of them) prefer tuples to lists.
Anyway that's an area that needs cleanup. Let's have a brainstorm on
the topic with Florent at Sage days 28!
> PS: As the speed gain is I think enough for my purpose, I won't go
> further in iteration using the C/API and I put a #+experimental on the
> corresponding patch. If you are interesting in going further in this
> direction...
Ok! Thanks much for investigating!
Cheers,
Nicolas
--
Nicolas M. ThiƩry "Isil" <[email protected]>
http://Nicolas.Thiery.name/
--
You received this message because you are subscribed to the Google Groups
"sage-combinat-devel" 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/sage-combinat-devel?hl=en.