Implementation detail for a sample algorithm. More...
#include <sample.hpp>
Protected Member Functions | |
template<class Distribution , class URNG > | |
constexpr auto | sample_from_distribution (Distribution distribution, URNG &engine) const |
Sample from random distributions. More... | |
template<class Range , class URNG > | |
constexpr auto | sample_from_range (Range &&range, URNG &engine) const |
Sample from any range. More... | |
template<class Range , class Weights , class URNG > | |
constexpr auto | sample_from_range (Range &&range, Weights &&weights, URNG &engine) const |
Sample from weighted ranges. More... | |
Implementation detail for a sample algorithm.
Definition at line 124 of file sample.hpp.
|
inlineconstexprprotected |
Sample from random distributions.
Definition at line 163 of file sample.hpp.
|
inlineconstexprprotected |
Sample from any range.
If the input range is a particle range, it will extract the weights and treat it as a weighted range. The new particles will all have a weight equal to 1, since, after resampling, the probability will be represented by the number of particles rather than their individual weight.
If the input range is not a particle range, it will assume a uniform distribution.
Definition at line 147 of file sample.hpp.
|
inlineconstexprprotected |
Sample from weighted ranges.
Definition at line 128 of file sample.hpp.