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

Home » Public Forums » archive » How to make IDL faster
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: How to make IDL faster [message #36867 is a reply to message #36775] Wed, 29 October 2003 11:42 Go to previous messageGo to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <4a097d6a.0310291118.2ceed6d5@posting.google.com>,
M. Katz <MKatz843@onebox.com> wrote:
>
> if geo(0,i,j) gt lat(k)-0.04 and geo(0,i,j) lt lat(k)+0.04 and $
> geo(1,i,j) gt lon(k)-0.04 and geo(1,i,j) lt lon(k)+0.04
>
> to this
>
> if (abs(geo(0,i,j) - lat(k)) LT 0.04) and $
> (abs(geo(1,i,j) - lon(k)) LT 0.04) then . . .
>
> Here I am thinking that you minimize the number of times you have to
> go to the geo() array and get the (0,i,j) element.
>
> M. Katz


Do both conditional clauses always get evaluated, even if the first one is false? If so,
it might be faster to add a second if statement:

if (abs(geo(0,i,j) - lat(k)) LT 0.04) then $
if (abs(geo(1,i,j) - lon(k)) LT 0.04) then print, loc(k), etc...

I haven't tried this on a large dataset, but it might be worth investigating.

--Mike


--
Michael Chinander
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Solving nonlinear equations
Next Topic: vector t-test?

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

Current Time: Wed Oct 08 18:44:15 PDT 2025

Total time taken to generate the page: 0.19287 seconds