Boost logo

Boost Users :

Subject: Re: [Boost-users] Mersenne twister problem
From: Matthias Troyer (troyer_at_[hidden])
Date: 2009-09-19 02:20:21


On 18 Sep 2009, at 17:35, ruya wrote:

>
>
> Matthias Troyer-2 wrote:
>>
>>
>> You also need to implement the assignment operator
>>
>> Actually, as long as the generator is good they are uncorrelated. At
>> least this is what is tested for. This is tested much better than
>> correlations between different seeds.
>>
>>
>
> But isn't the assignment equal to calling the copy constructor by
> default?
> What I mean is: if you have obj1 = obj2 then obj1 is created by
> Object(obj2).

If you have:

Object obj1=obj2;

then indeed the copy constructor is used, but if you have:

Obj obj1;
obj1=obj2;

then the assignment constructor is called. The default is again a
member-wise copy which is wrong in your example.

> As for the generators I was not aware of this. can you give me some
> link for
> a technical paper on this?

All test suites test correlations within a sequence, but tests between
different sequences with different seeds are rare. For lagged
Fibonacci generators there are proofs that uncorrelated seed blocks
can be generated, but not for other generators. Especially your using
MASTER_SEED*13 and MASTER_SEED*17 is completely untested (and in the
case MASTER_SEED=0 it would give identical results!)

Matthias


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