Robert,
On Sun, Jan 21, 2007 at 12:40:23PM -0700, Robert Dodier wrote:
> >I'm doing some calculations with spherical functions Ylm, and
> >the problem is that my code is running painfully slow.
>
> Hmm, sounds like an interesting problem.
> About profiling, take a look at the functions timer and timer_info --
> timer records function call execution time and timer_info shows
> the results.
>
> ? timer
> at the input prompt should find info about these functions.
Thanks for the info, timer works.
The only inconsistency I've encountered is that it is impossible to
profile "partly array function", e.g.
Ylm[l,m](theta,phi) := block([],
SOME CALC
)$
so I need to do a trick:
__Ylm(l,m,theta,phi) := block([], SOME CALC);
Ylm[l,m](theta,phi) := __Ylm(l,m,theta,phi);
But this is a minor problem.
> Hope this helps,
Yes, thanks.
I've rewritten some bits, so it now runs faster, but a lot of time is
still spent in function which integrates over sphere:
assume(r > 0);
sph_integrate(f, theta,phi) := block([Iphi,Itheta,foo],
f2 : demoivre(f), /* XXX try to help integrate (see SF #1636106)...
(it was asking me whether sin(th) is pos, neg or zero... */
Iphi : integrate(f2, phi, 0,2*%pi),
Itheta : integrate(Iphi * sin(theta), theta, 0,%pi),
ev(Itheta) /* this is to force evaluation of cos(0), cos(%pi), etc... */
);
What one can do with further optimizing it?
f is a mix of trigionometry - maybe I should prepare it for
integrate to help, with say trigrat?
--
????? ????????, ??????.
http://landau.phys.spbu.ru/~kirr/aiv/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.math.utexas.edu/pipermail/maxima/attachments/20070123/69eefe3e/attachment.pgp