![]() |
Rosetta
2015.31
|
#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... | |
WeightedSampler & | operator= (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::Real > | weights_ |
utility::vector1< numeric::Real > | cumulative_distribution_ |
bool | cumulative_distribution_valid_ |
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.
|
virtual |
Destructor.
numeric::random::WeightedSampler::WeightedSampler | ( | WeightedSampler const & | weighted_sampler | ) |
Copy constructor.
|
inline |
References cumulative_distribution_valid_, and weights_.
|
inline |
References cumulative_distribution_valid_, and weights_.
WeightedSampler & numeric::random::WeightedSampler::operator= | ( | WeightedSampler const & | weighted_sampler | ) |
Copy operator.
References cumulative_distribution_, cumulative_distribution_valid_, and weights_.
numeric::Size numeric::random::WeightedSampler::random_sample | ( | numeric::Real | randnum | ) | const |
References cumulative_distribution_, cumulative_distribution_valid_, color_pdb::i, and update_cumulative_distribution().
Referenced by random_sample().
numeric::Size numeric::random::WeightedSampler::random_sample | ( | numeric::random::RandomGenerator & | rg | ) | const |
References random_sample(), and numeric::random::RandomGenerator::uniform().
|
inline |
References weights_.
|
inline |
|
inline |
References weights_.
void numeric::random::WeightedSampler::update_cumulative_distribution | ( | ) | const |
References cumulative_distribution_, cumulative_distribution_valid_, color_pdb::i, runtime_assert, and weights_.
Referenced by random_sample().
|
inline |
|
inline |
References cumulative_distribution_valid_, weights(), and weights_.
|
mutableprivate |
Referenced by operator=(), random_sample(), and update_cumulative_distribution().
|
mutableprivate |
Referenced by add_weight(), clear(), operator=(), random_sample(), set_weight(), update_cumulative_distribution(), and weights().
|
private |
Referenced by add_weight(), clear(), operator=(), resize(), set_weight(), size(), update_cumulative_distribution(), and weights().