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

Home » Public Forums » archive » too many loops
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
too many loops [message #29132] Mon, 04 February 2002 10:54
Jeff Newmark is currently offline  Jeff Newmark
Messages: 1
Registered: February 2002
Junior Member
Hi All,

I probably should be able to find this, but a quick look
didn't give me a great answer so here goes.

I have a nested loop, theoretically each limit is 1000.
Obviously, I do not wish to have 1 million iterations
here. Any suggestions on how to get rid of one of
the loops?

dat = fltarr(n,n)
image=fltarr(n,n,n)
i=fltarr(n,n)
j=fltarr(n,n)
mu=fltarr(n,n)
nu=fltarr(n,n)
r2=fltar(n,n)
rs2=fltarr(n,n)
; the arrays are all initialized or populated
; section left out for brevity

for a=0,N-1 do for b=0,N-1 do $
dat[i[a,b],j[a,b]]=dat[i[a,b],j[a,b]]+$
image[mu[a,b],nu[a,b],scalar]*fa[r2[a,b]]/rs2[a,b]

thanks,
Jeff

--
----------------------------------------------------------
Dr. Jeffrey Newmark Naval Research Lab, Code 7661
voice: (202) 767-0244 4555 Overlook Ave., SW
email: newmark@midas.nrl.navy.mil Washington, DC 20375
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: bash and IDL
Next Topic: Re: too many loops

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

Current Time: Fri Oct 10 04:16:39 PDT 2025

Total time taken to generate the page: 0.64301 seconds