Skip to content

Instantly share code, notes, and snippets.

@simonholgate
Forked from blcooley/gist:1629970
Created January 19, 2012 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonholgate/1639317 to your computer and use it in GitHub Desktop.
Save simonholgate/1639317 to your computer and use it in GitHub Desktop.
(ns testincanter.core
(:import (cern.colt.matrix.tdouble DoubleFactory2D DoubleMatrix2D)
(cern.jet.random.tdouble.engine DRand)
(cern.jet.math.tdouble DoubleFunctions)
(java.util Date)))
(defn test-multi [n]
(let [xs (.assign (.make DoubleFactory2D/dense n 23) (DRand. (Date.)))]
(time (let [result (.zMult xs xs nil 1 0 true false)]
[(.columns result) (.rows result)]))))
;; user> (test-multi 10000)
;; "Elapsed time: 7.377 msecs"
;; [23 23]
;; user> (test-multi 100000)
;; "Elapsed time: 240.411 msecs"
;; [23 23]
;; user> (test-multi 1000000)
;; "Elapsed time: 3871.375 msecs"
;; [23 23]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment