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

Home » Public Forums » archive » Re: [Q]IDL: Using WHERE.
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: [Q]IDL: Using WHERE. [message #5974 is a reply to message #5973] Wed, 20 March 1996 00:00 Go to previous messageGo to previous message
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <314F31C4.2C6B@cdc.noaa.gov>, Andy Loughe <afl@cdc.noaa.gov> writes:
> Joe Fitzgerald wrote:

>> Is there a way to use B to get the complementary values; i.e., the array
>> of subscripts for which ARRAY is less than 20?

> Uh! This is a set-up, isn't it?
> Is my boss watching?
> How about LESS THAN OR EQUAL TO? That would be complementary.
>
> Why use B? Why not use...
> C = Where(array LE 20., count)
> if (count gt 0) then print, 'Hurray!'

I think the idea was to use B to avoid the potentially expensive operation of
comparing the entire array again to find the complementary elements.

I think this will cut the computation time:

t = (array gt 20) ; t(i) will be 0 or 1 depending upon comparison
b = where(t) ; b is the indices of the > 20 elements
c = where(t-1) ; c is the indices of the <= 20 elements

This method avoids doing the floating point comparison twice.

____________________________________________________________
Mark Rivers (312) 702-2279 (office)
CARS (312) 702-9951 (secretary)
Univ. of Chicago (312) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars3.uchicago.edu (Internet)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Line index
Next Topic: [Q]: How to calculate distance from GPS measurements

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

Current Time: Fri Oct 10 20:27:41 PDT 2025

Total time taken to generate the page: 0.08185 seconds