Hi Everybody!
I need to compare 3-4 sets (boxed lists of literals) for set membership
differences. This makes 3 pairwise comparisons with 3 sets and six comparisons
with four set.
It would be nice to be able to use Cartesian product to make a nxn table for
visual reasons (in my case the differences should be small).
I managed to be able to do set comparison with CP but I am having trouble with
minusdot operator -. .
A simple example below.
Any ideas would be greatly appreciated.
Esa
NB. 3 sets, A is missing member z that is in sets B and C that are identical
]A=.;:'x y'
+-+-+
|x|y|
+-+-+
]B=.;:'x y z'
+-+-+-+
|x|y|z|
+-+-+-+
]C=.;:'x y z'
+-+-+-+
|x|y|z|
+-+-+-+
NB. differences in sets pairwise
A(-.;-.~)B
++-+
||z|
++-+
A(-.;-.~)C
++-+
||z|
++-+
B(-.;-.~)C
+++
|||
+++
NB.Cartesian product
CP
+-+-+-------+
|{|@|+-+-+-+|
| | ||,|&|<||
| | |+-+-+-+|
+-+-+-------+
-:/ L: 2 CP~ A;B;<C NB. set equality, this works
+-+-+-+
|1|0|0|
+-+-+-+
|0|1|1|
+-+-+-+
|0|1|1|
+-+-+-+
-./ L: 2 CP~ A;B;<C NB. differences in sets, this doesn't work
+---------+-------+-------+
| |+-----+|+-----+|
| ||+-+-+|||+-+-+||
| |||x|y|||||x|y|||
| ||+-+-+|||+-+-+||
| |+-----+|+-----+|
+---------+-------+-------+
|+-------+| | |
||+-+-+-+|| | |
|||x|y|z||| | |
||+-+-+-+|| | |
|+-------+| | |
+---------+-------+-------+
|+-------+| | |
||+-+-+-+|| | |
|||x|y|z||| | |
||+-+-+-+|| | |
|+-------+| | |
+---------+-------+-------+
Tämän viestin sisältö liitteineen on luottamuksellinen ja tarkoitettu vain sen
vastaanottajalle. Jos et ole viestin tarkoitettu vastaanottaja, pyydämme sinua
poistamaan viestin liitteineen ja sen jälkeen ilmoittamaan asiasta välittömästi
viestin lähettäjälle. Viestin sisällön paljastaminen, kopioiminen tai muu
käyttö on kielletty.
The contents of this message and any attachments are confidential and meant
solely for the intended recipient. If you are not the intended recipient, we
kindly ask that you delete the message and its attachments, and immediately
notify the sender of the email. Disclosing, copying or using the contents of
the message is strictly prohibited.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm