September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -8,7 +8,13 @@
(map #(apply * %))
(reduce +)))
(defn dot-product3
"Dot product of vectors. Tested on version 1.8.0."
[v1 v2]
{:pre [(= (count v1) (count v2))]}
(reduce + (map * v1 v2)))
;Example Usage
(println (dot-product [1 3 -5] [4 -2 -1]))
(println (dot-product2 [1 3 -5] [4 -2 -1]))
(println (dot-product3 [1 3 -5] [4 -2 -1]))