On Tue, Mar 2, 2010 at 10:48 PM, Raul Miller <[email protected]> wrote:
> We can use /. for convolution (+//.@(*/)) of one dimensional
> arrays, but do we have anything that simple for higher
> dimensional arrays?

Sure, two dimensional convolution is nothing more complicated than
just one dimensional, so you can do it with two obliques and throwing
in a couple of ranks and/or transposes.  The following is probably not
the most elegant way, but it works.

   ]a =: 10 0 ,: 0 1
10 0
 0 1
   ] b=: 2 2 ,: 1 0
2 2
1 0
   +//. |:"2 +//."3 (|:a) */ b
20 10 0
20  2 1
 0  2 0

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

Reply via email to