![]() |
Rosetta
2021.16
|
#include <DistributionSampler.hh>

Public Member Functions | |
| DistributionSampler (T &distribution) | |
| Creates a new instance that allows samples to be drawn randomly from <distribution> More... | |
| double | sample () |
| Returns a random value drawn from the distribution A general method to generate random numbers from an arbitrary distribution that has a cdf without jumps is to use the inverse function to the cdf: G(y)=F^{-1}(y). If u(1), ..., u(n) are random numbers from the uniform on (0,1) distribution then G(u(1)), ..., G(u(n)) is a random sample from the distribution with cdf F(x). More... | |
| const T & | distribution () const |
| Returns the distribution from which this sampler generates values. More... | |
Private Attributes | |
| T | distribution_ |
| Distribution from which to draw samples. More... | |
|
inlineexplicit |
Creates a new instance that allows samples to be drawn randomly from <distribution>
|
inline |
Returns the distribution from which this sampler generates values.
References numeric::random::DistributionSampler< T >::distribution_.
Referenced by numeric::random::DistributionSampler< T >::sample().
|
inline |
Returns a random value drawn from the distribution A general method to generate random numbers from an arbitrary distribution that has a cdf without jumps is to use the inverse function to the cdf: G(y)=F^{-1}(y). If u(1), ..., u(n) are random numbers from the uniform on (0,1) distribution then G(u(1)), ..., G(u(n)) is a random sample from the distribution with cdf F(x).
References numeric::random::DistributionSampler< T >::distribution(), and numeric::random::uniform().
|
private |
Distribution from which to draw samples.
Referenced by numeric::random::DistributionSampler< T >::distribution().
1.8.7