Hi Raul, I just got home. :)
Thanks for the solution, as usual I've never realized that I can use =/ to compare 2 vectors with different length. I kept thinking that I'll apply a train of primitives between a and b nouns. It was a bit depressing to realize that I was going about it the wrong way. Popped ego and all. Thanks. r/Alex -----Original Message----- From: [EMAIL PROTECTED] on behalf of Raul Miller Sent: Thu 9/18/2008 11:19 PM To: Programming forum Subject: Re: [Jprogramming] Verb Sequence or Ranking problem? On Thu, Sep 18, 2008 at 10:38 AM, Alex Rufon <[EMAIL PROTECTED]> wrote: > [a=: 1 1 2 2 3 5 5 5 > 1 1 2 2 3 5 5 5 > [b=: 3 4 5 5 3 1 2 > 3 4 5 5 3 1 2 > > What I wanted to do was count the number of matching numbers in a that > are in b. So potentially, my result should be: > 1 0 3 3 1 2 2 +/a=/b 1 0 3 3 1 2 2 If the storage costs of that approach are too excessive, you could instead use: a +/@:="1 0 b 1 0 3 3 1 2 2 If either mechanism is not obvious to you (after you review your knowledge of what the symbols mean), please ask, and I would be happy to elaborate. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
