I have the following function that should return a distribution generateor such that I can use the function to populate a vector i.e.
template<typename T3>
T3 new_func()
{
std::uniform_real_distribution<> Uni(1,2);
boost::variate_generator< boost::mt19937, std::uniform_real_distribution<>> Uniform(gen , Uni);
return Uniform;
}
int main ()
{
std::vector<double> test;
//something like
std::for_each(test.begin(), test.end(),
[&](std::vector<double>& a){a.push_back(new_func());});
}
I specifically need this ability as I will have a single parameterized function to generate multiple distributions to be used in this fashion. Kindly suggest what exactly I need to do achieve this.