Skip to content
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.

Commit

Permalink
Update constructor in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC committed May 8, 2015
1 parent 61982b4 commit 175fbcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions test/test_inball.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ for rn in [true, false]
0.0 0.0 1.0 1.0 0.0 0.0 1.0 1.0;
0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0] # 8 node cube

tree = KDTree(data, 2, rn)
tree = KDTree(data, leafsize = 2, reorder = rn)

idxs = inball(tree, [1.1, 1.1, 1.1], 0.2)
@fact idxs => [8] # Only corner 8 at least 0.2 distance away from [1.1, 1.1, 1.1]
Expand Down Expand Up @@ -37,8 +37,8 @@ context("KDTrees.inball.tree") do
0.0 0.0 1.0 1.0 0.0 0.0 1.0 1.0;
0.0 1.0 0.0 1.0 0.0 1.0 0.0 1.0] # 8 node cube

tree1 = KDTree(data, 2, false)
tree2 = KDTree([[0.0, 0.0, 0.5] [0.0, 0.0, 0.0]], 1, false)
tree1 = KDTree(data, leafsize = 2, reorder = false)
tree2 = KDTree([[0.0, 0.0, 0.5] [0.0, 0.0, 0.0]], leafsize = 1, reorder = false)

idxs = inball(tree1, tree2, 0.6)
@fact allin(idxs[1], [1, 2]) => true
Expand Down
8 changes: 4 additions & 4 deletions test/test_monkey.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ size_data = 1000
data = rand(dim_data, size_data)

for j = 1:15
tree = KDTree(data, rand(1:15), rand(Bool))
tree = KDTree(data, leafsize = rand(1:15), reorder = rand(Bool))
n = rand(1:size_data)
idx, dist = knn(tree, data[:,n], rand(1:30))
@fact issorted(dist) => true
Expand All @@ -39,7 +39,7 @@ for i in 1:10
dim_data = rand(1:5)
size_data = rand(100:151)
data = rand(dim_data, size_data)
tree = KDTree(data, rand(1:10))
tree = KDTree(data, leafsize = rand(1:10))
p = rand(dim_data)

# Brute force
Expand Down Expand Up @@ -68,7 +68,7 @@ for rn in [true, false]
dim_data = rand(1:6)
size_data = rand(20:250)
data = rand(dim_data, size_data)
tree = KDTree(data, 3, rn)
tree = KDTree(data, leafsize = 3, reorder = rn)
p = zeros(dim_data)
r = 0.3
# Brute force
Expand Down Expand Up @@ -97,7 +97,7 @@ for rn in [true, false]
dim_data = rand(1:5)
size_data = rand(100:1000)
data = randn(dim_data, size_data)
tree = KDTree(data, rand(1:10), rn)
tree = KDTree(data, leafsize = rand(1:10), reorder = rn)

point = [randn() for x in 1:dim_data]
idxs_ball = []
Expand Down

0 comments on commit 175fbcb

Please sign in to comment.