Matrix (or array) problem...

David Bovill david.bovill at opn-technologies.com
Fri Dec 14 18:14:00 EST 2001


I have essentially two lists containing boolean values (ie 0 or 1), that I
want to find the intersection of (that is if either value is true then the
same position in the new list is true otherwise it is false).

ie    011             100          000
      100  intersect  000  equals  000
      100             100          100

I have to do this fast, so I don't want to loop through the lists comparing
value - I want to use a built in function?

I have tried the union/intersect functions for simple arrays - but no joy,
and then I tried matrixMultiply (transposing one of them first) - but
obviously got my maths wrong with that idea.

Any thoughts about the best way to do this fast? I figure there must be a
built in function or matrix arithmetic I could use. I can write the boolean
data how I want (ie -1 1 -1) but the comparison needs to be fast (I'll need
to do it on 100's of records).

Any ideas?




More information about the metacard mailing list