Rosetta
Public Member Functions | Private Attributes | List of all members
numeric::random::WeightedReservoirItem< T > Class Template Reference

#include <WeightedReservoirSampler.hh>

Public Member Functions

 WeightedReservoirItem (T item, double weight)
 Associates the given item with a real-valued weight. More...
 
T item () const
 Returns the item. More...
 
double weight () const
 Returns the weight. More...
 
bool operator< (WeightedReservoirItem< T > const &o) const
 Returns true if this item's weight is less than <o>'s weight. More...
 

Private Attributes

T item_
 the item More...
 
double weight_
 the item's weight More...
 

Constructor & Destructor Documentation

◆ WeightedReservoirItem()

template<typename T >
numeric::random::WeightedReservoirItem< T >::WeightedReservoirItem ( T  item,
double  weight 
)
inline

Associates the given item with a real-valued weight.

Member Function Documentation

◆ item()

template<typename T >
T numeric::random::WeightedReservoirItem< T >::item ( ) const
inline

◆ operator<()

template<typename T >
bool numeric::random::WeightedReservoirItem< T >::operator< ( WeightedReservoirItem< T > const &  o) const
inline

Returns true if this item's weight is less than <o>'s weight.

References basic::options::OptionKeys::out::file::o, and numeric::random::WeightedReservoirItem< T >::weight().

◆ weight()

template<typename T >
double numeric::random::WeightedReservoirItem< T >::weight ( ) const
inline

Member Data Documentation

◆ item_

template<typename T >
T numeric::random::WeightedReservoirItem< T >::item_
private

◆ weight_

template<typename T >
double numeric::random::WeightedReservoirItem< T >::weight_
private

The documentation for this class was generated from the following file: