[SciPy-User] Optimizing integration routine
R. O'Gara
ronogara@yahoo....
Mon Nov 22 13:15:08 CST 2010
Hi all,
I am interested in calculating many integrals of the form f(x,y,A,B)dxdy, hence integrating over x,y given parameters A,B,....
Since I'm exploring parameter space A,B I was first doing nested for loops, i.e.
for iA in listA:
for iB in listB:
dblquad(f(x,y,iA,iB), etc...)
but the problem is that it just seems to take way too long. Is there a way this could be optimized? I figured I could vectorize f and make A, B numpy arrays but scipy dbquad would give me "the function does not return a valid float" message.
Or would rewriting this in C/Fortran be any more efficient?
Any hints/ideas are appreciated. Thank you for your time
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20101122/fb8cf5bf/attachment.html
More information about the SciPy-User
mailing list