|
Celeritas 0.7+981ab2d
|
Sample from a truncated distribution. More...
#include <TruncatedDistribution.hh>
Public Types | |
Type aliases | |
| using | real_type = typename Distribution::real_type |
| using | result_type = typename Distribution::result_type |
| using | RecordT = TruncatedDistributionRecord< typename Distribution::RecordT > |
Public Member Functions | |
| template<class... Args> | |
| TruncatedDistribution (real_type lower, real_type upper, Args &&... args) | |
| Construct with distribution and truncation bounds. | |
| TruncatedDistribution (RecordT const &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. | |
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.