This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libstdc++: add uniform on sphere distribution
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Ulrich Drepper <drepper at gmail dot com>
- Cc: Ed Smith-Rowland <3dw4rd at verizon dot net>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 13 Jul 2014 18:52:18 +0200
- Subject: Re: [PATCH] libstdc++: add uniform on sphere distribution
- Authentication-results: sourceware.org; auth=none
- References: <53C28FBB dot 9080708 at verizon dot net> <CAOPLpQcDX_mAdAxy2ZaqRE_UzYBOgQwcGkz66-RtfsEOhzkYmg at mail dot gmail dot com> <53C2A91D dot 1070808 at oracle dot com> <CAOPLpQc6OmUh=xStvxnUpEHdiP7vWf2-G31f4uCsJSp6iD75HQ at mail dot gmail dot com> <53C2AED6 dot 4040402 at oracle dot com> <CAOPLpQfWVJctTbSvmGBN6KKCgenbopjrr-+iHG4ti_jzgGebgg at mail dot gmail dot com> <53C2B301 dot 2030205 at oracle dot com> <CAOPLpQcSV+U1E6f8g+MWizeB=Ec0_ZJg4gFwTSOErf76BxLeZw at mail dot gmail dot com>
Hi,
On 07/13/2014 06:44 PM, Ulrich Drepper wrote:
But your 4th and 7th call example by itself is not a reason. Again,
the input exclusively determined by the random numbers. Here, of
course, the 4th and 7th use will produce different results. But this
is not what the state of the distribution is supposed to capture. For
that you'll have to save the state of the RNG as well.
Yes, you are right. Saving the full state of the distribution solves
only half of my hypothetical problem, but certainly you have to save it
if you want to, say, reset the RNGs to a common state and get the same
sequences of numbers after the os << x and is >> y pair.
Paolo.