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

Home » Public Forums » archive » Re: Performance of a loop
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: Performance of a loop [message #27341] Thu, 18 October 2001 08:34 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
azM wrote:
>
> How can i speed up this procedure? It steps through a matrix of either
> 64x64x64, 128x128x128 or in the worst case 256x256x256.
>
> <==BEGIN IDL==>
> FOR i = init, limit, 1 DO BEGIN
> FOR j = init, limit, 1 DO BEGIN
> FOR k = init, limit, 1 DO BEGIN
> X=img_a(i:kernel_dim+i,j:kernel_dim+j,k:kernel_dim+k)
> Y=img_b(i:kernel_dim+i,j:kernel_dim+j,k:kernel_dim+k)
> sign_prob_map=TM_TEST(X,Y)
> spm_plot_statistic(i,j,k)= sign_prob_map(0)
> spm_plot_significance(i,j,k)= sign_prob_map(1)
> ENDFOR
> ENDFOR
> ENDFOR
> <== END IDL ==>

The easiest mod for some increase in speed:

<==BEGIN IDL==>
FOR k = init, limit, 1 DO BEGIN
FOR j = init, limit, 1 DO BEGIN
FOR i = init, limit, 1 DO BEGIN
X=img_a(i:kernel_dim+i,j:kernel_dim+j,k:kernel_dim+k)
Y=img_b(i:kernel_dim+i,j:kernel_dim+j,k:kernel_dim+k)
sign_prob_map=TM_TEST(X,Y)
spm_plot_statistic(i,j,k)= sign_prob_map(0)
spm_plot_significance(i,j,k)= sign_prob_map(1)
ENDFOR
ENDFOR
ENDFOR
<== END IDL ==>

assuming the guts of the inner loop can't be sped up somehow.

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Widget_Draw - Help
Next Topic: using an unlnown number of keywords

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

Current Time: Fri Oct 10 12:24:25 PDT 2025

Total time taken to generate the page: 1.12067 seconds