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 #12829] Fri, 18 September 1998 00:00 Go to previous message
bowman is currently offline  bowman
Messages: 121
Registered: September 1991
Senior Member
In article <3602D89B.15BF8C2D@ssec.wisc.edu>, Liam Gumley
<Liam.Gumley@ssec.wisc.edu> wrote:

> Kenneth P. Bowman wrote:
>> IDL has a pretty good SORT routine, but no SEARCH routine that I have been
>> able to find (that is, a procedure to find the index of the closest/first
>> match in an ordered list). Once again, this can be done with loops, but
>> such an implementation would almost certainly be much slower than a
>> built-in function. Since searching and sorting are such basic operations,
>> does anyone know why there is no SEARCH in IDL?
>
> How about the MIN function, e.g.
>
> array = findgen(100)
> value = 37.2
> result = min( abs( value - array ), location )
> help, location

Again, I'm sure this is an order-N operation, as MIN has to check every
element, just like WHERE. It has no knowledge that the list is ordered.

Ken

--
Kenneth P. Bowman, Professor 409-862-4060
Department of Meteorology 409-862-4466 fax
Texas A&M University bowmanATcsrp.tamu.edu
College Station, TX 77843-3150 Change the AT to @
[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: Wed Oct 08 17:01:15 PDT 2025

Total time taken to generate the page: 0.00428 seconds