On Wed, Jan 2, 2013 at 6:37 PM, Linda Alvord <[email protected]> wrote:
> I am trying to understand what f does.
>
>    ]a=:?>:i.6
> 0 1 0 1 0 4
>    ]a=:=a
> 1 0 1 0 1 0
> 0 1 0 1 0 0
> 0 0 0 0 0 1
>    ]b=:?>:i.6
> 0 0 2 3 2 3
>    f=: 13 :'x #@# y'
>    a f b
> 3 2 1
>    f
> #@#

f"_ 1 _

So f has a left rank of 1 and an infinite right rank.

You used a as the left argument to f, and at rank 1 this gives three
independent values from a, but we will repeatedly use the same value
for b.

We can compute each of these results:

   # 1 0 1 0 1 0 # 0 0 2 3 2 3
3
   # 0 1 0 1 0 0 # 0 0 2 3 2 3
2
   # 0 0 0 0 0 1 # 0 0 2 3 2 3
1

and then assemble them into a final result:
3 2 1

And, in fact, except for errors, we get the same result regardless of b:

   a f 1
3 2 1

Conceptually, we are just summing the rows of a. This concept is
consistent with the mechanics whenever a contains only non-negative
integers and b does not force any errors.

(But note that names like a and b blur into the background when used
in sentences. I hope that that is not too confusing.)

FYI,

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

Reply via email to