Boost logo

Boost :

Subject: Re: [boost] [random] new threefry random engine
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2014-05-02 11:52:23


AMDG

On 05/02/2014 06:49 AM, Thijs van den Berg wrote:
>
> The counter_based_engine design I’m working on (I’ll share an example soon) works with 3 type of random function:
> * random function that convert an input buffer to an output buffer. For these I use the input as an counter, and let the seed() set the highest bits of the counter. The engine uses the following random function interfaces
> void random_function(input&,output&)
>
> * random function that also use an additional key. For this version I have the seed() random engine set a key buffer, and that key gets passed to the random function
> random_function(input&,output&,key&)
>
> * random function that have a state dependent of the key, and computing the state takes some time. These random functions have an additional member function that the counter_engine uses when it gets seeded
> random_function.set_key(key&)// called by random engine seed()
> ...
> random_function(input&,output&) // sometimes called by random engine operator(), whenever it needs a new batch of random data
>

This is much too complicated. There should be
exactly one kind of RandomFunction. Either pass
the key always, and make it empty when it isn't
needed, or store the key in the random function
and never pass it.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk