|
template<typename T = uint64_t, typename S = uint64_t> |
| pcg32_index (T initstate=0x853c49e6748fea9bULL, S initseq=0xda3e39cb94b95bdbULL, bool delta=false) |
|
uint64_t | state_at (ptrdiff_t index) |
| State at a specific index of the sequence.
|
|
void | jump_to (ptrdiff_t index) |
| Move to a certain index.
|
|
void | drawn (ptrdiff_t n) |
| Update the generator index with the number of items you have drawn.
|
|
void | set_delta (bool delta) |
| Signal if the generator is uniquely used to draw a delta distribution.
|
|
ptrdiff_t | index () const |
| Get the generator index.
|
|
void | set_index (ptrdiff_t index) |
| Overwrite the generator index.
|
|
template<typename T = uint64_t, typename S = uint64_t> |
| pcg32 (T initstate=0x853c49e6748fea9bULL, S initseq=0xda3e39cb94b95bdbULL) |
| Constructor.
|
|
void | seed (uint64_t initstate=0x853c49e6748fea9bULL, uint64_t initseq=0xda3e39cb94b95bdbULL) |
| Seed the generator (constructor alias).
|
|
uint32_t | operator() () |
| Draw new random number (uniformly distributed, 0 <= r <= max(uint32_t) ).
|
|
uint32_t | next_uint32 () |
| Draw new random number (uniformly distributed, 0 <= r <= max(uint32_t) ).
|
|
uint32_t | next_uint32 (uint32_t bound) |
| Draw new random number (uniformly distributed, 0 <= r <= bound ).
|
|
float | next_float () |
| Generate a single precision floating point value on the interval [0, 1).
|
|
double | next_double () |
| Generate a double precision floating point value on the interval [0, 1).
|
|
double | next_positive_double () |
| Generate a double precision floating point value on the interval (0, 1).
|
|
uint64_t | state () const |
| The current "state" of the generator.
|
|
template<typename R > |
R | state () |
| The current "state" of the generator.
|
|
uint64_t | initstate () const |
| The state initiator that was used upon construction.
|
|
template<typename R > |
R | initstate () const |
| The state initiator that was used upon construction.
|
|
uint64_t | initseq () const |
| The sequence initiator that was used upon construction.
|
|
template<typename R > |
R | initseq () const |
| The sequence initiator that was used upon construction.
|
|
template<typename T > |
void | restore (T state) |
| Restore a given state in the sequence.
|
|
int64_t | operator- (const pcg32 &other) const |
| The distance between two PCG32 pseudorandom number generators.
|
|
template<typename R = int64_t> |
R | distance (const pcg32 &other) const |
| The distance between two PCG32 pseudorandom number generators.
|
|
template<typename R = int64_t, typename T , std::enable_if_t< std::is_integral< T >::value, bool > = true> |
R | distance (T other_state) const |
| The distance between two states.
|
|
template<typename T > |
void | advance (T distance) |
| Multi-step advance function (jump-ahead, jump-back).
|
|
bool | operator== (const pcg32 &other) const |
| Equality operator.
|
|
bool | operator!= (const pcg32 &other) const |
| Inequality operator.
|
|
double | cumsum_random (size_t n) |
| Result of the cumulative sum of n random numbers.
|
|
double | cumsum_delta (size_t n, double scale=1) |
| Result of the cumulative sum of n 'random' numbers, distributed according to a delta distribution,.
|
|
double | cumsum_exponential (size_t n, double scale=1) |
| Result of the cumulative sum of n random numbers, distributed according to an exponential distribution, see exponential_distribution(),.
|
|
double | cumsum_power (size_t n, double k=1) |
| Result of the cumulative sum of n random numbers, distributed according to a power distribution, see power_distribution(),.
|
|
double | cumsum_gamma (size_t n, double k=1, double scale=1) |
| Result of the cumulative sum of n random numbers, distributed according to a gamma distribution, see gamma_distribution(),.
|
|
double | cumsum_pareto (size_t n, double k=1, double scale=1) |
| Result of the cumulative sum of n random numbers, distributed according to a Pareto distribution, see pareto_distribution(),.
|
|
double | cumsum_weibull (size_t n, double k=1, double scale=1) |
| Result of the cumulative sum of n random numbers, distributed according to a weibull distribution, see weibull_distribution(),.
|
|
double | cumsum_normal (size_t n, double mu=0, double sigma=1) |
| Result of the cumulative sum of n random numbers, distributed according to a normal distribution, see normal_distribution(),.
|
|
void | shuffle (Iterator begin, Iterator end) |
| Draw uniformly distributed permutation and permute the given STL container.
|
|
auto | decide (const P &p) -> typename detail::return_type< bool, P >::type |
| Decide based on probability per value.
|
|
R | decide (const P &p) |
| Decide based on probability per value.
|
|
void | decide (const P &p, R &ret) |
| Decide based on probability per value.
|
|
auto | decide_masked (const P &p, const T &mask) -> typename detail::return_type< bool, P >::type |
| Decide based on probability per value.
|
|
R | decide_masked (const P &p, const T &mask) |
| Decide based on probability per value.
|
|
void | decide_masked (const P &p, const T &mask, R &ret) |
| Decide based on probability per value.
|
|
double | random () |
| Generate a random number \( 0 \leq r \leq 1 \).
|
|
auto | random (const S &shape) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
|
|
R | random (const S &shape) |
| Generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
|
|
auto | random (const I(&shape)[L]) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
|
|
R | random (const I(&shape)[L]) |
| Generate an nd-array of random numbers \( 0 \leq r \leq 1 \).
|
|
T | randint (T high) |
| Generate a random integer \( 0 \leq r < bound \).
|
|
auto | randint (const S &shape, T high) -> typename detail::return_type< T, S >::type |
| Generate an nd-array of random integers \( 0 \leq r \leq bound \).
|
|
R | randint (const S &shape, T high) |
| Generate an nd-array of random integers \( 0 \leq r \leq bound \).
|
|
auto | randint (const I(&shape)[L], T high) -> typename detail::return_type_fixed< T, L >::type |
| Generate an nd-array of random integers \( 0 \leq r \leq bound \).
|
|
R | randint (const I(&shape)[L], T high) |
| Generate an nd-array of random integers \( 0 \leq r \leq bound \).
|
|
auto | randint (const S &shape, T low, U high) -> typename detail::return_type< T, S >::type |
| Generate an nd-array of random integers \( low \leq r < high \).
|
|
R | randint (const S &shape, T low, U high) |
| Generate an nd-array of random integers \( low \leq r < high \).
|
|
auto | randint (const I(&shape)[L], T low, U high) -> typename detail::return_type_fixed< T, L >::type |
| Generate an nd-array of random integers \( low \leq r < high \).
|
|
R | randint (const I(&shape)[L], T low, U high) |
| Generate an nd-array of random integers \( low \leq r < high \).
|
|
double | delta (double scale=1) |
| Return a number distributed according to a delta distribution.
|
|
auto | delta (const S &shape, double scale=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of numbers that are delta distribution.
|
|
R | delta (const S &shape, double scale=1) |
| Generate an nd-array of numbers that are delta distribution.
|
|
auto | delta (const I(&shape)[L], double scale=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of numbers that are delta distribution.
|
|
R | delta (const I(&shape)[L], double scale=1) |
| Generate an nd-array of numbers that are delta distribution.
|
|
double | exponential (double scale=1) |
| Return a random number distributed according to an exponential distribution.
|
|
auto | exponential (const S &shape, double scale=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers distributed according to an exponential distribution.
|
|
R | exponential (const S &shape, double scale=1) |
| Generate an nd-array of random numbers distributed according to an exponential distribution.
|
|
auto | exponential (const I(&shape)[L], double scale=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers distributed according to an exponential distribution.
|
|
R | exponential (const I(&shape)[L], double scale=1) |
| Generate an nd-array of random numbers distributed according to an exponential distribution.
|
|
double | power (double k=1) |
| Return a random number distributed according to an power distribution.
|
|
auto | power (const S &shape, double k=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers distributed according to an power distribution.
|
|
R | power (const S &shape, double k=1) |
| Generate an nd-array of random numbers distributed according to an power distribution.
|
|
auto | power (const I(&shape)[L], double k=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers distributed according to an power distribution.
|
|
R | power (const I(&shape)[L], double k=1) |
| Generate an nd-array of random numbers distributed according to an power distribution.
|
|
double | gamma (double k=1, double scale=1) |
| Return a random number distributed according to a Gamma distribution.
|
|
auto | gamma (const S &shape, double k=1, double scale=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers distributed according to a Gamma distribution.
|
|
R | gamma (const S &shape, double k=1, double scale=1) |
| Generate an nd-array of random numbers distributed according to a Gamma distribution.
|
|
auto | gamma (const I(&shape)[L], double k=1, double scale=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers distributed according to a Gamma distribution.
|
|
R | gamma (const I(&shape)[L], double k=1, double scale=1) |
| Generate an nd-array of random numbers distributed according to a Gamma distribution.
|
|
double | pareto (double k=1, double scale=1) |
| Return a random number distributed according to a Pareto distribution.
|
|
auto | pareto (const S &shape, double k=1, double scale=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers distributed according to a Pareto distribution.
|
|
R | pareto (const S &shape, double k=1, double scale=1) |
| Generate an nd-array of random numbers distributed according to a Pareto distribution.
|
|
auto | pareto (const I(&shape)[L], double k=1, double scale=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers distributed according to a Pareto distribution.
|
|
R | pareto (const I(&shape)[L], double k=1, double scale=1) |
| Generate an nd-array of random numbers distributed according to a Pareto distribution.
|
|
double | weibull (double k=1, double scale=1) |
| Return a random number distributed according to a Weibull distribution.
|
|
auto | weibull (const S &shape, double k=1, double scale=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers distributed according to a Weibull distribution.
|
|
R | weibull (const S &shape, double k=1, double scale=1) |
| Generate an nd-array of random numbers distributed according to a Weibull distribution.
|
|
auto | weibull (const I(&shape)[L], double k=1, double scale=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers distributed according to a Weibull distribution.
|
|
R | weibull (const I(&shape)[L], double k=1, double scale=1) |
| Generate an nd-array of random numbers distributed according to a Weibull distribution.
|
|
double | normal (double mu=0, double sigma=1) |
| Return a random number distributed according to a normal distribution.
|
|
auto | normal (const S &shape, double mu=0, double sigma=1) -> typename detail::return_type< double, S >::type |
| Generate an nd-array of random numbers distributed according to a normal distribution.
|
|
R | normal (const S &shape, double mu=0, double sigma=1) |
| Generate an nd-array of random numbers distributed according to a normal distribution.
|
|
auto | normal (const I(&shape)[L], double mu=0, double sigma=1) -> typename detail::return_type_fixed< double, L >::type |
| Generate an nd-array of random numbers distributed according to a normal distribution.
|
|
R | normal (const I(&shape)[L], double mu=0, double sigma=1) |
| Generate an nd-array of random numbers distributed according to a normal distribution.
|
|
double | draw (enum prrng::distribution distribution, std::vector< double > parameters=std::vector< double >{}, bool append_default=true) |
| Get a random number according to some distribution.
|
|
R | draw (const S &shape, enum prrng::distribution distribution, std::vector< double > parameters=std::vector< double >{}, bool append_default=true) |
| Get an nd-array of random numbers according to some distribution.
|
|
double | cumsum (size_t n, enum prrng::distribution distribution, std::vector< double > parameters=std::vector< double >{}, bool append_default=true) |
| Get the cumulative sum of n random numbers according to some distribution.
|
|