Class rng
Defined in File rng.hpp
Inheritance Relationships
Base Type
public rcppsw::patterns::pimpl::pimpl< detail::rng_impl >
(Template Class pimpl)
Class Documentation
-
class rng : public rcppsw::patterns::pimpl::pimpl<detail::rng_impl>
Random number generator class using the PIMPL pattern in order to not have to include
<random>
.Public Functions
-
explicit rng(size_t seed)
-
~rng(void) override
-
bool bernoulli(double p)
Return a selection according to a Bernoulli distribution with parameter
p
.
-
double exponential(double lambda)
Return a selection according to the exponential distribution \(1 - e ^(-lambda)\).
-
double gaussian(double mean, double std_dev)
Return a selection according to the Gaussian distribution \(G(\mu, \sigma)\).
-
inline size_t seed(void) const
Get the current seed.
-
explicit rng(size_t seed)