On Tue, Sep 1, 2009 at 5:59 PM, ?iga Lenar?i? <ziga.lenarcic at gmail.com>wrote:
> ...On a side note, I've used maxima's $timer function and found out (by
> following internal ?forward\-fft and maxima's 'float' functions) that
> time taken by conversion of data is 10x bigger than that of internal
> numerical fft routine which works on double-float arrays. Each maxima
> number (represented by mplus expression if complex) is split into two
> double-float numbers with (risplit ($float maxima-number)) - and this
> is where most of the time is spent.
>
risplit is the general routine for arbitrary symbolic expressions.
There is a much faster routine for deconstructing a complex number:
complex-number-p in ellipt.lisp. The current version of that function
doesn't extract the real and imaginary parts, but it could easily be
modified to do so.
The function complexify in the same file converts a Lisp number (real or
complex) to a Maxima number. I think it would be perfectly legitimate to
explicitly construct the simplified Maxima expression here, though it does
mean that some simplifications would be duplicated (implicitly) here and in
the general simplifier; in particular, pattern-matching simplification would
be cut out of the logic.
There is probably a more logical place to put complex-number-p and
complexify than in ellipt.lisp....
-s