ExRandom
3.0
|
Sample exactly from the unit uniform distribution. More...
#include <exrandom/unit_uniform_distribution.hpp>
Classes | |
struct | param_type |
Parameter type for unit_uniform_distribution. More... | |
Public Types | |
typedef RealType | result_type |
Public Member Functions | |
unit_uniform_distribution () | |
unit_uniform_distribution (const param_type &) | |
void | reset () |
param_type | param () const |
void | param (const param_type &) |
result_type | min () const |
result_type | max () const |
template<typename Generator > | |
result_type | operator() (Generator &g) |
template<typename Generator > | |
result_type | operator() (Generator &g, const param_type &) |
Friends | |
bool | operator== (const unit_uniform_distribution< RealType > &, const unit_uniform_distribution< RealType > &) |
bool | operator!= (const unit_uniform_distribution< RealType > &, const unit_uniform_distribution< RealType > &) |
std::ostream & | operator<< (std::ostream &os, const unit_uniform_distribution< RealType > &) |
std::istream & | operator>> (std::istream &is, unit_uniform_distribution &) |
Sample exactly from the unit uniform distribution.
This samples from the unit uniform distribution P(x) = 1, for 0 < x < 1. This is a replacement for std::uniform_real_distribution (with no parameters). It is equivalent to sampling a real number exactly from the distribution and rounding it to a floating point number. With the usual rule for rounding (round to nearest), this means that the end points of the interval can be returned, i.e., the sampling is from the closed interval, [0,1].
RealType | the floating point type of the resulting deviates. This can include various multi-precision floating point types; see u_rand::value of details. |
This is a wrapper for unit_uniform_dist to turn it into a C++11 style random distribution. If the radix of RealType is 2 (the usual case), then the base for unit_uniform_dist is set to 232; otherwise (e.g., RealType is a decimal system), the base is set to the radix.
Definition at line 42 of file unit_uniform_distribution.hpp.
typedef RealType exrandom::unit_uniform_distribution< RealType >::result_type |
The type of the range of the distribution.
Definition at line 47 of file unit_uniform_distribution.hpp.
|
inlineexplicit |
Constructs an uniform distribution.
Definition at line 64 of file unit_uniform_distribution.hpp.
|
inlineexplicit |
Constructs an uniform distribution with a parameter.
The parameter is ignored because it has no state.
Definition at line 72 of file unit_uniform_distribution.hpp.
|
inline |
Resets the distribution state.
Definition at line 78 of file unit_uniform_distribution.hpp.
|
inline |
Definition at line 83 of file unit_uniform_distribution.hpp.
|
inline |
Sets the parameter set of the distribution.
The function does not because a param_type has no state.
Definition at line 90 of file unit_uniform_distribution.hpp.
|
inline |
Definition at line 95 of file unit_uniform_distribution.hpp.
|
inline |
Definition at line 100 of file unit_uniform_distribution.hpp.
|
inline |
Generator | the type of g. |
g | the random generator engine. |
Definition at line 109 of file unit_uniform_distribution.hpp.
|
inline |
Generator | the type of g. |
g | the random generator engine. |
Definition at line 119 of file unit_uniform_distribution.hpp.
|
friend |
Compare two unit_uniform_distributions.
Definition at line 127 of file unit_uniform_distribution.hpp.
|
friend |
Contrast two unit_uniform_distributions.
Definition at line 136 of file unit_uniform_distribution.hpp.
|
friend |
Inserts a unit_uniform_distribution random number distribution into the output stream os.
os | an output stream. |
This function does nothing because this distribution has no state.
Definition at line 150 of file unit_uniform_distribution.hpp.
|
friend |
Extracts a unit_uniform_distribution random number distribution from the input stream is.
is | an input stream. |
This function does nothing because this distribution has no state.
Definition at line 164 of file unit_uniform_distribution.hpp.