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

Home » Public Forums » archive » Find minimums in an array...
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
Find minimums in an array... [message #32536] Wed, 16 October 2002 11:08 Go to next message
engpcris is currently offline  engpcris
Messages: 4
Registered: August 2001
Junior Member
Hello

I'm looking for a fonction or an algorithm who could find the X
minumun values in a array without having to use Sort (for a time
reason) or Min (updating the array everytime)

For Example in a Array of 1000 elements I want to find the 10 smallest
values.

Do you know any quick how to perfome it? (as I need to do this
operation many times in a loop)

thank you very much for your help.

Fil
Re: Find minimums in an array... [message #32586 is a reply to message #32536] Tue, 22 October 2002 08:28 Go to previous message
Stein Vidar Hagfors H[1] is currently offline  Stein Vidar Hagfors H[1]
Messages: 56
Registered: February 2000
Member
JD Smith <jdsmith@as.arizona.edu> writes:
>
[..snip..]
> As always, you're mileage may vary. Check the performance on your
> equipment, using your data.

My compliments, JD!

My eyes used to glaze over whenever you reverse-index gurus touted
your stuff, but with this clear-cut example I think I've finally
gotten it! (And obviously, David has already graduated from histogram
college!)

> Also, lest everyone think I'm out to turn their code into piles of
> HISTOGRAM spaghetti: just because a fast HISTOGRAM/REBIN/REFORM
> solution exists, doesn't mean you should always use it

Some of the spaghetti might benefit from being canned in a procedure,
I'd say. Makes for meaningful programs & plenty of space to document
the [sometimes arcane] logic behind the use of the histogram function!
E.g. JDS_NSMALLEST(DATA,N).

--
------------------------------------------------------------ --------------
Stein Vidar Hagfors Haugan
ESA SOHO SOC/European Space Agency Science Operations Coordinator for SOHO

NASA Goddard Space Flight Center, Email: shaugan@esa.nascom.nasa.gov
Mail Code 682.3, Bld. 26, Room G-1, Tel.: 1-301-286-9028/240-354-6066
Greenbelt, Maryland 20771, USA. Fax: 1-301-286-0264
------------------------------------------------------------ --------------
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: basic IDL questions: please help!
Next Topic: Re: Minimum curvature surface problem

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

Current Time: Tue Dec 02 10:02:32 PST 2025

Total time taken to generate the page: 0.47749 seconds