|
Boost : |
Subject: Re: [boost] [Bug Sprint][random] overload resolution for constructors/seed
From: Keith Jeffery (Keith.Jeffery_at_[hidden])
Date: 2009-06-03 13:46:07
> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]]
> On Behalf Of Steven Watanabe
> Sent: Tuesday, June 02, 2009 4:30 PM
> Fixing #351 and #2887 will silently change the meaning of the
> constructor call above. It will also be difficult to emulate the
> previous (documented) behavior. However, looking at the current
> standard draft, the constructor that causes these problems is not
> present, so the standard mersenne twister will have a well behaved
> copy constructor. Also, only lagged_fibonacci_01, mersenne_twister,
> and subtract_with_carry provide the offending constructor, so
> Boost.Random is not consistent. I'd like to have the copy constructor
> called. What do others think?
I think the principal of least surprise dictates that it should be the copy constructor. Can't the current behavior be achieved with the following?
boost::mt19937 prng1;
boost::mt19937 prng2;
prng2.seed(prng1);
>
> When testing fixes, I found that rand48 behaves differently with an
> int64_t seed than with an int32_t seed. According to the current
> draft standard, they should be equivalent. Should rand48 be changed
> or should I leave it alone?
For the same reason as above, I think the behavior should be the same.
>
> In Christ,
> Steven Watanabe
>
Keith Jeffery
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk