Re: Memory Leakage......(I think) [message #30477] |
Wed, 01 May 2002 09:11  |
Rick Towler
Messages: 821 Registered: August 1998
|
Senior Member |
|
|
Have you tried removing the calls to the temporary function?
-Rick
"Andrew Fielding" <a.fielding@icr.ac.uk> wrote in message
news:3d9ed221.0205010403.406fe470@posting.google.com...
> Thanks for the comments regarding my problem. Someone suggested I post
> the code to clarify the problem so here it is.
> This is a loop within a sub-procedure that is called (256*256) times
> from the main procedure. The count variable controlling the loop
> varies from a minimum of 0 up to 510 depending on the call. I am
> fairly certain the problem is with the arithmetic within the loop as
> removing it and replacing it with a simple statement results in the
> main program processing in around 2 minutes! Any hints/suggestions
> gratefully received.
>
> Andrew
>
> ; Weighted Interpolation voxel density calculation
>
> fval=0.0
> sum=0.0
>
> for i=0L,count-1 do begin
> index=ishft(X1,-14) + row[ishft(Y1,-14)] + slice[ishft(Z1,-14)]
> val=ctcube[index]
> if (val gt config.air) then begin
> d0= X1/SCALE - fix(X1/SCALE)
> d1= Y1/SCALE - fix(Y1/SCALE)
> d2= Z1/SCALE - fix(Z1/SCALE)
> fval=(1.0-d0)*(1.0-d1)*(1.0-d2)*float(val)
> fval=temporary(fval) + d0*(1.0-d1)*(1.0-d2)*float(ctcube[index+1])
> fval=temporary(fval) +
> (1.0-d0)*d1*(1.0-d2)*float(ctcube[index+xdim])
> fval=temporary(fval) + d0*d1*(1.0-d2)*float(ctcube[index+1+xdim])
> index=temporary(index) + xdim*ydim
> fval=temporary(fval) + (1.0-d0)*(1.0-d1)*d2*float(ctcube[index])
> fval=temporary(fval) + d0*(1.0-d1)*d2*float(ctcube[index+1])
> fval=temporary(fval) + (1.0-d0)*d1*d2*float(ctcube[index+xdim])
> fval=temporary(fval) + d0*d1*d2*float(ctcube[index+1+xdim])
>
> val= fix(fval)
> sum=temporary(sum) + convert_ct2mu[val-(Hmin-1024)]
> endif
>
> X1=X1+dX
> Y1=Y1+dY
> Z1=Z1+dZ
> endfor
|
|
|