On Wed, Mar 3, 2010 at 12:03 AM, Zsbán Ambrus <[email protected]> wrote:
> 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

Right, I knew I was tired last knight.  With a clearer head today I get this:

   +//."2 +//. 1 3 |: a */ b
20 20 0
10  2 2
 0  1 0
   +//."2 +//. a */"1"1 2 b
20 20 0
10  2 2
 0  1 0

where you might recognize the phrase (|: a */ b) or the equivalent (a
*/"1"1 2 b) from the recent mailing list thread about Kronecker
product of matrices.

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

Reply via email to