Documentation
¶
Overview ¶
Package simple implements an unweighted reservoir sampling algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Simple ¶
type Simple struct {
// contains filtered or unexported fields
}
Simple implements unweighted reservoir sampling using Algorithm R from "Random sampling with a reservoir" by Jeffrey Vitter (1985) https://en.wikipedia.org/wiki/Reservoir_sampling#Algorithm_R
func New ¶
New returns a simple reservoir sampler with given capacity (i.e., reservoir size) and random number generator.
Click to show internal directories.
Click to hide internal directories.