template<typename D , typename RNG , typename... Ts>
| DSType<D> sample |
( |
record_t< DTypes< Ts... >> & |
r, |
|
|
std::string |
address, |
|
|
D |
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
-
| 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 |
- Returns
- DSType<D> the sampled value