Skip to content

Commit

Permalink
It was being used in tests too
Browse files Browse the repository at this point in the history
  • Loading branch information
ararslan committed Jul 13, 2016
1 parent cea0c01 commit 3983e56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 1 addition & 7 deletions test/sampling.jl
Expand Up @@ -47,7 +47,7 @@ function check_sample_wrep(a::AbstractArray, vrgn, ptol::Real; ordered::Bool=fal
end
end

import StatsBase: direct_sample!, xmultinom_sample!
import StatsBase: direct_sample!

a = direct_sample!(1:10, zeros(Int, n, 3))
check_sample_wrep(a, (1, 10), 5.0e-3; ordered=false)
Expand All @@ -58,12 +58,6 @@ check_sample_wrep(a, (3, 12), 5.0e-3; ordered=false)
a = direct_sample!([11:20;], zeros(Int, n, 3))
check_sample_wrep(a, (11, 20), 5.0e-3; ordered=false)

a = xmultinom_sample!(3:12, zeros(Int, n))
check_sample_wrep(a, (3, 12), 5.0e-3; ordered=true)

a = xmultinom_sample!(101:200, zeros(Int, 10))
check_sample_wrep(a, (101, 200), 0; ordered=true)

a = sample(3:12, n)
check_sample_wrep(a, (3, 12), 5.0e-3; ordered=false)

Expand Down
5 changes: 1 addition & 4 deletions test/wsampling.jl
Expand Up @@ -32,7 +32,7 @@ function check_wsample_wrep(a::AbstractArray, vrgn, wv::WeightVec, ptol::Real; o
end
end

import StatsBase: direct_sample!, alias_sample!, xmultinom_sample!
import StatsBase: direct_sample!, alias_sample!

n = 10^5
wv = weights([0.2, 0.8, 0.4, 0.6])
Expand All @@ -43,9 +43,6 @@ check_wsample_wrep(a, (4, 7), wv, 5.0e-3; ordered=false)
a = alias_sample!(4:7, wv, zeros(Int, n, 3))
check_wsample_wrep(a, (4, 7), wv, 5.0e-3; ordered=false)

a = xmultinom_sample!(4:7, wv, zeros(Int, n))
check_wsample_wrep(a, (4, 7), wv, 5.0e-3; ordered=true)

a = sample(4:7, wv, n; ordered=false)
check_wsample_wrep(a, (4, 7), wv, 5.0e-3; ordered=false)

Expand Down

0 comments on commit 3983e56

Please sign in to comment.