1 3 E. 4 2 1 3 4 6 1  3
0 0 1 0 0 0 1 0

  I.     1 3 E. 4 2 1 3 4 6 1  3
2 6


On 6 Dec 2016 13:38, "Don Guinn" <[email protected]> wrote:

J has a verb "member" (e.) which gives true for if the item of the left
argument is an item in the right argument.

   1 3 2 5 6 e. 4 2 1 3
1 1 1 0 0

Is that what you are looking for?

On Tue, Dec 6, 2016 at 5:11 AM, 'Jon Hough' via Programming <
[email protected]> wrote:

> Hi, Welcome to the J forums.
>
> I would like to help, but I don't understand what you are asking. Perhaps
> others will understand better.
>
> By *in*, do you mean the "Member in" verb? http://code.jsoftware.com/
> wiki/Vocabulary/edot
>
> On my pretty old spec 32-bit machine:
>
>  a =: ? #~ 10000000 NB. 10 million random ints
>  b =: 1000}. ? #~ 10000000 NB. (10 million - 1000) random ints
>
> timespacex ' a e. b'
> 0.210506 3.35551e7
>
> I get 211 milliseconds.
>
> --------------------------------------------
> On Tue, 12/6/16, Abi <[email protected]> wrote:
>
>  Subject: [Jprogramming] in function which beats the benchmark
>  To: [email protected]
>  Date: Tuesday, December 6, 2016, 6:45 PM
>
>  Hi,
>  I am new to J. Can someone implement the *in* function.
>  I have tried various ways but cannot get to beat the
>  benchmark of ~130 ms.
>
>  list1: 0 til 10MM
>  list2 : 1M till 10MM
>
>  list2 *in* list1
>
>  The line above shows the in operator.
>
>  Thanks.
>  ----------------------------------------------------------------------
>  For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to