I'm trying to make a simulation of something like a Markov chain and using discrete_distribution to simulate the change of state s_i to s_j. But of course, this is a Matrix, not a vector. So I try.
std::vector <uint16_t> v {{...},
{...},
...
{...},};
std::vector <std::discrete_distribution <uint16_t> > distr(n, std::distribution <uint16_t> (v.begin(), v.end()) );
but this doesn't work.
note: if I try just 1 vector, this is a vector of uint16_t works
// CHANGE v by v[0]
std::vector<std::discrete_distribution <uint64_t>> distr(1, std::discrete_distribution <uint64_t> (vecs[0].begin(), vecs[0].end()));
based on this answer
I know that
std::vector <std::discrete_distribution <uint16_t> > distr(n, std::distribution <uint16_t> (v.begin(), v.end()) );
is not correct, but I say about the change v1 to v. to demonstrate that is possible use a vector of discrete distributions
v1
and so on, why not initialize the nested vector in one shot? – Spreaderdiscrete_distribution
part? – Spreader