17 Apr
2009
17 Apr
'09
11:26 p.m.
Marco Guazzone wrote:
This would be a good starting point, even if the resulting code might be penalized in performance and resource consumption (e.g., for the
... and here it is : typedef math::exponential_distribution<value_type> dexp_t; typedef exponential_distribution<value_type> rexp_t; typedef variate_generator<urng_t&, rexp_t> gen_t; nn = 1e2; boost::random::make_variate_generator(urng,dexp); //t0 std::generate_n(back_inserter(vec),nn,random::make_variate_generator(urng,dexp)); //t2 gen_t gen(urng,rexp); //t1 std::generate_n(back_inserter(vec),nn,gen_t(urng,rexp));//t3 time per 1000000 iterations : t0 = 1.54508 t1 = 1.49743 t2 = 5.95946 t3 = 5.91909