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

Home » Public Forums » archive » Fast Implementation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Fast Implementation [message #31416] Fri, 05 July 2002 08:56
Isa Usman is currently offline  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:

*************************************************
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Eigenvalue problem
Next Topic: Re: WAV File

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

Current Time: Wed Oct 08 20:03:40 PDT 2025

Total time taken to generate the page: 0.00530 seconds