|
Boost : |
From: Fernando Cacciola (fcacciola_at_[hidden])
Date: 2001-12-20 16:32:43
----- Original Message -----
From: Jens Maurer <Jens.Maurer_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Thursday, December 20, 2001 6:27 PM
Subject: Re: [boost] Problems with random uniform_int<>
> Fernando Cacciola wrote:
> > I was using the random number library and I found a particular situation
in
> > which some constructor enters an endless loop.
>
> Thank you for your bug report.
>
> > #include <boost/random/linear_congruential.hpp>
> > #include <boost/random/uniform_int.hpp>
> >
> > int main()
> > {
> > using namespace boost ;
> >
> > minstd_rand rnd ;
> > uniform_int<minstd_rand> x(rnd,0,8361); // --> This CTOR loops for
ever.
> >
> > return 0 ;
> > }
> >
> > I'm using boost 1.25.0 with Borland C++ 5.5.1 (BCB actually).
>
> I've added your test case to random_test.cpp.
>
> I had fixed a bunch of overflows in uniform_int<> for
> Boost version 1.26.0, and indeed, the test case above doesn't
> lead to an endless loop with the current CVS version of Boost.Random.
> Consider getting only boost/random from the CVS (or 1.26.0),
> it should be usable with the rest of boost being 1.25.0.
>
> Jens Maurer
>
Great!
Thank you.
Fernando Cacciola
Sierra s.r.l.
fcacciola_at_[hidden]
www.gosierra.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk