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

Home » Public Forums » archive » Re: Vector comparison.
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: Vector comparison. [message #37051 is a reply to message #37049] Thu, 20 November 2003 09:24 Go to previous messageGo to previous message
tam is currently offline  tam
Messages: 48
Registered: February 2000
Member
Timm Weitkamp wrote:
> Darnit! I was so proud of my answer... only to find that Chris Lee already
> proposed the same method (the "memory-hogging" one), albeit using more
> lines and this "if count eq 0 then ..." after WHERE, which always annoys
> me for some stupid reason. It can be avoided, which gives me an excuse to
> post my suggestion anyway:
>
> function Get_Match, a, b
> na = n_elements(a) & nb = n_elements(b)
> return, where(total((rebin(a,na,nb) - rebin(transpose(b), na, nb)) eq 0, 2))
> end
>
> Cheers,
>
> Timm

Hey, even I can understand this one! The only problem I can see
is that it can't handle arrays of strings... It's easy enough
to change the "a-b eq 0" to just "a eq b", but I don't see
how to do the rebin functionality on a string array. Is there
some other way to expand a string vector into a matrix (without
using something like the explicit pointer vector I had used).

Congratulations,

Tom
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLWAVE takes over
Next Topic: Byte Swapping

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

Current Time: Sun Oct 12 14:35:26 PDT 2025

Total time taken to generate the page: 0.96224 seconds