lppl  v2.0.0

◆ sample() [1/3]

template<typename D , typename RNG , typename... Ts>
DSType<D> sample ( record_t< DTypes< Ts... >> &  r,
std::string  address,
dist,
RNG &  rng 
)

Samples a value into a node stored at the address by drawing a value from the specified distribution. Returns the underlying value of the created node.

Template Parameters
DThe type of distribution from which to sample
RNGThe type of PRNG to use
TsThe distribution types contained in the passed record
Parameters
rthe record into which to sample
addressthe address at which to sample
distthe distribution from which to draw sample(s)
rngthe PRNG to use for sampling
Returns
DSType<D> the sampled value