Matrix multiplication: Difference between revisions

Content added Content deleted
m (→‎JS ES6: Tidied)
(→‎JS ES6: Added a comment to the dotProduct function.)
Line 3,804: Line 3,804:
// dotProduct :: Num a => [[a]] -> [[a]] -> [[a]]
// dotProduct :: Num a => [[a]] -> [[a]] -> [[a]]
const dotProduct = xs =>
const dotProduct = xs =>
// Sum of the products of the corresponding
// values in two lists of the same length.
compose(sum, zipWith(mul)(xs));
compose(sum, zipWith(mul)(xs));