Template Function ADS::reservoirSampling

Function Documentation

template<class T, class R>
std::vector<T> ADS::reservoirSampling(const std::vector<T> &S, std::size_t n, R &g)

n items from the sequence S, as if it were a stream of unknown length; all of S, in its order, when S has at most n items (a stream shorter than the sample)