|
template<typename TRng , typename... TArgs> |
AutoPtr< RngWrapper< TRng > > | makeRng (TArgs &&... args) |
|
template<typename TRng > |
INLINE Float | sampleNormalDistribution (TRng &rng, const Float mu, const Float sigma) |
| Generates a random number from normal distribution, using Box-Muller algorithm. More...
|
|
template<typename TRng > |
INLINE Float | sampleExponentialDistribution (TRng &rng, const Float lambda) |
| Generates a random number from exponential distribution. More...
|
|
template<typename TRng > |
INLINE Size | samplePoissonDistribution (TRng &rng, const Float lambda) |
| Generates a random integer from Poisson distribution. More...
|
|
template<typename TRng > |
INLINE Vector | sampleUnitSphere (TRng &rng) |
| Generates a random position on a unit sphere. More...
|
|
template<typename TRng , typename TFunc > |
INLINE Float | sampleDistribution (TRng &rng, const Interval &range, const Float upperBound, const TFunc &func) |
| Generates a random number from a generic distribution, using rejection sampling. More...
|
|
template<typename TRng , typename TFunc > |
INLINE Vector | sampleDistribution (TRng &rng, const Box &box, const Float upperBound, const TFunc &func) |
| Generates a random vector from a generic distribution, using rejection sampling. More...
|
|
Random number generators.
- Author
- Pavel Sevecek (sevecek at sirrah.troja.mff.cuni.cz)
- Date
- 2016-2021
Definition in file Rng.h.
template<typename TRng , typename TFunc >
Generates a random number from a generic distribution, using rejection sampling.
Note that this function may be very inefficient and should be used only if the distribution cannot be sampled with an explicit method.
- Parameters
-
rng | Random number generator |
range | Minimal and maximal generated value |
upperBound | Upper bound for the values returned by the functor |
func | Probability distribution function. Does not have to be normalized. |
Definition at line 184 of file Rng.h.