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

Home » Public Forums » archive » Re: fast search
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: fast search [message #50818 is a reply to message #50811] Tue, 17 October 2006 05:53 Go to previous messageGo to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
This link may be useful to you:

http://www.dfanning.com/code_tips/pts_in_sphere.html

Ciao,
Paolo


m.goullant@gmail.com wrote:
> Hi there,
>
> I have the following problem:
>
> ;data structure of an irregular point cloud
> x = points.x
> y = points.y
> z = points.z
>
> search radio
> radio = 8
>
> FOR i=0L,N_ELEMENTS(z)-1 DO BEGIN
>
> square = WHERE(x LE x[i] + radio AND x GE x[i] - radio AND y LE
> y[i] + radio AND y GE y[i] - radio)
> ;(...)
>
> ENDFOR
>
> I realize that WHERE will do the job, but at very low efficiency.
> WHERE
> makes no assumptions about the list being ordered. It seems to me it
> has
> to check every element of the array, requiring N steps for an N-element
> array
>
> There is a faster way to do this?
>
> thanks,
> Marie
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: vector of bin indices using histogram?
Next Topic: Re: Weirdest Error Ever

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

Current Time: Wed Oct 08 17:44:38 PDT 2025

Total time taken to generate the page: 0.00443 seconds