|
Boost Users : |
Subject: Re: [Boost-users] [Math/Statistical Distributions+Random] Random number generation
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2009-04-18 03:40:01
On Sat, Apr 18, 2009 at 1:26 AM, er <erwann.rogard_at_[hidden]> wrote:
> 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 :
>
...
> std::generate_n(back_inserter(vec),nn,random::make_variate_generator(urng,dexp));
> //t2
...
> 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
>
Just tried and yessss you're right:
t2 ~ 14.70 t3 ~ 14.68
(compiler: g++ with flags: -DNDEBUG -O3 -Wall -ansi -pedantic)
Also, differences in memory consumption seem negligible
Many thanks for your useful hint!!!
But there is a hope that a "rand" function is added to boost::math in
order to bridge the two worlds?
Thank you so much!
Cheers
-- Marco
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net