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

Home » Public Forums » archive » Removing if then else loop for efficiency
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
Removing if then else loop for efficiency [message #69309] Sun, 10 January 2010 04:06
Tom Ashbee is currently offline  Tom Ashbee
Messages: 3
Registered: January 2010
Junior Member
Hello,

apologies for my newb-ness, but I was hoping I could get some help
with increasing the efficiency of the following program:

At the moment it is like this

for i=0, N-1 do begin
for j=0, N-1 do begin
if i ne j then begin
;stuff
endif else begin
;more stuff
endif
endfor
endfor

It's way too slow at the moment, but I gather I can remove one of the
for loops and the if then else loop but I have no idea how!

Any help would be much appreciated and I can post the full program too
if it helps. FTR it's the RHS of a Hamiltonian.

Thanks again
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: envi_title_bar.ico missing and null pointer dereferenced error when using .sav file in ENVI
Next Topic: Greek Symbols in Plot Annotations

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

Current Time: Wed Oct 08 17:07:14 PDT 2025

Total time taken to generate the page: 0.00568 seconds