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

Home » Public Forums » archive » Re: Search routines
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: Search routines [message #12841 is a reply to message #12829] Fri, 18 September 1998 00:00 Go to previous messageGo to previous message
landsman is currently offline  landsman
Messages: 93
Registered: August 1991
Member
>
> 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. This is even worse than a linear search of an ordered list, which
> would require an average of N/2 steps. A simple bisection search would be
> LOG2(N) on average, which is, of course, very advantageous for large N.
>

The procedure tabinv.pro in http://idlastro.gsfc.nasa.gov/pub/ftp/math

will perform a vectorized binary search of a monotonic array.

Wayne Landsman landsman@mpb.gsfc.nasa.gov
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Cumulative total
Next Topic: Re: Multiple plot windows

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

Current Time: Fri Oct 10 06:26:31 PDT 2025

Total time taken to generate the page: 0.48293 seconds