efittery wrote:
>
>> Definition of R. would be:
>>
>>Rank _1 _ _1
>>
>>x f R. y <-> (...(x f y1)f y2)...)f yn, where n=#y
>> f R. y <-> (...( f y1)f y2)...)f yn
>
> I am confused about the above statement.
>
> What is the definition for R. ?????
>
>
I would say the definition is exactly what is written above.
We can think of x as an "accumulator" that gets modified
according to f and the sequence of items in y.
x f y gives the new value of the accumulator based on
its current value x and the current element y.
R. is similar to / with the main difference being the case
when f maps X x Y -> X, where X and Y are different (e.g
X is matrix, Y is scalar). Then:
1a) Since X and Y are different, all the parenthesizing above
is necessary, i.e R. has a definitive order of passing
through y (from left to right, although of course it is
easy to redefine the order to be from right to left.)
1b) In order that the above monadic definition is consistent,
f should also map Y -> X in the monadic case.
Also notice that when f maps X x X -> X,
f R. should be in many cases simply equivalent to:
f/ @: ,
I hope this clarifies things a bit.
--
View this message in context:
http://www.nabble.com/reduce-fold-in-J-as-an-adverb-or-conjuction-tf4839217s24193.html#a13897774
Sent from the J General mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm