reservoirSamplingCommand

Reservoir sampling on the input stream.

This routine selects the appropriate reservior sampling function and template instantiation to use based on the command line arguments.

Reservoir sampling is used when a fixed size sample is being pulled from an input stream. Weighted and unweighted sampling is supported. These routines also randomize the order of the selected lines. This is consistent with line order randomization of the entire input stream (handled by randomizeLinesCommand).

For unweighted sampling, there is a performance tradeoff choice between the two available implementations. See the reservoirSampling documentation for information. The threshold used here was chosen based on performance tests.

void
reservoirSamplingCommand
(
OutputRange
)
(,
auto ref OutputRange outputStream
)
if (
isOutputRange!(OutputRange, char)
)

Meta