Wrapper for RNG engines. More...
#include <random_generators.h>
Public Types | |
| using | result_type = typename RandomEngineT::result_type |
Public Member Functions | |
| RandomGenerator ()=delete | |
| RandomGenerator (const RandomEngineT &rng)=delete | |
| RandomGenerator (std::initializer_list< std::uint32_t > seed) | |
| unsigned long | operator() (std::uniform_int_distribution< unsigned long > &d) override |
| Calls the provided distribution with the wrapped RNG engine. | |
| double | operator() (std::uniform_real_distribution<> &d) override |
| double | operator() (std::normal_distribution<> &d) override |
| double | operator() (std::lognormal_distribution<> &d) override |
| unsigned long | operator() (std::binomial_distribution< unsigned long > &d) override |
| double | operator() (std::gamma_distribution<> &d) override |
| double | operator() (std::exponential_distribution<> &d) override |
| unsigned long | operator() (std::discrete_distribution< unsigned long > &d) override |
| unsigned long | operator() (std::poisson_distribution< unsigned long > &d) override |
| unsigned long | operator() (std::uniform_int_distribution< unsigned long > &d, std::uniform_int_distribution< unsigned long >::param_type &p) override |
| Calls the provided distribution with the wrapped RNG engine, using provided distribution parameters. | |
| double | operator() (std::uniform_real_distribution<> &d, std::uniform_real_distribution<>::param_type &p) override |
| double | operator() (std::normal_distribution<> &d, std::normal_distribution<>::param_type &p) override |
| double | operator() (std::lognormal_distribution<> &d, std::lognormal_distribution<>::param_type &p) override |
| unsigned long | operator() (std::binomial_distribution< unsigned long > &d, std::binomial_distribution< unsigned long >::param_type &p) override |
| double | operator() (std::gamma_distribution<> &d, std::gamma_distribution<>::param_type &p) override |
| double | operator() (std::exponential_distribution<> &d, std::exponential_distribution<>::param_type &p) override |
| unsigned long | operator() (std::discrete_distribution< unsigned long > &d, std::discrete_distribution< unsigned long >::param_type &p) override |
| unsigned long | operator() (std::poisson_distribution< unsigned long > &d, std::poisson_distribution< unsigned long >::param_type &p) override |
| double | drand () override |
| Uses the wrapped RNG engine to draw a double from a uniform distribution in the range [0, 1). | |
| unsigned long | ulrand (unsigned long N) override |
| Uses the wrapped RNG engine to draw an unsigned long from a uniform distribution in the range [0, N). | |
| void | stable_sample (NodeCollection::const_iterator first, NodeCollection::const_iterator last, std::back_insert_iterator< std::vector< NodeIDTriple > > dest, size_t n) override |
| Wrap std::sample for selection from NodeCollection. | |
| void | partial_shuffle (std::vector< size_t > &data, const size_t n) override |
| Select randomly shuffled elements from vector. | |
Public Member Functions inherited from nest::BaseRandomGenerator | |
| virtual | ~BaseRandomGenerator () |
Private Attributes | |
| RandomEngineT | rng_ |
| Wrapped RNG engine. | |
| std::uniform_int_distribution< unsigned long > | uniform_ulong_dist_ |
| std::uniform_real_distribution | uniform_double_dist_0_1_ |
Wrapper for RNG engines.
| RandomEngineT | Type of the wrapped engine, must conform with the C++11 random engine interface. |
| using nest::RandomGenerator< RandomEngineT >::result_type = typename RandomEngineT::result_type |
|
delete |
|
delete |
|
inlineexplicit |
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Uses the wrapped RNG engine to draw a double from a uniform distribution in the range [0, 1).
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_, and nest::RandomGenerator< RandomEngineT >::uniform_double_dist_0_1_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Calls the provided distribution with the wrapped RNG engine.
One operator per distribution must be defined.
| d | Distribution that will be called. |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Calls the provided distribution with the wrapped RNG engine, using provided distribution parameters.
One operator per distribution must be defined.
| d | Distribution that will be called. |
| p | Distribution parameters. |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Select randomly shuffled elements from vector.
Places n elements chosen from data without replacement, in random order, at the beginning of data and then reduces the size of data to n. If n exceeds data.size(), all elements are kept and only shuffled.
| data | Vector to be shuffled and possibly shortened. |
| n | Number of elements to select. |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::ulrand().
|
inlineoverridevirtual |
Wrap std::sample for selection from NodeCollection.
Inserts random stable sample without replacement of size n from range [first, last)into dest.
n == nc.size(), then dest will contain the original node collection (as an explicit vector). Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_.
|
inlineoverridevirtual |
Uses the wrapped RNG engine to draw an unsigned long from a uniform distribution in the range [0, N).
| N | Maximum value that can be drawn. |
Implements nest::BaseRandomGenerator.
References nest::RandomGenerator< RandomEngineT >::rng_, and nest::RandomGenerator< RandomEngineT >::uniform_ulong_dist_.
Referenced by nest::RandomGenerator< RandomEngineT >::partial_shuffle().
|
private |
Wrapped RNG engine.
Referenced by nest::RandomGenerator< RandomEngineT >::drand(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::operator()(), nest::RandomGenerator< RandomEngineT >::RandomGenerator(), nest::RandomGenerator< RandomEngineT >::stable_sample(), and nest::RandomGenerator< RandomEngineT >::ulrand().
|
private |
Referenced by nest::RandomGenerator< RandomEngineT >::drand().
|
private |
Referenced by nest::RandomGenerator< RandomEngineT >::ulrand().