Skip to content

Commit

Permalink
Update IteratorSampling.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar committed Jan 13, 2024
1 parent 0d67e03 commit 34145be
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/IteratorSampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export itsample

"""
reservoir_sample(rng, iter)
reservoir_sample(rng, iter, n, replace, ordered)
reservoir_sample(rng, iter, n; replace = false, ordered = false)
Reservoir sampling algorithm with and without replacement.
Expand All @@ -61,11 +61,11 @@ export reservoir_sample

"""
sortedindices_sample(rng, iter)
sortedindices_sample(rng, iter, n, replace, ordered)
sortedindices_sample(rng, iter, n; replace = false, ordered = false)
Faster algorithm than reservoir sampling employed when the number of elements
in the iterable is known. It generates sorted random indices which are used to
retrieve the sample from the iterable.
Algorithm which generates sorted random indices used to retrieve the sample
from the iterable. The number of elements in the iterable needs to be known
before starting the sampling.
"""
function sortedindices_sample end

Expand Down

0 comments on commit 34145be

Please sign in to comment.