On Thu, Dec 13, 2012 at 03:40:47AM -0800, Andrew Mathas wrote: > Thanks for the explanation Nicolas. Rather than building a (lazy) > dictionary I would have thought that replacing rank() with > self._list.index(x) would be the ay to go?
It depends on the size of the set. _list.index(x) has complexity n in average but has a very small constant. So it's good for small sets. For larger sets, a dictionary lookup is faster. We discussed that with Vincent yesterday, and he will probably implement something with an appropriate threshold. Cheers, Nicolas -- Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net> 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 sage-combinat-devel@googlegroups.com. To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en.