Gromacs
2024.4
|
#include <gromacs/random/exponentialdistribution.h>
Exponential distribution.
The C++ standard library does provide an exponential distribution, but even though they all sample from a 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 |
Exponential distribution parameters. More... | |
Public Types | |
typedef RealType | result_type |
Type of values returned. | |
Public Member Functions | |
ExponentialDistribution (result_type lambda=1.0) | |
Construct new distribution with given floating-point parameter. More... | |
ExponentialDistribution (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 exponential distribution with internal parameters. More... | |
template<class Rng > | |
result_type | operator() (Rng &g, const param_type ¶m) |
Return value from exponential distribution with given parameters. More... | |
result_type | lambda () const |
Return the lambda parameter of the exponential distribution. | |
param_type | param () const |
Return the full parameter class of exponential distribution. | |
result_type | min () const |
Smallest value that can be returned from exponential distribution. | |
result_type | max () const |
Largest value that can be returned from exponential distribution. | |
bool | operator== (const ExponentialDistribution &x) const |
True if two exponential distributions will produce the same values. More... | |
bool | operator!= (const ExponentialDistribution &x) const |
True if two exponential distributions will produce different values. More... | |
|
inlineexplicit |
Construct new distribution with given floating-point parameter.
lambda | lambda/decay parameter |
|
inlineexplicit |
Construct new distribution from parameter class.
param | Parameter class as defined inside gmx::ExponentialDistribution. |
|
inline |
True if two exponential distributions will produce different values.
x | Instance to compare with. |
|
inline |
Return values from exponential distribution with internal parameters.
Rng | Random engine class |
g | Random engine |
|
inline |
Return value from exponential distribution with given parameters.
Rng | Random engine class |
g | Random engine |
param | Parameters to use |
|
inline |
True if two exponential distributions will produce the same values.
x | Instance to compare with. |