[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Finding values in an array
- Subject: Finding values in an array
- From: Bob Fugate <rqfugate(at)mindspring.com>
- Date: Sun, 24 Jun 2001 22:26:35 -0600
- Newsgroups: comp.lang.idl-pvwave
- Organization: MindSpring Enterprises
- User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:25418
I have a vector containing a very, very large number of long integer values.
I want to compare the value of each element in the vector to the values of
the elements in the first column of a two column array until there is a
match, and then extract the corresponding number in the second column (e.g.
by using WHERE) of the array.
Does anyone know a way to do this without using a loop? I realise that
organizing the searched array as two rows may speed this up, however, I am
trying to avoid using a loop. The numbers in the vector vary randomly (and
it is important to preserve the original order) but the numbers in the first
column of the array are sorted and increase monotonically (if that matters).
I am new to IDL, so will greatly appreciate any suggestions.