Random number generator.
More...
#include <lin/generators/randoms.hpp>
|
unsigned long long | seed |
| Seed for the random number generator.
|
|
double | cached_rand |
| Value of a cached standard normal gassauisan random.
|
|
bool | has_cached |
| has_cached is true if there's a cached standard normal available.
|
|
Random number generator.
Produces random values in the range zero to one. It's used by the rands generator function.
constexpr lin::internal::RandomsGenerator::RandomsGenerator |
( |
unsigned long long |
seed = 0 | ) |
|
|
inline |
Creates a random number generator based on the specified seed.
- Parameters
-
constexpr double lin::internal::RandomsGenerator::rand |
( |
| ) |
|
|
inline |
Generates a uniform random number in the range zero to one.
- Returns
- Random number between zero and one.
constexpr double lin::internal::RandomsGenerator::gaussian |
( |
| ) |
|
|
inline |
Return a gaussian random number with mean 0 and std 1. Uses Box-Mueller transform with caching.
- Returns
- constexpr double
The documentation for this class was generated from the following file: