Skip to content

Instantly share code, notes, and snippets.

@w01fe
Last active December 19, 2015 13:40
Show Gist options
  • Save w01fe/5963999 to your computer and use it in GitHub Desktop.
Save w01fe/5963999 to your computer and use it in GitHub Desktop.
hiphip_add_in_place.clj
(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