Henry, thanks!

Now given 'aa' as described in my previous post, I need a verb 'match1'
that will find all the  'n' length vectors in 'aa' that occur again in
'aa', and list all their index locations.

aa =: 2 3 4 5 4 3 2 5 6 7 6 5 4 3 2 3 4 5 4

3 match1 aa
0 14
1 15
2 16
3 11
4 12

4 match1 aa
1 15
3 11

Skip


Skip Cave
Cave Consulting LLC

On Sun, Dec 18, 2016 at 1:58 PM, Henry Rich <[email protected]> wrote:

> match =: I.@:E.
>
> Henry Rich
>
>
> On 12/18/2016 2:54 PM, Skip Cave wrote:
>
>> I have a vector of integers named 'aa', that could be millions of integers
>> long.
>>
>> 1. I want a verb called "match' that will find any duplicates in 'aa' of a
>> test vector of integers that will be smaller than 'aa'
>> I want 'match' to return the index of the location of the start of each
>> match of the test vector in 'aa'
>> For example:
>>
>> aa =: 20 $ i.10
>> 4 5 6 match aa
>> 4 14
>>
>> 9 10 match aa      NB. No match should produce no result.
>>
>>
>>
>> Skip Cave
>> Cave Consulting LLC
>> ----------------------------------------------------------------------
>> 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