[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fast matrix filling in IDL



Stein Vidar Hagfors Haugan (steinhh@ulrik.uio.no) writes:
> 
> A slight modification of David's program, and adding
> my favourite speedup method:
>
>   time = systime(1)
>   array = rebin(reform(v,m,1,/overwrite),m,n,/sample)
>   print, 'Time for Rebin Operations: ', systime(1) - time
> 
> 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.

I guess. Here is what I get with Stein Vidar's modifications
on my Windows NT machine:

   IDL> Print, !Version
   { x86 Win32 Windows 5.2 Oct 30 1998}
   IDL> test
   Time for Loop:       0.10000002
   Time for Matrix Operations:      0.019999981
   Time for Rebin Operations:      0.039999962

The Rebin operations are twice as slow as the matric operations.
Hummm. Why!?

Cheers,

David
-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Progamming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155