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

Home » Public Forums » archive » For loop avoidance - getting indices of real space
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: For loop avoidance - getting indices of real space [message #81451 is a reply to message #81226] Fri, 21 September 2012 13:06 Go to previous message
simulana is currently offline  simulana
Messages: 15
Registered: August 2012
Junior Member
On Tuesday, August 28, 2012 5:41:29 PM UTC-4, JDS wrote:
> On Thursday, August 23, 2012 4:58:48 PM UTC-4, simu...@gmail.com wrote:
>
>> I have read and re-read until cross-eyed this post: http://www.idlcoyote.com/tips/forloops.html
>
>
>
> Just for the record, that particular post was made almost entirely in jest: sometimes a for loop is indeed what you want.
>
>
>
> JD

*Almost* entirely you say, but in my case entirely accurate. I reduced the runtime of my code from 10 minutes to 2 minutes by using the above arrays to find my indices instead of for loops, which seems significant to me, considering I need to run it over and over again. I was getting really bored.

In general I find that it's easy to loose focus on a problem if your runtime is approximately between 4 min - 2 hours. You feel like it's too short of a time to switch focus to another project and be productive at all. So, yay for code optimization.

In response to Yngvar:

I also had the problem that I had to add a constant value to each i,j,k specified by another array xBounds that gives the lower left corner of each grid. Since I was basically concatenating all the data from each grid, I could figure out how to add this lower left corner value to each data point before the reform.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Plot Size difference
Next Topic: Escaped Characters in string output

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

Current Time: Wed Oct 08 15:21:43 PDT 2025

Total time taken to generate the page: 0.00456 seconds