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
;; Written to answer https://stackoverflow.com/questions/47254742/sort-primitive-array-with-custom-comparator-on-clojure | |
;; See https://gist.github.com/michalmarczyk/11bbfd0b19b6357f533b192bf9da84ac for the single-threaded version | |
(defn order3 [xs] | |
(let [rnd (java.util.Random.) | |
a1 (double-array xs) | |
a2 (long-array (alength a1))] | |
(dotimes [i (alength a2)] | |
(aset a2 i i)) | |
(letfn [(quicksort [^long l ^long h] |
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
(alembic/distill '[org.clojure/data.avl "0.0.17"]) | |
(alembic/distill '[net.cgrand/xforms "0.12.1"]) | |
(require '[clojure.data.avl :as avl] | |
'[net.cgrand.xforms :as x]) | |
(defn join [keyfn xforms-map] | |
(comp | |
(x/multiplex xforms-map) |
OlderNewer