Matrix multiplication: Difference between revisions
Content added Content deleted
PatGarrett (talk | contribs) m (→{{header|360 Assembly}}: Superfluous blanks suppressed) |
m (→{{header|J}}) |
||
Line 1,824:
The general inner product extends to multidimensional arrays, requiring only that <tt> x </tt>and<tt> y </tt> be conformable (trailing dimension of array <tt>x</tt> equals the leading dimension of array <tt>y</tt>). For example, the matrix multiplication of two dimensional arrays requires <tt>x</tt> to have the same numbers of rows as <tt>y</tt> has columns, as you would expect.
Note also that <code>mp=: +/@:*"1 _</code> functions identically.
Perhaps it would have made more sense to define something more like <code>dot=: conjunction def 'u/@:v"1 _'</code> so that matrix multiplication would be <code>+dot*</code> -- this would also correspond to the original APL implementation.
=={{header|Java}}==
|