
On Thu, 23 Mar 2006 12:37:04 -0300, Kamil Renczewski
Hello I have a problem. I need to write program, whitch interprets arguments given at runtime and create generators from this arguments. Then i have to use this generators (by calling operator() method) to generate numbers. Problem is that i dont know type of generators at compile time and i dont know how to store them in struct or class or even pass to a function. Here is en example of my thinking: i run program like this: generators N 10 2 E 2.3 and i would like to get some ramdom numbers from a normal_distribution<>(10, 2) and exponential_distribution<>(2.3) another run of a program might be: generators U -10 30 G 0.3 whitch should give me an uniform_int<>(-10, 30) and geometric_distribution<>(0.3) .
Any ideas how to do this?
I would use boost::function objects that store internally the appropiate generator. Bruno