#include <Random123/MicroURNG.hpp>
List of all members.
Detailed Description
template<typename CBRNG, unsigned int _BITS>
class r123::MicroURNG< CBRNG, _BITS >
Given a CBRNG whose ctr_type has an unsigned integral value_type, MicroURNG<CBRNG, BITS>(c, k) is a type that satisfies the requirements of a C++0x Uniform Random Number Generator.
The intended purpose is for a MicroURNG to be passed as an argument to a C++0x Distribution, e.g., std::normal_distribution. See examples/MicroURNG.cpp.
The MicroURNG functor may only be called a limited number of times. After
ctr_type.size()*2^BITS,
calls, it throws a runtime_error.
The high BITS bits of the highest word in the counter c, passed to the constructor must be zero. MicroURNG uses these bits to "count".
Notice that you can carve out as many BITS as you like from the counter space, and are then free to call the MicroURNG until the bits run out. If you want a few dozen normally distributed randoms for each of your state/timestep/seed tuples, then give MicroURNG a few extra bits to work with and you're good to go:
typedef ?someCBRNG? RNG;
RNG::ctr_type c = ...;
RNG::key_type k = ...;
std::normal_distribution<float> nd;
MicroURNG<RNG, 10> urng(c, k);
for(???){
...
nd(urng);
...
}
Member Typedef Documentation
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
Constructor & Destructor Documentation
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
Member Function Documentation
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
template<typename CBRNG , unsigned int _BITS>
Member Data Documentation
template<typename CBRNG , unsigned int _BITS>
The documentation for this class was generated from the following file: