It is perhaps instructive to see where the conformability comes from in the case of x +/ . * y (where neither x nor y is scalar).
x +/ .* y x +/@(*"(1+0 _)) y NB. by definition x +/@(*"1 _) y So basically the phrase takes vectors (rank 1 cells) of x against y _in toto_. When you have xv * y prefix agreement requires that the length of xv matches the length of the leading dimension of y . The length of xv is the length of the trailing dimension of x . This definition of inner product has several advantages over the traditional "row-by-column" definition, as described in the webpage I cited before. ----- Original Message ----- From: Devon McCormick <[email protected]> Date: Monday, February 22, 2010 7:56 Subject: Re: [Jprogramming] Generalized Matrix Multiplication To: Programming forum <[email protected]> > I see my comment about conformability was too specific to matrix > multiplication. I see from Roger's comment that we should > consider the more > general case for what constitutes conformability. I'll > have to think of a > more practical example, but here's one for conformability that > does not > require the inner dimensions to match: > > (i.3 4) +/ . ,/ i.5 5 > 62 70 78 86 70 > > On Mon, Feb 22, 2010 at 10:42 AM, Roger Hui <[email protected]> > wrote: > > ... > > For general u . v the conformability requirements depend > > on the left rank of v and the shape of the result depend > > on the shapes of results produced by u and v , as > > the definition u . v <-> u@(v"(1+lv,_)) would indicate. > > ... ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
