Fast Implementation [message #31416] |
Fri, 05 July 2002 08:56 |
Isa Usman
Messages: 13 Registered: October 2001
|
Junior Member |
|
|
Hi,
I have the bit of code below which calculates the number of points in all
four quandrants of a 2d space. Unfortunately my arrays are very large and it
takes quite a while to run.Is there a way of making the code faster.
Thanks in advance!
Isa
@@@@@@@@@@@@
;Data samples
for j=0L,n1-1 do begin
x0=X(j)
y0=Y(j)
index=where(X gt x0 and Y gt y0,count1)
index=where(X lt x0 and Y gt y0,count2)
index=where(X lt x0 and Y lt y0,count3)
index=where(X gt x0 and Y lt y0,count4)
na=count1
nb=count2
nc=count3
nd=count4
points(j,0:3)=float([na,nb,nc,nd])/n2
endfor
--
*************************************************
Today's subliminal thought is:
*************************************************
|
|
|