On Sep 2, 2009, at 6:17 PM, Raymond Toy wrote:
> ?iga Lenar?i? wrote:
>>
>> Attached are fft.lisp and fft.lisp.patch.
> Finally got around to look at this. For the most part, I think it's
> ok. A couple of comments.
>
> (defun fft-arrays->mlist (realparts imagparts)
> "Takes two Lisp arrays with real and imaginary
> parts and returns a Maxima list of complex numbers
> in Maxima's 'format'."
> (let (ans)
> (dotimes (i (length realparts))
> (push `((mplus) ,(aref realparts i) ((mtimes) $%i ,(aref
> imagparts
> i)))
> ans))
> (cons '(mlist) (nreverse ans))))
>
> I think the push expression is probably better written using mul
> and add
> instead of using maxima's internal representation. Probably doesn't
> matter in this case since realparts and imagparts are float
> numbers, so
> no simplification would be done.
>
> We should be use your suggestion about using flonum everywhere. You
> didn't do that in your version.
>
> I haven't tested this yet, but it looks ok.
>
> Ray
>
It works nicely with 'flonum', yes. I changed it to use add and mul,
added your changes from CVS, used flonum instead of double-float...
See the attached file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fft.lisp
Type: application/octet-stream
Size: 10593 bytes
Desc: not available
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20090902/71af8c43/attachment.obj
-------------- next part --------------
Regards,
Ziga