mirror of
https://github.com/penpot/penpot.git
synced 2025-12-12 06:24:17 +01:00
Adapt bench/dev code to interval tree api changes.
This commit is contained in:
@@ -81,33 +81,33 @@
|
|||||||
|
|
||||||
(defn test-interval
|
(defn test-interval
|
||||||
[]
|
[]
|
||||||
(let [tree (doto (it/create)
|
(let [tree (it/create)]
|
||||||
(.add #js [1 5])
|
(it/add tree #js [1 5])
|
||||||
(.add #js [5 7])
|
(it/add tree #js [5 7])
|
||||||
(.add #js [-4 -1])
|
(it/add tree #js [-4 -1])
|
||||||
(.add #js [-10 -3])
|
(it/add tree #js [-10 -3])
|
||||||
(.add #js [-20 -10])
|
(it/add tree #js [-20 -10])
|
||||||
(.add #js [20 30])
|
(it/add tree #js [20 30])
|
||||||
(.add #js [3 9])
|
(it/add tree #js [3 9])
|
||||||
(.add #js [100 200])
|
(it/add tree #js [100 200])
|
||||||
(.add #js [1000 2000])
|
(it/add tree #js [1000 2000])
|
||||||
(.add #js [6 9])
|
(it/add tree #js [6 9])
|
||||||
)]
|
|
||||||
(js/console.dir tree #js {"depth" nil})
|
(js/console.dir tree #js {"depth" nil})
|
||||||
(js/console.log "contains", 4, (.contains tree 4))
|
(js/console.log "contains", 4, (it/contains tree 4))
|
||||||
(js/console.log "contains", 0, (.contains tree 0))
|
(js/console.log "contains", 0, (it/contains tree 0))
|
||||||
))
|
))
|
||||||
|
|
||||||
(defn main
|
(defn main
|
||||||
[& [type]]
|
[& [type]]
|
||||||
(cond
|
(cond
|
||||||
(= type "init")
|
(= type "kd-init")
|
||||||
(bench-init)
|
(bench-init)
|
||||||
|
|
||||||
(= type "knn")
|
(= type "kd-search")
|
||||||
(bench-knn)
|
(bench-knn)
|
||||||
|
|
||||||
(= type "test")
|
(= type "kd-test")
|
||||||
(test-accuracity)
|
(test-accuracity)
|
||||||
|
|
||||||
(= type "interval")
|
(= type "interval")
|
||||||
|
|||||||
Reference in New Issue
Block a user