In data venerd? 24 luglio 2009 00:27:08, Robert Dodier ha scritto:
> It turns out this maps over rows, not elements.
> I think you want "matrixmap" instead.
>
> >
> > [0,0,4*E*I/l,0,0,0,3*sqrt(3)*E*I/l^2,-3*E*I/l^2,2*E*I/l,0,0,0,0,
>
> If E means Euler's number and I means the imaginary unit,
> then you want %e and %i instead.
No, E and I are geometric simbols, not %e or %i.
> About getting it to run faster, maybe
>
> matrixmap(lambda([e],if e=0 then 0 else limit(e,bk,inf)), K) $
>
> is enough. I find it's several times faster than limit(K, bk, inf)
> since it doesn't call limit(0, bk, inf).
Thank you for this solution, I didn't know about the difference (in terms of
speed) between map and matrixmap. On my system I get:
(%i5) matrixmap(lambda([e],if e=0 then 0 else limit(e,bk,inf)), K) $
Evaluation took 0.7400 seconds (0.8950 elapsed) using 4.416 MB.
(%i6) map(lambda([e],if e=0 then 0 else limit(e,bk,inf)), K) $
Evaluation took 4.3523 seconds (4.4551 elapsed) using 29.354 MB.
Thank you, I think I've solved my problem :-)
> Bear in mind that getting a different (faster) Lisp implementation
> and recompiling Maxima is likely to be time-consuming.
> Will you ever recover the time invested? I think you could
> easily spend a couple of days on it.
Well, I would like to try to recompile to see the difference. Yes, setting up
the system and recompiling could require the time of 10000 matrixmap over my
42x42 matrix, but maybe it is worth the effort. I prefer short times when I use
Maxima, I can compile when I'm sleeping :-).
I downloaded a Maxima package from a Slackware repository and it was compiled
with CLISP. I would like to test if another lisp implementation could be
better and faster. Maybe the package in the repository could be improved
compiling Maxima against a different lisp, and many users could benefit of that.
Sometimes, on this mailing list some people had trouble with certain lisp
implementations. Therefore, what is the best (I mean faster and safer) lisp,
excluding CLISP? Maybe CMUCL or GCL?
Thanks
Stefano