Rosetta Utilities  2014.35
Public Member Functions | Private Attributes | List of all members
numeric::random::WeightedSampler Class Reference

#include <WeightedSampler.hh>

Public Member Functions

 WeightedSampler ()
 Constructor. More...
 
 WeightedSampler (numeric::Size num_weights)
 Constructor. More...
 
 WeightedSampler (utility::vector1< numeric::Real > const &weights)
 Constructor. More...
 
virtual ~WeightedSampler ()
 Destructor. More...
 
 WeightedSampler (WeightedSampler const &)
 Copy constructor. More...
 
WeightedSampleroperator= (WeightedSampler const &)
 Copy operator. More...
 
utility::vector1
< numeric::Real > const & 
weights () const
 
void weights (utility::vector1< numeric::Real > const &weights)
 
void add_weight (numeric::Real weight)
 
void set_weight (numeric::Size weight_num, numeric::Real weight)
 
void clear ()
 
numeric::Size size () const
 
void resize (numeric::Size num_weights, numeric::Real default_weight=0)
 
numeric::Size random_sample (numeric::Real randnum) const
 
numeric::Size random_sample (numeric::random::RandomGenerator &) const
 
void update_cumulative_distribution () const
 

Private Attributes

utility::vector1< numeric::Realweights_
 
utility::vector1< numeric::Realcumulative_distribution_
 
bool cumulative_distribution_valid_
 

Constructor & Destructor Documentation

numeric::random::WeightedSampler::WeightedSampler ( )

Constructor.

numeric::random::WeightedSampler::WeightedSampler ( numeric::Size  num_weights)

Constructor.

numeric::random::WeightedSampler::WeightedSampler ( utility::vector1< numeric::Real > const &  weights)

Constructor.

numeric::random::WeightedSampler::~WeightedSampler ( )
virtual

Destructor.

numeric::random::WeightedSampler::WeightedSampler ( WeightedSampler const &  weighted_sampler)

Copy constructor.

Member Function Documentation

void numeric::random::WeightedSampler::add_weight ( numeric::Real  weight)
inline
void numeric::random::WeightedSampler::clear ( )
inline
WeightedSampler & numeric::random::WeightedSampler::operator= ( WeightedSampler const &  weighted_sampler)
numeric::Size numeric::random::WeightedSampler::random_sample ( numeric::Real  randnum) const
numeric::Size numeric::random::WeightedSampler::random_sample ( numeric::random::RandomGenerator rg) const
void numeric::random::WeightedSampler::resize ( numeric::Size  num_weights,
numeric::Real  default_weight = 0 
)
inline

References weights_.

void numeric::random::WeightedSampler::set_weight ( numeric::Size  weight_num,
numeric::Real  weight 
)
inline
numeric::Size numeric::random::WeightedSampler::size ( ) const
inline

References weights_.

void numeric::random::WeightedSampler::update_cumulative_distribution ( ) const
utility::vector1<numeric::Real> const& numeric::random::WeightedSampler::weights ( ) const
inline

References weights_.

Referenced by weights().

void numeric::random::WeightedSampler::weights ( utility::vector1< numeric::Real > const &  weights)
inline

Member Data Documentation

utility::vector1<numeric::Real> numeric::random::WeightedSampler::cumulative_distribution_
mutableprivate
bool numeric::random::WeightedSampler::cumulative_distribution_valid_
mutableprivate
utility::vector1<numeric::Real> numeric::random::WeightedSampler::weights_
private

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