$ 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.

Henry Rich


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

Reply via email to