Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 38 lines (33 sloc) 1.297 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
(ns cl.parti.analysis-test
  (:use (cl.parti analysis diagonal output utils))
  (:use clojure.test)
  (:use clojure.java.io))

(def do-lower
  (partial dump-lower normalize-histogram no-pre-editor rectangle
    (print-tick 100)))

(deftest test-lower
  (dopar [n (range 15 4 -1)]
    (time (do-lower "/home/andrew/project/particl/data/dump" n "a" 10000000))))

;(defn top
; [in out n infix bits n-samples shutdown]
; (let [tick (print-tick 1000)
; best (nearest-in-dump tick in n bits n-samples shutdown 1)]
; (with-open [w (writer out)]
; (doseq [[[a b] m] (take 1000 best)]
; (let [a (str n infix a)
; b (str n infix b)
; diff
; (pair-difference normalize-histogram no-pre-editor rectangle
; infix n a b)]
; (.write w (str a " " b " " m " " diff "\n")))))))
;
;(deftest test-top
; (doseq [n (range 5 16 5)]
; (let [in (str "/home/andrew/project/particl/data/dump-" n "-a.dmp")
; n-bits (cond (> n 8) 2 (> n 6) 3 :else 4)
; n-samples (min 20 (+ 3 (int (/ (* 20 n n) 100))))
; out (str "/home/andrew/project/particl/data/dump-" n "-a-" n-bits "-" n-samples ".best")
; rpt (if (= n 5) 5 20)]
; (time
; (top in out n "a" n-bits n-samples rpt)))))

(run-tests)
Something went wrong with that request. Please try again.