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

Home » Public Forums » archive » Philosophy of for loops
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: Philosophy of for loops [message #21613 is a reply to message #21529] Thu, 31 August 2000 08:51 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
edward.s.meinel@aero.org writes:
>
> So does that mean that form (3) is slower than form (1)?
>
> (3) for j=0,2047 do $
> for i=0,2047 do $
> outarr[i,j]=median(inarr[*,i,j])
>

No, I think your form (3) would be interpretted as a single line, so
it would be equivalent to form (2). The following form (4) would be
slightly slower than (1), but keep in mind that small amounts of
processing in the outer loop are pretty much negligible.

for j = 0, 2047 do begin
for i = 0, 2047 do begin
outarr[i,j]=median(inarr[*,i,j])
endfor
endfor

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Landsat 7 and IDL Insight
Next Topic: list widget

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

Current Time: Sun Oct 12 00:54:41 PDT 2025

Total time taken to generate the page: 1.52047 seconds