|
Celeritas 0.7+ef734374e
|
Sample from a truncated distribution. More...
#include <TruncatedDistribution.hh>
Public Types | |
Type aliases | |
| using | result_type = typename Distribution::result_type |
| using | RecordT = TruncatedDistributionRecord< typename Distribution::RecordT > |
Public Member Functions | |
| template<class T , class U , class... Args> | |
| TruncatedDistribution (T lower, U upper, Args &&... args) | |
| Construct with distribution and truncation bounds. | |
| TruncatedDistribution (RecordT const &record) | |
| Construct from a device-friendly variant record. | |
| template<class Generator > | |
| result_type | operator() (Generator &rng) |
| template<class Generator > | |
| auto | operator() (Generator &rng) -> result_type |
| Sample a random number according to the truncated distribution. | |
Static Public Attributes | |
| static constexpr int | max_debug_samples = 32 |
| Assert fewer than this number of samples is tried when CELERITAS_DEBUG. | |
Sample from a truncated distribution.
Sample from an arbitrary distribution truncated to a finite interval. Values are drawn from the underlying distribution using rejection sampling until they fall within the truncation bounds.
test::HistogramSampler to verify the number of samples being taken.