Gromacs  2018.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
gmx::anonymous_namespace{coordstate.cpp} Namespace Reference

Functions

int getSampleFromDistribution (ArrayRef< const double > distr, gmx_int64_t seed, gmx_int64_t indexSeed0, gmx_int64_t indexSeed1)
 Generate a sample from a discrete probability distribution defined on [0, distr.size() - 1]. More...
 

Function Documentation

int gmx::anonymous_namespace{coordstate.cpp}::getSampleFromDistribution ( ArrayRef< const double >  distr,
gmx_int64_t  seed,
gmx_int64_t  indexSeed0,
gmx_int64_t  indexSeed1 
)

Generate a sample from a discrete probability distribution defined on [0, distr.size() - 1].

The pair (indexSeed0,indexSeed1) should be different for every invocation.

Parameters
[in]distrNormalized probability distribution to generate a sample from.
[in]seedRandom seed for initializing the random number generator.
[in]indexSeed0Random seed needed by the random number generator.
[in]indexSeed1Random seed needed by the random number generator.
Returns
a sample index in [0, distr.size() - 1]