Rosetta 3.3
Classes | Namespaces | Functions
src/numeric/random/reservoir_sample.hh File Reference

Randomly select the best N elements from a stream of elements using one pass over a dataset. More...

#include <numeric/types.hh>
#include <numeric/random/random.hh>
#include <utility/vector1.hh>

Classes

class  numeric::random::ReservoirSampler< T >
 Simple container for keeping K random values. More...

Namespaces

namespace  numeric
 

A 1D histogram based upon a map structure.


namespace  numeric::random

Functions

numeric::Real numeric::random::reservoir_sample_accept_prob (numeric::Size n_wanted, numeric::Size const n_seen)
 Returns the probability that the Nth value in a sequence should be accepted using the reservoir sampling criterion.
template<typename T >
utility::vector1< T > numeric::random::reservoir_sample (utility::vector1< T > const &vec, numeric::Size const n_wanted, RandomGenerator &rg)

Detailed Description

Randomly select the best N elements from a stream of elements using one pass over a dataset.

Detailed:
Author:
James Thompson
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines