Re: Help: Coding iterative algorithm elimimating loops in IDL/PV~WAVE [message #505] |
Fri, 11 September 1992 07:41 |
thompson
Messages: 584 Registered: August 1991
|
Senior Member |
|
|
In article <BuBCF5.IEC@breeze.rsre.mod.uk>, jvb@uk.mod.hermes writes...
> Has anyone got an idea how to implment the following algorithm in IDL/PV~WAVE
> that DOESN'T use for loops. The reason for the avoidance of for loops is
> because, as everyone should know, for loops are slow. ...
I haven't put the time in to entirely understand your application, but when you
say ...
> 4) Repeat steps 1 to 3 until the total error is acceptably small, or doesn't
> change significantly
and
> 2) Is there a fast way to implement iterations in IDL/PV~WAVE, ie one that
> avoids do loops?
I would have to say no. At some point you have to decide whether or not you've
converged, or whether you have to reiterate. At that point you have to loop.
IDL does have tricks to avoid explicite loops in certain common vector
manipulations, but when you add a completeness test, then you can't avoid
looping for each reiteration.
I'm assuming that you have a large number of reiterations to process, but that
the code has been optimized so that you're not looping within the iteration, or
otherwise have inefficient code.
Bill Thompson
|
|
|