Machinery to convert a random generator into a random digit.
More...
#include <exrandom/rand_digit.hpp>
|
template<typename RealType > |
static RealType | invrealbase () |
|
template<uint_t b>
class exrandom::rand_digit< b >
Machinery to convert a random generator into a random digit.
- Template Parameters
-
b | the base for the digits. |
This produces random digits in the range [0,b). In addition it keeps count of how many digits are produced.
- Examples
- count_bits.cpp, discrete_count_bits.cpp, hist_data.cpp, sample_discrete_normal.cpp, sample_exponential.cpp, sample_normal.cpp, and sample_uniform.cpp.
Definition at line 34 of file rand_digit.hpp.
◆ rand_digit()
The constructor (which initializes the count to 0).
Definition at line 59 of file rand_digit.hpp.
◆ operator()()
template<uint_t b>
template<typename Generator >
- Template Parameters
-
- Parameters
-
g | the random generator engine. |
- Returns
- the random digit.
Definition at line 66 of file rand_digit.hpp.
◆ count()
◆ invrealbase()
template<uint_t b>
template<typename RealType >
- Template Parameters
-
the | floating point type of the result. |
- Returns
- 1/base as a floating point number.
Definition at line 93 of file rand_digit.hpp.
◆ base
The base for the digits (or 0 if the base is 232).
Definition at line 39 of file rand_digit.hpp.
◆ min_value
The minimum value produced by operator().
Definition at line 43 of file rand_digit.hpp.
◆ max_value
The maximum value produced by operator().
Definition at line 47 of file rand_digit.hpp.
◆ bits
The number of bits needed to represent a digit.
Definition at line 51 of file rand_digit.hpp.
◆ power_of_two
The documentation for this class was generated from the following file: