Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -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]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue