Intersection: Difference between revisions

Jump to navigation Jump to search
735 bytes added ,  08:32, 11 June 2020
(Created page with "{{Built-in|Intersection|∩}} is a dyadic set function which computes the set intersection of the two vector argument|arg...")
 
Line 19: Line 19:
</source>
</source>


== Extension ==
Some dialects allow Intersection to work on [[major cell]]s:
[https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/P@JR2wQTBaNHvVvUHR2dnJyBQJ0rEihojBB0dFTnetQ3FSgY8ahjZeT//wA Try it online!]<source lang=apl>
      X←4 2⍴'AABBCCCC'
      Y←3 2⍴'AABBAA'
      X∩Y
AA
BB
</source>{{Works in|[[Extended Dyalog APL]]}}
Others can easily define such a function:
[https://tio.run/##SyzI0U2pTMzJT///P@JR2wQTBaNHvVvUHR2dnJyBQJ0rEihojBB0dFTn8swrSS0qTk0uyczPA8pWP@rd9ahn/6PeFRqPOhc96t2q@ahzKZB61LsZKFPL9ahvKlBVhAKyNoXI//8B Try it online!]<source lang=apl>
      X←4 2⍴'AABBCCCC'
      Y←3 2⍴'AABBAA'
      Intersection←{⍺⌿⍨(≢⍵)≥⍵⍳⍺}
      X Intersection Y
AA
BB
</source>{{Works in|[[Dyalog APL]]}}
== External Links ==
== External Links ==


Navigation menu