What I did was translate your 

C_ijlmnop = sum_k A_ijkl * B_mknop

in J-terms. If that's not what you want, then your specs are imprecise.

Perhaps what you want to do (with thanks to Lochbaum), is

(('ijkl i. ijlk')|: A_ijkl ) (+/ . *) ('mknop i. kmnop')|: B_mknop

which is what Rich calculated.
This cannot be derived (in an easy way) from the outer product A_ijkl * B_mknop.
I would love to know how you would specify sum_k A_ijkl * B_mknop


R.E. Boss


> -----Oorspronkelijk bericht-----
> Van: Programming <[email protected]>
> Namens Rudolf Sykora
> Verzonden: vrijdag 7 februari 2020 15:43
> Aan: [email protected]
> Onderwerp: Re: [Jprogramming] multiply two multidimensional matrices
> 
> 
> R.E. Boss <[email protected]> writes:
> 
> >     a =. i. 2 3 4 5
> >     b =. i. 2 4 3 5 6
> >    $a *"0 _ b
> > 2 3 4 5 2 4 3 5 6
> >    $+/"6 +/"4 a *"0 _ b
> > 2 3 5 2 3 5 6
> 
> This is an interesting take on the subject.
> 
> 
> If I understand, the first part does an outer product, P,
> 
> P_ijklmnopq = A_ijkl * B_mnopq .
> 
> And I believe it does it right.
> 
> 
> However, what I now want to do is
> 
> C_ijlmopq = sum_k  P_ijklmkopq
> 
> while, it seems to me, you do something different, something like
> 
> D_ijlmnpq = sum_kn P_ijklmnopq,
> 
> which is not what is wanted.
> 
> In any case, the result of yours and of Henry Rich's, although having the same
> shape, differ. At this moment I think the latter is the right one, but I am 
> not
> quite sure, yet.
> 
> 
> Thanks for trying!
> Ruda
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to