template<template< typename, typename > class Map, typename D , typename RNG , typename... Ts>
DSType<D> sample |
( |
record_t< DTypes< Ts... >> & |
r, |
|
|
std::string |
address, |
|
|
D |
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
-
Map | map type with string keys and values of type mapped to by dist.sample . |
D | The type of distribution from which to sample |
RNG | The type of PRNG to use |
Ts | The distribution types contained in the passed record |
- Parameters
-
r | the record into which to sample |
address | the address at which to sample |
dist | the distribution from which to draw sample(s) |
rng | the PRNG to use for sampling |
map_ | map from addresses to values. |
- Returns
- DSType<D>