In the general case of x f;.3 y the left argument x is a 2-row table of (movement,:size) with as many columns as the rank of y . A list x is treated as as if the movements were 1 and the sizes were x, and an x with an insufficient number of columns is treated as if the missing movements were 1 and the sizes were the sizes of the corresponding axes of y .
> I have asked for an operation to be applied to 3x3 subarrays > of the operand; each result returns a scalar, so the result > should be rank 2, shape 2 2. Even in your interpretation the verb is applied to 3 3 2 subarrays, not 3 3 subarrays. Also, consider: $ 3 2 <;._3 i.3 7 1 6 $ 3 2 5 4 <;._3 i.3 7 5 13 1 6 1 10 Shouldn't the "surplus" unit axes be discarded? ----- Original Message ----- From: Henry Rich <[EMAIL PROTECTED]> Date: Tuesday, July 29, 2008 9:42 Subject: [Jprogramming] Excess axes in 3 3&(0:;._3) i. 4 4 2 To: 'Programming forum' <[email protected]> > $ 3 3&(0:;._3) i. 4 4 2 > 2 2 1 > > The shape should be 2 2, methinks. > > I have asked for an operation to be applied to 3x3 subarrays > of the operand; each result returns a scalar, so the result > should be rank 2, shape 2 2. > > The interpreter has treated it as if I had written > 3 3 2&(0:;._3) which would be applying the verb to 3x3x2 > subarrays. > > But if I had wanted that, I should have written it. By > omitting the trailing axes I should be indicating that I want > to take them in full, and their structure (which might include > several axes) should disappear from the result. > > The Dictionary does not speak to this point, but I think > my suggestion here is better than the current design. As it > is I have to know how many axes should be left and discard the > surplus. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
