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 #80021 is a reply to message #80020] Wed, 25 April 2012 07:40 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Trifon Trifonov writes:

> I want to mention that I already made a working algorithm
> but I am 1000 % sure that the more experienced people
> here can help me to make it much more elegant and efficient.
> Later on I have a other problem on that I stuck but lets
> see can you help me on that and it is possible to solve
> it my self... if not I will post again :(

I have a reading assignment for you. :-)

Are FOR Loops the Embodiment of Pure Evil?
http://www.idlcoyote.com/tips/forloops.html

Are FOR Loops *Really* Evil?
http://www.idlcoyote.com/tips/forloops2.html

I don't have time to look at this in much detail,
except to point out that you have a lot of code
that looks like this:

for j=0L, n_elements(xx)-1 do begin
ratio[j] = xx[0] - xx[j]
endfor

This code can *always* be written (and will work a LOT
faster) if you write it like this:

ratio = xx[0] - xx

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[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 00:01:16 PDT 2025

Total time taken to generate the page: 1.03927 seconds