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

Home » Public Forums » archive » Re: Fast matrix filling in IDL
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: Fast matrix filling in IDL [message #13790 is a reply to message #13788] Sat, 12 December 1998 00:00 Go to previous messageGo to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
A slight modification of David's program, and adding
my favourite speedup method:

PRO TEST
m = 1000
n = 500

array = Fltarr(m, n)
v = RandomU(seed, m)

time = systime(1)
FOR i=0,n-1 DO array[*,i] = v
Print, 'Time for Loop: ', systime(1) - time

time = systime(1)
vector = Replicate(1, n)
array = v ## vector
Print, 'Time for Matrix Operations: ', systime(1) - time

time = systime(1)
array = rebin(reform(v,m,1,/overwrite),m,n,/sample)
print, 'Time for Rebin Operations: ', systime(1) - time
END

On { alpha OSF unix 5.2 Oct 30 1998}, this gives:

Time for Loop: 0.27343702
Time for Matrix Operations: 0.093750000
Time for Rebin Operations: 0.067382932

Note that the relative speeds can vary quite a lot on
different architectures.

Regards,

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: probability scale on 2D line plot?
Next Topic: Re: GEO TIFF read/write ?

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

Current Time: Wed Oct 08 19:36:58 PDT 2025

Total time taken to generate the page: 0.00463 seconds