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

Home » Public Forums » archive » For loops vs. matrix operations
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
For loops vs. matrix operations [message #37441] Wed, 17 December 2003 13:36
Jonathan Greenberg is currently offline  Jonathan Greenberg
Messages: 91
Registered: November 2002
Member
I know some matrix programs perform better if you do straigh matrix math vs.
a for-next loop -- is idl this way? E.g. is:

array=intarr(10000)
for i=0,(10000-1) do begin
array[i]=array[i]+1
endfor

MUCH slower than:

array=intarr(10000)
array=array+1

?

I'm trying to figure out how much time I should be using rewriting some code
to optimize the algorithm, which is why I'm asking (the code is more complex
than above, obviously, but I did notice I could "matricize" some of the code
in places)...

--j
[Message index]
 
Read Message
Previous Topic: Re: IDL and VI ; Color highlighting
Next Topic: IDL and supercomputers?

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

Current Time: Wed Oct 08 19:19:26 PDT 2025

Total time taken to generate the page: 0.00449 seconds