2010/2/27 Sebastian Walter <[email protected]>: > On Sat, Feb 27, 2010 at 11:11 PM, Friedrich Romstedt > <[email protected]> wrote: >> Ok, it took me about one hour, but here they are: Fourier-accelerated >> polynomials. > > that's the spirit! ;)
Yes! I like it! :-) >>> python >> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on >> win32 >> Type "help", "copyright", "credits" or "license" for more information. >>>>> import gdft_polynomial >>>>> p1 = gdft_polynomial.Polynomial([1]) >>>>> p2 = gdft_polynomial.Polynomial([2]) >>>>> p1 * p2 >> <gdft_polynomial.polynomial.Polynomial instance at 0x00E78A08> >>>>> print p1 * p2 >> [ 2.+0.j] >>>>> p1 = gdft_polynomial.Polynomial([1, 1]) >>>>> p2 = gdft_polynomial.Polynomial([1]) >>>>> print p1 * p2 >> [ 1. +6.12303177e-17j 1. -6.12303177e-17j] >>>>> p2 = gdft_polynomial.Polynomial([1, 2]) >>>>> print p1 * p2 >> [ 1. +8.51170986e-16j 3. +3.70074342e-17j 2. -4.44089210e-16j] >>>>> p1 = gdft_polynomial.Polynomial([1, 2, 3, 4, 3, 2, 1]) >>>>> p2 = gdft_polynomial.Polynomial([4, 3, 2, 1, 2, 3, 4]) >>>>> print (p1 * p2).coefficients.real >> [ 4. 11. 20. 30. 34. 35. 36. 35. 34. 30. 20. 11. 4.] >>>>> >> >> github.com/friedrichromstedt/gdft_polynomials >> >> It's open for bug hunting :-) >> >> Haven't checked the last result. > looks correct We should check, simply using numpy.polynomial >> I used my own gdft module. Maybe one could incorporate numpy.fft >> easily. But that's your job, Sebastian, isn't it? Feel free to push >> to the repo, and don't forget to add your name to the copyright >> notice, hope you are happy with MIT. > i'll have a look at it. I will be obliged. >> Anyway, I don't know whether numpy.fft supports transforming only one >> coordinate and using the others for "parallelisation"? I will check tomorrow. Suggestion: The other thread is the main thread, please reply there. (Gmane shows also the thread structure ...) If it's not related to this one ... _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
