From 34145bef84f8ba64e95e09eb6892558cc05ef78b Mon Sep 17 00:00:00 2001 From: Tortar <68152031+Tortar@users.noreply.github.com> Date: Sat, 13 Jan 2024 18:29:29 +0100 Subject: [PATCH] Update IteratorSampling.jl --- src/IteratorSampling.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/IteratorSampling.jl b/src/IteratorSampling.jl index d47695d..2b7928d 100644 --- a/src/IteratorSampling.jl +++ b/src/IteratorSampling.jl @@ -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. @@ -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