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

Home » Public Forums » archive » Re: Little help on arrays - 2nd try
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: Little help on arrays - 2nd try [message #38039 is a reply to message #38034] Mon, 16 February 2004 12:45 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Mon, 16 Feb 2004, Földy Lajos wrote:

>
> On Mon, 16 Feb 2004, Craig Markwardt wrote:
>
>>
>> Nuno Oliveira <nmoliveira@fc.ul.pt> writes:
>>
>>
>>> How do I compare one array with another? I want to avoid comparing
>>> position per position.
>>>
>>> IDL> if [1,1] eq [1,1] then print, 'bingo!'
>>> % Expression must be a scalar or 1 element array in this context: <BYTE
>>> Array[2]>.
>>> % Execution halted at: $MAIN$
>>
>> The other posters have good ideas. My own idiom for this comparison
>> is:
>>
>> if total(abs(X-Y)) EQ 0 then print, 'bingo!'
>>
>> Craig
>>
>>
>
> Hi,
>
> I think
>
> if min(x-y, max=max) eq max then print, 'bingo!' ; for integer arrays
>
> is about 20% faster for arrays greater than cache memory.
>
> regards,
> lajos
>
>

oops, just a little correction:

if (min(x-y, max=max) eq max) and (max eq 0) then print, 'bingo!'

regards,
lajos
[Message index]
 
Read Message
Read Message
Previous Topic: Re: Destroying objects
Next Topic: Re: Little help on arrays

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

Current Time: Fri Oct 10 07:43:42 PDT 2025

Total time taken to generate the page: 1.85847 seconds