Just another update

This commit is contained in:
Ingy döt Net 2015-02-20 00:35:01 -05:00
parent a25938f123
commit 00a190b0a6
6591 changed files with 94363 additions and 23227 deletions

View file

@ -2,5 +2,13 @@
{:pre [(apply == (map count matrix))]}
(apply + (apply map * matrix)))
(defn dot-product2 [x y]
(->> (interleave x y)
(partition 2 2)
(map #(apply * %))
(reduce +)))
;Example Usage
(println (dot-product [1 3 -5] [4 -2 -1]))
(println (dot-product2 [1 3 -5] [4 -2 -1]))