RandomSample with specified random number generator

Artur Skawina art.08.09 at gmail.com
Mon Jun 18 05:21:59 PDT 2012


On 06/18/12 10:40, Joseph Rushton Wakeling wrote:
> On 17/06/12 19:50, Artur Skawina wrote:
>> I took your random.d and ran with that:
>>
>>     [6612, 6650, 6704, 0, 6629, 6834, 6634, 6756, 6590, 6591]
>>     [6589, 6587, 6636, 0, 6673, 6704, 6647, 6704, 6643, 6817]
>>     [6744, 6552, 6602, 0, 6641, 6722, 6598, 6676, 6749, 6716]
>>     [6641, 6583, 6710, 0, 6618, 6684, 6789, 6673, 6683, 6619]
>>     [6667, 6692, 6600, 0, 6717, 6588, 6660, 6678, 6673, 6725]
>>
>> so the problem is still there, just a little different.
>>
>> I'm using an old GDC build, in case that makes any difference:
>>
>> gcc version 4.6.3 20120106 (prerelease gdc 0.31 - r748:ab99d67f04c2, using dmd 2.057)
> 
> Just built my random.d with gdc 4.6.3 together with your test code.  Here's what comes out:
> 
> [5954, 5896, 6018, 6004, 5978, 5963, 5959, 5970, 6151, 6107]
> [6020, 6044, 5914, 5994, 6110, 6064, 5969, 5985, 6002, 5898]
> [5877, 6021, 6022, 6054, 6075, 5967, 5998, 6010, 6023, 5953]
> [6059, 5968, 5972, 5908, 5982, 6034, 6189, 5909, 5982, 5997]
> [6006, 6077, 6011, 6037, 5823, 6062, 6022, 5925, 6065, 5972]
> [5877, 6006, 6005, 6049, 6013, 5971, 6053, 6023, 5902, 6101]
> [5946, 5984, 6006, 6018, 6049, 6097, 5993, 6030, 5922, 5955]
> [5992, 6071, 5974, 5993, 6066, 5974, 5897, 6017, 5951, 6065]
> [5975, 6127, 6103, 5889, 6000, 5949, 6003, 5849, 5974, 6131]
> [6005, 5937, 5920, 5978, 6032, 6003, 6023, 6064, 6086, 5952]
> 
> ... are you sure there's not something wrong in the way you added my random.d to your test code?  I've sent a copy of my code to you privately so you can test.

Your standalone version works fine.

For some reason the test fails as shown above when I replace the
std.random module with your version (same as the working test
program minus the runtime test), compile it and link my test with
the resulting random.o object.

artur


More information about the Digitalmars-d mailing list