Rosetta 3.3
Public Member Functions
numeric::random::ReservoirSampler< T > Class Template Reference

Simple container for keeping K random values. More...

#include <reservoir_sample.hh>

Collaboration diagram for numeric::random::ReservoirSampler< T >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ReservoirSampler (numeric::Size const wanted)
 ~ReservoirSampler ()
void add_value (T val)
numeric::Size n_vals () const
numeric::Size n_wanted () const
numeric::Size n_seen () const
utility::vector1< T > values () const

Detailed Description

template<typename T>
class numeric::random::ReservoirSampler< T >

Simple container for keeping K random values.

Detailed: Values are stochastically preserved so that the probability of
any value existing is always 1 / N, where N is the number of values seen.

Constructor & Destructor Documentation

template<typename T >
numeric::random::ReservoirSampler< T >::ReservoirSampler ( numeric::Size const  wanted) [inline]
template<typename T >
numeric::random::ReservoirSampler< T >::~ReservoirSampler ( ) [inline]

Member Function Documentation

template<typename T >
void numeric::random::ReservoirSampler< T >::add_value ( val) [inline]
template<typename T >
numeric::Size numeric::random::ReservoirSampler< T >::n_seen ( ) const [inline]
template<typename T >
numeric::Size numeric::random::ReservoirSampler< T >::n_vals ( ) const [inline]
template<typename T >
numeric::Size numeric::random::ReservoirSampler< T >::n_wanted ( ) const [inline]
template<typename T >
utility::vector1< T > numeric::random::ReservoirSampler< T >::values ( ) const [inline]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines