Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
aplavin authored Feb 15, 2024
1 parent c1355a8 commit 8105d72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ function alias_sample!(rng::AbstractRNG, a::AbstractArray, wv::AbstractWeights,
# create alias table
ap = Vector{Float64}(undef, n)
alias = Vector{Int}(undef, n)
make_alias_table!(wv, s, ap, alias)
make_alias_table!(wv, wsum, ap, alias)

# sampling
s = Sampler(rng, 1:n)
Expand Down Expand Up @@ -757,7 +757,7 @@ function naive_wsample_norep!(rng::AbstractRNG, a::AbstractArray,
1 == firstindex(a) == firstindex(wv) == firstindex(x) ||
throw(ArgumentError("non 1-based arrays are not supported"))
wsum = sum(wv)
isfinite(s) || throw(ArgumentError("only finite weights are supported"))
isfinite(wsum) || throw(ArgumentError("only finite weights are supported"))
n = length(a)
length(wv) == n || throw(DimensionMismatch("Inconsistent lengths."))
k = length(x)
Expand Down

0 comments on commit 8105d72

Please sign in to comment.