Comparing 2d sequences

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

How can I compare two 2d sequences dimensioned like this:
repeat(repeat(1,100),100)
        (Each element ranging from 1 to 10, for example)
And create a 2d "mask" sequence with zeros where
the corresponding elements of the 2 sequences are different ?
I'm using the and_bits function but it sometimes (and don't know why)
        give
me something wrong.
        I tried this function:

function compare(sequence seqa,sequence seqb)
    for h=1 to length(seqa) do
        for v=1 to length(seqa[1]) do
            if seqa[h][v] != seqb[h][v] then tmpComp[h][v]=0 end if
        end for
    end for
    return tmpComp
end function

        But it's VERY slow. How can I do this ???

(When each element of the compared sequence is 1 or 2, and_bits work
perfectly...)
                Thanks,

---
Ricardo Niederberger Cabral
<rnc at infolink.com.br>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu