![]() |
Rosetta
3.7
|
Randomly select the best N elements from a stream of elements using one pass over a dataset. More...
Classes | |
class | numeric::random::ReservoirSampler< T > |
Simple container for keeping K random values. More... | |
Namespaces | |
numeric | |
Unit headers. | |
numeric::random | |
Functions | |
numeric::Real | numeric::random::reservoir_sample_accept_prob (numeric::Size n_wanted, numeric::Size n_seen) |
Returns the probability that the Nth value in a sequence should be accepted using the reservoir sampling criterion. More... | |
template<typename T > | |
utility::vector1< T > | numeric::random::reservoir_sample (utility::vector1< T > const &vec, numeric::Size n_wanted, RandomGenerator &rg=numeric::random::rg()) |
Randomly select the best N elements from a stream of elements using one pass over a dataset.