[random] Poisson generator
Hello,
is there a reason the Poisson generator is no longer
mentioned in the documentation for 1.40.0? It seems to
be there and working.
Cheers
--
Rupert Mazzucco
AMDG Rupert Mazzucco wrote:
is there a reason the Poisson generator is no longer mentioned in the documentation for 1.40.0? It seems to be there and working.
I don't think that the Poisson distribution was ever mentioned in the documentation. In Christ, Steven Watanabe
The current poisson generator is (unless it's been changed recently) less than optimal. It uses a sum of bernoulli trials, which is very inefficient for large values of lambda. Maybe that's why it's not advertised?
AMDG Rupert Mazzucco wrote:
is there a reason the Poisson generator is no longer mentioned in the documentation for 1.40.0? It seems to be there and working.
I don't think that the Poisson distribution was ever mentioned in the documentation. Please create a ticket at svn.boost.org. In Christ, Steven Watanabe
Am Monday 14 September 2009 16:24:17 schrieb Steven Watanabe:
AMDG
Rupert Mazzucco wrote:
is there a reason the Poisson generator is no longer mentioned in the documentation for 1.40.0? It seems to be there and working.
I don't think that the Poisson distribution was ever mentioned in the documentation. Please create a ticket at svn.boost.org.
a little OT: is there a random number generator in boost.random that is comparable to rand()? I recently needed some low-quality random numbers, and every random number generated in boost.random I tried was way too slow, slower than the alternative I tried to avoid by using random numbers (a mutex lock). so I ended up writing an own rand() function, as C rand() has global state so it can't be used from multiple threads.
AMDG Stefan Strasser wrote:
a little OT: is there a random number generator in boost.random that is comparable to rand()? I recently needed some low-quality random numbers, and every random number generated in boost.random I tried was way too slow, slower than the alternative I tried to avoid by using random numbers (a mutex lock). so I ended up writing an own rand() function, as C rand() has global state so it can't be used from multiple threads.
There are several linear congruential generators: minstd_rand0, minstd_rand, and rand48 all defined in boost/random/linear_congruential.hpp In Christ, Steven Watanabe
Am Monday 14 September 2009 17:30:58 schrieb Steven Watanabe:
AMDG
Stefan Strasser wrote:
a little OT: is there a random number generator in boost.random that is comparable to rand()? I recently needed some low-quality random numbers, and every random number generated in boost.random I tried was way too slow, slower than the alternative I tried to avoid by using random numbers (a mutex lock). so I ended up writing an own rand() function, as C rand() has global state so it can't be used from multiple threads.
There are several linear congruential generators: minstd_rand0, minstd_rand, and rand48 all defined in boost/random/linear_congruential.hpp
I tried minstd_rand. iirc about 30 times slower than rand() and several times a mutex lock. I realise that rand() is a...unsophisticated random number generator in most implementations, if you can even call it that. but it's still enough for some use cases and there is no thread safe version of it in the C(++) standard.
It might be worth incorporating such a fast-as-possible simple random
number generator into boost as it apparently doesn't have the
drawbacks of the standard one. Used properly, I'm sure it can be
useful for more people in limited cases.
Best,
Dee
On Mon, Sep 14, 2009 at 8:52 PM, Stefan Strasser
Am Monday 14 September 2009 17:30:58 schrieb Steven Watanabe:
AMDG
Stefan Strasser wrote:
a little OT: is there a random number generator in boost.random that is comparable to rand()? I recently needed some low-quality random numbers, and every random number generated in boost.random I tried was way too slow, slower than the alternative I tried to avoid by using random numbers (a mutex lock). so I ended up writing an own rand() function, as C rand() has global state so it can't be used from multiple threads.
There are several linear congruential generators: minstd_rand0, minstd_rand, and rand48 all defined in boost/random/linear_congruential.hpp
I tried minstd_rand. iirc about 30 times slower than rand() and several times a mutex lock. I realise that rand() is a...unsophisticated random number generator in most implementations, if you can even call it that. but it's still enough for some use cases and there is no thread safe version of it in the C(++) standard.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (5)
-
Diederick C. Niehorster
-
Neal Becker
-
Rupert Mazzucco
-
Stefan Strasser
-
Steven Watanabe