>
> Depending on what you're doing with the permutations, all your time  
> may be spent elsewhere, and compiling your snippet may not help.  
> Specifically, if you don't "cdef" anything I'd be surprised to see a  
> big speedup, but if you cimport permutation group elements directly  
> you could probably be 100x faster.

Could you be more specific (e.g. give a toy example of how to
"cimport" Permutations(n) and then use it to do something trivial, for
someone who is still very new at using Cython)?  I assume this is the
sort of thing that could be %cython'ed in the notebook.

As to the iterators, I essentially used exactly the same ideas for my
summer research student in enumerating some combinatorial data, and it
was *painfully* slow - but I assumed it just had to be that slow.  I
will try rewriting it with this iterator construction.

So my question: Unlike the OP, I constructed a Python generator object
for my stuff, rather than a list comprehension, thinking it wouldn't
have to iterate all the way to the last point each time, and so my
poor little computer would be spared having to create the whole list I
needed ahead of time.  Was I incorrect about that - do generators not
"cache the last value", as William says?  I guess I would rather not
use generators (yield) if they don't actually save any computation
time or memory, since lists are so much easier to write.

Thanks for any ideas!
- kcrisman
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to