On 9/21/07, Gael Varoquaux <[EMAIL PROTECTED]> wrote: > > On Fri, Sep 21, 2007 at 02:33:42PM -0600, Charles R Harris wrote: > > I wrote up some of the combinatorial algorithms in python a few years > ago > > for my own use in writing a paper, ( Harris, C. R. Solution of the > > aliasing and least squares problems of spaced antenna interferometric > > measurements using lattice methods, Radio Sci. 38, 2003). I even > thought I > > had found an error and have a letter from Knuth pointing out that I > was > > mistaken ;) Anyway, there are a lot of neat things in volume 4 and it > is > > well worth the read. > > It is. I did my homework, and now I understand why you point this out. > Basically array programming is really not suited for these kind of > things. The problem with my solution is that is blows up the memory > really quickly. It is actually a pretty poor solution. It is obvious when > you think about this a bit that the problem diverges really quickly if > you try the brute force approach. It is actually really quick, until it > blows the memory.
I found generators a good approach to this sort of thing: for (i,j,k) in triplets(n) : Chuck
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion