Gael Varoquaux wrote: > On Fri, Sep 21, 2007 at 02:58:43PM -0600, Charles R Harris wrote: >> I found generators a good approach to this sort of thing: > >> for (i,j,k) in triplets(n) : > > That's what we where doing so far, but in the code itself. The result was > unbearably slow. > I think for our purposes we should build a precalculated table of these > nuplets, and then do array calculations on them.
I'm not sure whether this helps, but I have found this generator-based recipe <http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/190465> very useful in the past. The comment "If you require the complete list of permutations, just use the built-in list() operator" may apply to your situation, Gary R. _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion