Template Function ADS::sampleBySkips

Function Documentation

template<class R>
std::vector<std::size_t> ADS::sampleBySkips(std::size_t n, std::size_t N, R &g, std::size_t *randoms = nullptr)

n of the positions 0 , … , N - 1, sorted, by the gaps of Vitter’s Algorithm D (A when n > N / 13); the random numbers drawn go to *randoms, if given

Pre:

n <= N

Post:

n distinct positions below N, sorted (an audit)