I've just noticed the remark
  " 5. x e. y is equivalent to (#y) = y i. x."
in the page https://code.jsoftware.com/wiki/Vocabulary/edot#dyadic

However,  to spell out the obvious for old hands,
   x =. 3 7 13
   y =. i.10
   x e. y
1 1 0
   (#y) = y i. x
0 0 1
   (#y) > y i. x
1 1 0
   (#y) ~: y i. x
1 1 0

Not so obvious or helpful for "newbies" !

(FWIW, I was exploring how to efficently establish whether elements of sorted x belong to sorted y, and if so, their (sorted) indices,  for integer vectors x and y.  I'm currently using
e.&y followed by y.&i. on the relatively small list of members of y).

Cheers,

Mike




---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to