Jump to content

Matrix multiplication: Difference between revisions

Updated second D entry
m (→‎{{header|Ruby}}: shortened one line of code)
(Updated second D entry)
Line 952:
<lang d>import std.stdio, std.range, std.array, std.numeric, std.algorithm;
 
T[][] matMul(T)(in T[][] A, in T[][] B) /*pure nothrow*/ nothrow {
const Bt = B[0].length.iota.map!(i=> B.transversal(i).array).array;
return A.map!(a => Bt.map!(b => a.dotProduct(b)).array).array;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.