Re: Comparing 2d sequences

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 10 Jun 1997 20:38:15 -0300 Ricardo Niederberger Cabral
<rnc at INFOLINK.COM.BR> writes:

>> function Compare2D(sequence a, sequence b)
>>   return not (a-b)
>> end function
>
>        Thank you, but I want to know what is different between two 2D
>sequences
>by reading a "mask" sequence (with the same length of the compared
>sequences) where each 0 means that the corresponding element in both
>compared sequences are different.
>

Ricardo !!!

Please test the code.
This code does exactly as you ask.
It will return 1's for all that are the same and
return 0's for all that are different.

The logic is

2Dseq = {{1,2},{3,4}} - {{1,1},{6,4}}
--2Dseq now equals {{0,1},{-3,0}}
2Dseq = not 2Dseq
--2Dseq now equals {{1,0},{0,1}}

I did not create this routine BUT
That is how I would have done it my self.

ENJOY.

--Lucius Lamar Hilley III
--  E-mail at luciuslhilleyiii at juno.com
--  I support transferring of files less than 60K.
--  I can Decode both UU and Base64 format.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu