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

Home » Public Forums » archive » Re: Faster way ?
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: Faster way ? [message #41173 is a reply to message #41172] Mon, 27 September 2004 10:44 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
rats@mail.geog.uvic.ca (Rafael Loos) writes:
> Hi, I am trying to find the number of values that are within a range
> ...
> I have an Array that has 3 columns and 5 millions lines.
> Thats what I am doing ...
>
> number = WHERE((Array[1,*] GE Min) AND (Array[1,*] LE Max), geralX)
>
> I am storing the number inside the variable geralX ...
> It is taking 0.23 seconds ... but I want to know if there is a faster
> way to find that ...

If you are doing this many times in a loop and ARRAY is unchanging, it
may be worth extracting ARRAY[1,*] into its own variable. That way,
you will save the time of extracting each iteration.

If you just want the total number of elements that match your filter,
you can use total, as in:

filter = (Array[1,*] GE Min) AND (Array[1,*] LE Max)
geralX = total(filter)

Good luck,
Craig


--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Unique system identified?
Next Topic: IDL filled contour to PostScript - wired horizontal and vertical lines ???

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

Current Time: Wed Dec 03 14:11:14 PST 2025

Total time taken to generate the page: 1.28015 seconds