September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -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]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue