comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Optimization Question: Sum at each element of array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Optimization Question: Sum at each element of array [message #75105] Mon, 14 February 2011 21:58
Charles Steinhardt is currently offline  Charles Steinhardt
Messages: 1
Registered: February 2011
Junior Member
Hello,

I'm trying to optimize the following:

for i=0, 100 do begin
y = y + myfunc(x, x + sigma * (i-50)/10.0, P[2]*myfunc2(x + sigma
* (i-50)/10.0), sigma)
endfor

Here, x, y, and sigma are arrays of the same cardinality. I know the
for loop is slow in IDL compared to array operations, but I'm having
problems finding a faster way to do this. Is it really faster to make
an array of findgen(101) and then do some sort of summation over
that?

I'm hoping somebody has run into this before - I'd appreciate any
advice you have!

Thank you,

-Charles
[Message index]
 
Read Message
Previous Topic: Error bars not located over correct bar in barplot
Next Topic: Nonlinear Diffusion Image Filtering Package

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:15:59 PDT 2025

Total time taken to generate the page: 0.00242 seconds