Last active
December 19, 2015 13:40
-
-
Save w01fe/5963999 to your computer and use it in GitHub Desktop.
hiphip_add_in_place.clj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn add-in-place! | |
"Modify xs, incrementing each element by the corresponding element of ys" | |
[xs ys] | |
(dbl/afill! [x xs y ys] (+ x y))) | |
(defn pointwise-product | |
"Produce a new double array with the product of corresponding elements of xs and ys" | |
[xs ys] | |
(dbl/amap [x xs y ys] (* x y))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment