lppl  v2.0.0

◆ sample() [2/3]

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

Either samples a value from the specified distribution or observes a value against it, depending on whether there is data at the corresponding address in the passed Map<std::string, DSType<D>>.

Template Parameters
Mapmap type with string keys and values of type mapped to by dist.sample.
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
map_map from addresses to values.
Returns
DSType<D>