diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-15 09:08:31 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-15 09:08:31 +0000 |
commit | 4efa14b9c6528aecba4a8388a9c922a96edbf171 (patch) | |
tree | 2311f301fa23d72396f9e541b8979901c08a6ad8 | |
parent | 72288b4aecd33a3bf3862606b1052bc271c406a3 (diff) | |
download | gcc-4efa14b9c6528aecba4a8388a9c922a96edbf171.tar.gz |
2006-08-15 Paolo Carlini <pcarlini@suse.de>
* include/tr1/random.tcc (mersenne_twister<>::operator()): Revert
last change (per gcc-patches/2006-08/msg00484.html).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116151 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | libstdc++-v3/ChangeLog | 5 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/random.tcc | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index bf29f818595..3998b7e1b40 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2006-08-15 Paolo Carlini <pcarlini@suse.de> + + * include/tr1/random.tcc (mersenne_twister<>::operator()): Revert + last change (per gcc-patches/2006-08/msg00484.html). + 2006-08-14 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class poisson_distribution<>): Add. diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc index 42b53a0d992..5051a96a14f 100644 --- a/libstdc++-v3/include/tr1/random.tcc +++ b/libstdc++-v3/include/tr1/random.tcc @@ -285,13 +285,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) { const _UIntType __upper_mask = (~_UIntType()) << __r; const _UIntType __lower_mask = ~__upper_mask; - const _UIntType __fx[2] = { 0, __a }; for (int __k = 0; __k < (__n - __m); ++__k) { _UIntType __y = ((_M_x[__k] & __upper_mask) | (_M_x[__k + 1] & __lower_mask)); - _M_x[__k] = _M_x[__k + __m] ^ (__y >> 1) ^ __fx[__y & 0x01]; + _M_x[__k] = (_M_x[__k + __m] ^ (__y >> 1) + ^ ((__y & 0x01) ? __a : 0)); } for (int __k = (__n - __m); __k < (__n - 1); ++__k) @@ -299,12 +299,13 @@ _GLIBCXX_BEGIN_NAMESPACE(tr1) _UIntType __y = ((_M_x[__k] & __upper_mask) | (_M_x[__k + 1] & __lower_mask)); _M_x[__k] = (_M_x[__k + (__m - __n)] ^ (__y >> 1) - ^ __fx[__y & 0x01]); + ^ ((__y & 0x01) ? __a : 0)); } _UIntType __y = ((_M_x[__n - 1] & __upper_mask) | (_M_x[0] & __lower_mask)); - _M_x[__n - 1] = _M_x[__m - 1] ^ (__y >> 1) ^ __fx[__y & 0x01]; + _M_x[__n - 1] = (_M_x[__m - 1] ^ (__y >> 1) + ^ ((__y & 0x01) ? __a : 0)); _M_p = 0; } |