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

Home » Public Forums » archive » write more efficient for loop
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: write more efficient for loop [message #91637 is a reply to message #91634] Fri, 07 August 2015 12:39 Go to previous messageGo to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
I tried to understand what you suggested but it doesn't make a lot of sense to me.

I found in the link below that by exchanging the two FOR loops the computation time can be reduced
http://www.exelisvis.com/Support/HelpArticlesDetail/TabId/21 9/ArtMID/900/ArticleID/1799/1799.aspx

I tried it but doesn't reduce at all. Maybe I did a mistake or I didn't understand well?


N = 215L

Image_2 = make_array(N,N,/double)

for j=0L, N-1 do begin
for i=0L, N-1 do begin
x = round(i + A[i, j])
y = round(j + B[i, j])
if (x ge 0) && (y ge 0) then begin
Image_2[i,j] = Image_1[x, y]
endif
endfor
endfor
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: an urgent help of file conversio
Next Topic: rot and poly_2d question

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

Current Time: Fri Oct 10 00:04:54 PDT 2025

Total time taken to generate the page: 1.12168 seconds