Gromacs
2024.3
|
#include <gromacs/random/uniformrealdistribution.h>
Uniform real distribution.
The C++ standard library does provide this distribution, but even though they all sample from the correct distribution different standard library implementations appear to return different sequences of numbers for the same random number generator. To make it easier to use GROMACS unit tests that depend on random numbers we have our own implementation.
RealType | Floating-point type, real by default in GROMACS. |
Classes | |
class | param_type |
Uniform real distribution parameters. More... | |
Public Types | |
typedef RealType | result_type |
Type of values returned. | |
Public Member Functions | |
UniformRealDistribution (result_type a=0.0, result_type b=1.0) | |
Construct new distribution with given floating-point parameters. More... | |
UniformRealDistribution (const param_type ¶m) | |
Construct new distribution from parameter class. More... | |
void | reset () |
Flush all internal saved values. | |
template<class Rng > | |
result_type | operator() (Rng &g) |
Return values from uniform real distribution with internal parameters. More... | |
template<class Rng > | |
result_type | operator() (Rng &g, const param_type ¶m) |
Return value from uniform real distribution with given parameters. More... | |
result_type | a () const |
Return the lower range uniform real distribution. | |
result_type | b () const |
Return the upper range of the uniform real distribution. | |
param_type | param () const |
Return the full parameter class of the uniform real distribution. | |
result_type | min () const |
Smallest value that can be returned from uniform real distribution. | |
result_type | max () const |
Largest value that can be returned from uniform real distribution. | |
bool | operator== (const UniformRealDistribution &x) const |
True if two uniform real distributions will produce the same values. More... | |
bool | operator!= (const UniformRealDistribution &x) const |
True if two uniform real distributions will produce different values. More... | |
|
inlineexplicit |
Construct new distribution with given floating-point parameters.
a | Lower end of range (inclusive) |
b | Upper end of range (exclusive) |
|
inlineexplicit |
Construct new distribution from parameter class.
param | Parameter class as defined inside gmx::UniformRealDistribution. |
|
inline |
True if two uniform real distributions will produce different values.
x | Instance to compare with. |
|
inline |
Return values from uniform real distribution with internal parameters.
Rng | Random engine class |
g | Random engine |
|
inline |
Return value from uniform real distribution with given parameters.
Rng | Random engine class |
g | Random engine |
param | Parameters to use |
|
inline |
True if two uniform real distributions will produce the same values.
x | Instance to compare with. |