libfxd 0.2.dev
A fixed-point library for C++.
|
Analogous to std::uniform_real_distribution
.
More...
#include <random.hpp>
Classes | |
class | param_type |
Analogous to std::uniform_real_distribution::param_type More... | |
Public Types | |
using | result_type = Fxd |
The type that will be generated. | |
Public Member Functions | |
uniform_real_distribution () | |
Default constructor. | |
uniform_real_distribution (result_type a_, result_type b_=std::numeric_limits< result_type >::max()) | |
Constructor with min and max values. | |
uniform_real_distribution (const param_type &p) | |
Constructor from a param_type object. | |
void | reset () noexcept |
Reset distribution state. | |
result_type | a () const noexcept |
Same as min() . | |
result_type | b () const noexcept |
Same as max() . | |
param_type | param () const noexcept |
Obtain distribution parameters. | |
void | param (const param_type &p) |
Set distribution parameters. | |
result_type | min () const noexcept |
Return lower bound of distribution. | |
result_type | max () const noexcept |
Return upper bound of distribution. | |
template<typename Gen > | |
result_type | operator() (Gen &g) |
Generate a random value. | |
template<typename Gen > | |
result_type | operator() (Gen &g, const param_type &p) |
Generate a random value from a specific parameters object. | |
bool | operator== (const uniform_real_distribution &) const =default |
Defaulted == operator. | |
Friends | |
template<typename CharT , typename Traits > | |
std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &out, const uniform_real_distribution &dist) |
Output operator. | |
template<typename CharT , typename Traits > | |
std::basic_istream< CharT, Traits > & | operator>> (std::basic_istream< CharT, Traits > &in, const uniform_real_distribution &dist) |
Input operator. | |
Analogous to std::uniform_real_distribution
.
Definition at line 23 of file random.hpp.
using result_type = Fxd |
The type that will be generated.
Definition at line 31 of file random.hpp.
|
inline |
Default constructor.
Definition at line 73 of file random.hpp.
|
inlineexplicit |
Constructor with min and max values.
a_ | Minimum value. |
b_ | Maximum value (inclusive). |
Definition at line 84 of file random.hpp.
|
inlineexplicit |
Constructor from a param_type
object.
Definition at line 92 of file random.hpp.
|
inlinenoexcept |
Same as min()
.
Definition at line 103 of file random.hpp.
|
inlinenoexcept |
Same as max()
.
Definition at line 112 of file random.hpp.
|
inlinenoexcept |
Return upper bound of distribution.
Definition at line 151 of file random.hpp.
|
inlinenoexcept |
Return lower bound of distribution.
Definition at line 141 of file random.hpp.
|
inline |
Generate a random value.
Definition at line 162 of file random.hpp.
|
inline |
Generate a random value from a specific parameters object.
Definition at line 172 of file random.hpp.
|
default |
Defaulted ==
operator.
|
inlinenoexcept |
Obtain distribution parameters.
Definition at line 122 of file random.hpp.
|
inline |
Set distribution parameters.
Definition at line 131 of file random.hpp.
|
inlinenoexcept |
Reset distribution state.
Definition at line 98 of file random.hpp.
|
friend |
Output operator.
Definition at line 186 of file random.hpp.
|
friend |
Input operator.
Definition at line 221 of file random.hpp.