Skip to content

Commit

Permalink
Improve api by passing more keywords items
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar committed Jan 13, 2024
1 parent 631a66d commit 0d67e03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/UnweightedSamplingMulti.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function itsample(rng::AbstractRNG, iter, n::Int;
if Base.IteratorSize(iter) isa Base.SizeUnknown
reservoir_sample(rng, iter, n; replace, ordered)::Vector{iter_type}
else
sortedindices_sample(rng, iter, n, replace, ordered)::Vector{iter_type}
sortedindices_sample(rng, iter, n; replace, ordered)::Vector{iter_type}
end
end

Expand Down Expand Up @@ -118,7 +118,7 @@ function choose(n, p, q, z)
return quantile(b, q)
end

function sortedindices_sample(rng, iter, n::Int, replace, ordered)
function sortedindices_sample(rng, iter, n::Int; replace = false, ordered = false)
N = length(iter)
if N <= n
reservoir = collect(iter)
Expand Down

0 comments on commit 0d67e03

Please sign in to comment.