std random
Ed Smith-Rowland
3dw4rd@verizon.net
Tue Dec 9 12:30:00 GMT 2008
Ed Smith-Rowland wrote:
> Greetings,
>
> A while back I noted that the std random was different from the tr1
> random facility. My original plan was to simply rename the classes in
> the std implementation. Further investigation into the latest CD for
> C++-0X revealed that the differences were far more pervasive and
> deeper that simply renaming (even renaming involved more hacking of
> TR1 than would make it worth while).
>
> The attached patch splits the random facility. It also goes a long
> way toward completing the std random facility. The new analytic type
> distributions were obtained by studying the gmp implementations. The
> sampling distributions are completely new as are two new engine
> adaptors: independent_bits and shuffle_order. The generate_canonical
> and the seed_seq utilities are also new. Even the engines and the
> distributions that have direct analogs in tr1 have been substantially
> reworked due to the changes in design in the later drafts.
>
> This patch is a tad more aggressive than one would want at this stage
> ;-). This would only go in for 4.5 I think. That leaves the question
> of what we should do for 4.4. I think it may be misleading to keep
> random in std. I think it may be best to simply delete or disable
> include/std/random for now. What do all of you you think?
>
> The patch bootstraps and regtests with no new fails on
> x86_64-unknown-linux-gnu.
>
> The one thing that I must figure out before release is that one of the
> constructor overloads:
> template<typename SeedSeq>
> some_engine(SeedSeq& sseq);
>
> eats a lot of calls that it shouldn't such as this:
>
> some_engine(unsigned long seed);
>
> and barfs because unsigned long doesn't have a generate() method.
>
> I need to kind of pseudo-concept for SeedSeq. Any pointers on how
> this mechanism works in gcc would be helpful. I'm just starting to
> look at this. I need to request that a type support a
> generate(Iter,Iter) method before being worthy of the first ctor.
>
> I'll make a list of other issues more specific to random that I and
> others could help think about in another message.
>
> Thank you,
>
> Ed
>
Actually, the patch is mangled. I'll put together another one. Sorry.
More information about the Libstdc++
mailing list