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

Home » Public Forums » archive » Re: Relative distances between vector elements and search for matches in other vector.
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: Relative distances between vector elements and search for matches in other vector. [message #80144 is a reply to message #80010] Thu, 26 April 2012 14:30 Go to previous message
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Trifon, you're most welcome.

If you can estimate the max possible size of your result (even if you overestimate it by a lot) I would do:

selected_dep=fltarr(1e4)*0-1
;this creates a huge array with "impossible values" -1.
Then you fill it as you go with real values, And at the end just do:
selected_dep = selected_dep[ where(selected_dep NE -1)]
This is usually much faster!


In general, I am still confused about what you are trying to do. Could you give a simple example of input and output? Something like:

;inputs:
r1=[1,3,3,4,5]
r2=[2,-1,4,3]

;outputs:
3,4

Don't bother with technical (geological) terms, they just confuse non-specialists. Just give us the simple examples and we'll see if we can speed this up for you a bit.

Gianguido
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Coyote Graphics Update: cgHistoplot
Next Topic: How to make an input parameters file??

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

Current Time: Fri Oct 10 16:25:25 PDT 2025

Total time taken to generate the page: 1.91873 seconds