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

Home » Public Forums » archive » Re: Distance between two sets of datapoints
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: Distance between two sets of datapoints [message #70223] Fri, 26 March 2010 15:11 Go to previous message
Maxwell Peck is currently offline  Maxwell Peck
Messages: 61
Registered: February 2010
Member
Thanks Ken,

It is definitely much much faster (from 30 minutes for looping only to
1 minute). It is difficult to characterise the speedup entirely
because I was able to add a lot more of the calculations inside the
loop, na is about 700 times larger than nb. I think I must have done
something stupid the first time I tried this and looped over the other
dimension hence my confusion.

Cheers,
Max

On Mar 27, 12:11 am, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> In article
> < eb0d2a64-900b-4c9e-9599-699dcd3da...@k4g2000prh.googlegroups .com >,
>  Maxwell Peck <maxjp...@gmail.com> wrote:
>
>> Thanks Ken, I'll give it a shot. I had tried a similar loop (I
>> thought) but it seemed to be very slow that is why i was looking at
>> vectorising it similar to distance_measure.
>
>>> FOR i = 0, nb-1 DO dist[0,i] = SQRT((xb[i] - xa)^2 + (yb[i] - ya)^2)
>
> This should vectorize reasonably well if na is large and nb is
> not too large.
>
> Ken
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Highlight default button
Next Topic: IDL licensing

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

Current Time: Wed Oct 08 11:29:14 PDT 2025

Total time taken to generate the page: 0.00409 seconds