Split of tr1 and std random facilities and completion of latter

Ed Smith-Rowland 3dw4rd@verizon.net
Sat Dec 13 02:46:00 GMT 2008


Benjamin Kosnik wrote:
>> I have questions remaining about efficient implementation of discard
>> for the random number engines.  I would like a "10000" test for
>> independent_bits and for seed_seq.  I'd like to take another look at
>> some of the log2 math in generate_canonical.  But the system is quite
>> usable now and these can be tweaked as necessary in the tree.
>>
>>     
>
>   
>> I had some real fights with svn diff.  Which eventually won -
>> probably by user error ;-).  So here is a generic diff and a change
>> log.
>>     
>
> Here's my stab a regenerating your patch. 
>
> I am testing this on darwin, results after lunch, and have finished
> testing on x86_64. Looks good, one new fail:
>
> testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc
>
> Uses -std=gnu++0x, but with the old mersenne_twister. Changing this to
> mersenne_twister_engine gets into other issues, where number of
> template parameters should be 12, not 14. Looking at N2798's
> mersenne_twister_engine confirms. Thoughts?
>
> -benjamin
Benjamin,

The patch looks good.  I guess you integrated the CL into the main 
ChangeLog and left the Makefile.in unchanged (I can never remember which 
one is generated from the other ;-))  Otherwise it's spot on.

I also regression tested with x86_64-unknown-linux and got a couple 
errors.  I'm on a different computer now.  I'll check what those errors 
are later - your error looks familiar though so we might be seeing the 
same thing.

About the mersenne_twister.  I got hold of a post-n2798 draft somehow.  
This draft had concepts integrated into it and some other changes.  The 
mersenne_twister got two more template args in that draft.  There is a 
corresponding special engine mt19937_64 - a 64-bit mersenne_twister 
engine corresponding to mt19937.  Also, the sampling distributions are 
different.

I noticed n2800 is out but it looks like n2798 with change markup 
removed.  No concepts (don't have those anyway), 12 parameter 
mersenne_twister, no piecewise_linear_distribution.

Basically, I got ahead of myself.  Ugh.  OTOH, I thought when I made 
this there was no way it would make it into 4.4.

Anyway, we should remove the two template arguments on mersenne, 
mt19937_64, and the piecewise_linear_distribution for gcc-4.4.  That 
would put us back to n2798 and in very good shape.

Either one of us could do that at this point.

Ed





More information about the Libstdc++ mailing list