gcc/libstdc++-v3/include/tr1_impl/random.tcc

1549 lines
47 KiB
Plaintext
Raw Normal View History

[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
// random number generation (out of line) -*- C++ -*-
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
// Copyright (C) 2007 Free Software Foundation, Inc.
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
/** @file tr1_impl/random.tcc
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
throw_allocator.h: Consistent @file markup. 2006-11-29 Benjamin Kosnik <bkoz@redhat.com> * include/ext/throw_allocator.h: Consistent @file markup. * include/ext/type_traits.h: Same. * include/debug/hash_map: Same. * include/debug/hash_multimap.h: Same. * include/debug/set.h: Same. * include/debug/hash_set.h: Same. * include/debug/formatter.h: Same. * include/debug/bitset: Same. * include/debug/set: Same. * include/debug/multiset.h: Same. * include/debug/safe_sequence.h: Same. * include/debug/hash_set: Same. * include/debug/functions.h: Same. * include/debug/safe_base.h: Same. * include/debug/hash_multiset.h: Same. * include/debug/safe_iterator.tcc: Same. * include/debug/vector: Same. * include/debug/map.h: Same. * include/debug/deque: Same. * include/debug/hash_map.h: Same. * include/debug/string: Same. * include/debug/macros.h: Same. * include/debug/list: Same. * include/debug/debug.h: Same. * include/debug/map: Same. * include/debug/safe_iterator.h: Same. * include/debug/multimap.h: Same. * config/cpu/generic/atomicity_mutex/atomicity.h: Same. * config/cpu/generic/atomicity_builtins/atomicity.h: Same. * config/cpu/generic/atomic_word.h: Same. * include/tr1/memory: Same. * include/tr1/random: Same. * include/std/std_queue.h: Same. * include/std/std_iterator.h: Same. * include/std/std_bitset.h: Same. * include/std/std_set.h: Same. * include/std/std_vector.h: Same. * include/std/std_deque.h: Same. * include/std/std_utility.h: Same. * include/std/std_stack.h: Same. * include/std/std_string.h: Same. * include/std/std_list.h: Same. * include/std/std_map.h: Same. * libsupc++/typeinfo: Same. * libsupc++/exception: Same. * libsupc++/exception_defines.h: Same. * libsupc++/new: Same. * include/ext/bitmap_allocator.h: Change namespace __balloc to __detail. * src/bitmap_allocator.cc: Same. * include/bits/cpp_type_traits.h: Change __true_type and __false_type from global to namespace std scope. * include/ext/slist: Same. * include/ext/vstring.h: Same. * include/ext/vstring.tcc: Same. * include/ext/rc_string_base.h: Same. * include/ext/sso_string_base.h: Same. * include/bits/codecvt.h: Adjust markup so that correct namespace scope information is in all files. * include/bits/locale_facets.h: Same. Include ctype_base directly. * config/os/windiss/ctype_base.h: Add in namespace markup. * config/os/newlib/ctype_base.h: Same. * config/os/aix/ctype_base.h: Same. * config/os/vxworks/ctype_base.h: Same. * config/os/hpux/ctype_base.h: Same. * config/os/mingw32/ctype_base.h: Same. * config/os/gnu-linux/ctype_base.h: Same. * config/os/tpf/ctype_base.h: Same. * config/os/uclibc/ctype_base.h: Same. * config/os/djgpp/ctype_base.h: Same. * config/os/qnx/qnx6.1/ctype_base.h: Same. * config/os/bsd/netbsd/ctype_base.h: Same. * config/os/bsd/darwin/ctype_base.h: Same. * config/os/bsd/freebsd/ctype_base.h: Same. * config/os/irix/irix5.2/ctype_base.h: Same. * config/os/irix/irix6.5/ctype_base.h: Same. * config/os/solaris/solaris2.5/ctype_base.h: Same. * config/os/solaris/solaris2.6/ctype_base.h: Same. * config/os/solaris/solaris2.7/ctype_base.h: Same. * config/os/generic/ctype_base.h: Same. * include/tr1/mu_iterate.h: Same. * include/tr1/tuple: Same. * include/tr1/tuple_iterate.h: Same. * include/tr1/tuple_defs.h: Same. * include/tr1/random.tcc: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Line number changes. * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Same. * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Same. * docs/doxygen/user.cfg.in: Update to doxygen 1.5.1. * docs/html/17_intro/license.html: Updated info for generated docs. * docs/doxygen/guide.html: Adjust. * docs/doxygen/run_doxygen: Adjust. * docs/doxygen/mainpage.html: Same. * docs/doxygen/doxygroups.cc: Same. * docs/doxygen/Intro.3: Same. * docs/doxygen/tables.html: Same. From-SVN: r119334
2006-11-29 21:59:22 +01:00
*/
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
namespace std
{
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_GLIBCXX_BEGIN_NAMESPACE_TR1
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
/*
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
* (Further) implementation-space details.
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
*/
namespace __detail
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
// General case for x = (ax + c) mod m -- use Schrage's algorithm to avoid
// integer overflow.
//
// Because a and c are compile-time integral constants the compiler kindly
// elides any unreachable paths.
//
// Preconditions: a > 0, m > 0.
//
template<typename _Tp, _Tp __a, _Tp __c, _Tp __m, bool>
struct _Mod
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
static _Tp
__calc(_Tp __x)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
if (__a == 1)
__x %= __m;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
else
{
static const _Tp __q = __m / __a;
static const _Tp __r = __m % __a;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
_Tp __t1 = __a * (__x % __q);
_Tp __t2 = __r * (__x / __q);
if (__t1 >= __t2)
__x = __t1 - __t2;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
else
__x = __m - __t2 + __t1;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
if (__c != 0)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
const _Tp __d = __m - __x;
if (__d > __c)
__x += __c;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
else
__x = __c - __d;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
return __x;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
};
// Special case for m == 0 -- use unsigned integer overflow as modulo
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
// operator.
template<typename _Tp, _Tp __a, _Tp __c, _Tp __m>
struct _Mod<_Tp, __a, __c, __m, true>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
static _Tp
__calc(_Tp __x)
{ return __a * __x + __c; }
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
};
} // namespace __detail
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
/**
* Seeds the LCR with integral value @p __x0, adjusted so that the
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
* ring identity is never a member of the convergence set.
*/
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
void
linear_congruential<_UIntType, __a, __c, __m>::
seed(unsigned long __x0)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
if ((__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0)
&& (__detail::__mod<_UIntType, 1, 0, __m>(__x0) == 0))
_M_x = __detail::__mod<_UIntType, 1, 0, __m>(1);
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
else
_M_x = __detail::__mod<_UIntType, 1, 0, __m>(__x0);
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
/**
* Seeds the LCR engine with a value generated by @p __g.
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
*/
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
template<class _Gen>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
void
linear_congruential<_UIntType, __a, __c, __m>::
seed(_Gen& __g, false_type)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
_UIntType __x0 = __g();
if ((__detail::__mod<_UIntType, 1, 0, __m>(__c) == 0)
&& (__detail::__mod<_UIntType, 1, 0, __m>(__x0) == 0))
_M_x = __detail::__mod<_UIntType, 1, 0, __m>(1);
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
else
_M_x = __detail::__mod<_UIntType, 1, 0, __m>(__x0);
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
/**
* Gets the next generated value in sequence.
*/
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m>
typename linear_congruential<_UIntType, __a, __c, __m>::result_type
linear_congruential<_UIntType, __a, __c, __m>::
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
operator()()
{
_M_x = __detail::__mod<_UIntType, __a, __c, __m>(_M_x);
return _M_x;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const linear_congruential<_UIntType, __a, __c, __m>& __lcr)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
__os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
__os.fill(__os.widen(' '));
__os << __lcr._M_x;
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<class _UIntType, _UIntType __a, _UIntType __c, _UIntType __m,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
linear_congruential<_UIntType, __a, __c, __m>& __lcr)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec);
__is >> __lcr._M_x;
__is.flags(__flags);
return __is;
}
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
void
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::
seed(unsigned long __value)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
_M_x[0] = __detail::__mod<_UIntType, 1, 0,
__detail::_Shift<_UIntType, __w>::__value>(__value);
for (int __i = 1; __i < state_size; ++__i)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
_UIntType __x = _M_x[__i - 1];
__x ^= __x >> (__w - 2);
__x *= 1812433253ul;
__x += __i;
_M_x[__i] = __detail::__mod<_UIntType, 1, 0,
__detail::_Shift<_UIntType, __w>::__value>(__x);
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
_M_p = state_size;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
template<class _Gen>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
void
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::
seed(_Gen& __gen, false_type)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
for (int __i = 0; __i < state_size; ++__i)
_M_x[__i] = __detail::__mod<_UIntType, 1, 0,
__detail::_Shift<_UIntType, __w>::__value>(__gen());
_M_p = state_size;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s,
_UIntType __b, int __t, _UIntType __c, int __l>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
typename
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::result_type
mersenne_twister<_UIntType, __w, __n, __m, __r, __a, __u, __s,
__b, __t, __c, __l>::
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
operator()()
{
// Reload the vector - cost is O(n) amortized over n calls.
if (_M_p >= state_size)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
const _UIntType __upper_mask = (~_UIntType()) << __r;
const _UIntType __lower_mask = ~__upper_mask;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
for (int __k = 0; __k < (__n - __m); ++__k)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
_UIntType __y = ((_M_x[__k] & __upper_mask)
| (_M_x[__k + 1] & __lower_mask));
_M_x[__k] = (_M_x[__k + __m] ^ (__y >> 1)
^ ((__y & 0x01) ? __a : 0));
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
for (int __k = (__n - __m); __k < (__n - 1); ++__k)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
_UIntType __y = ((_M_x[__k] & __upper_mask)
| (_M_x[__k + 1] & __lower_mask));
_M_x[__k] = (_M_x[__k + (__m - __n)] ^ (__y >> 1)
^ ((__y & 0x01) ? __a : 0));
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
_UIntType __y = ((_M_x[__n - 1] & __upper_mask)
| (_M_x[0] & __lower_mask));
_M_x[__n - 1] = (_M_x[__m - 1] ^ (__y >> 1)
^ ((__y & 0x01) ? __a : 0));
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
_M_p = 0;
}
// Calculate o(x(i)).
result_type __z = _M_x[_M_p++];
__z ^= (__z >> __u);
__z ^= (__z << __s) & __b;
__z ^= (__z << __t) & __c;
__z ^= (__z >> __l);
return __z;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s, _UIntType __b, int __t,
_UIntType __c, int __l,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const mersenne_twister<_UIntType, __w, __n, __m,
__r, __a, __u, __s, __b, __t, __c, __l>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
__os.fill(__space);
for (int __i = 0; __i < __n - 1; ++__i)
__os << __x._M_x[__i] << __space;
__os << __x._M_x[__n - 1];
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<class _UIntType, int __w, int __n, int __m, int __r,
_UIntType __a, int __u, int __s, _UIntType __b, int __t,
_UIntType __c, int __l,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
mersenne_twister<_UIntType, __w, __n, __m,
__r, __a, __u, __s, __b, __t, __c, __l>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
for (int __i = 0; __i < __n; ++__i)
__is >> __x._M_x[__i];
__is.flags(__flags);
return __is;
}
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
template<typename _IntType, _IntType __m, int __s, int __r>
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
void
subtract_with_carry<_IntType, __m, __s, __r>::
seed(unsigned long __value)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
if (__value == 0)
__value = 19780503;
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
std::_GLIBCXX_TR1 linear_congruential<unsigned long, 40014, 0, 2147483563>
__lcg(__value);
for (int __i = 0; __i < long_lag; ++__i)
_M_x[__i] = __detail::__mod<_UIntType, 1, 0, modulus>(__lcg());
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
_M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0;
_M_p = 0;
}
template<typename _IntType, _IntType __m, int __s, int __r>
template<class _Gen>
void
subtract_with_carry<_IntType, __m, __s, __r>::
seed(_Gen& __gen, false_type)
{
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
const int __n = (std::numeric_limits<_UIntType>::digits + 31) / 32;
for (int __i = 0; __i < long_lag; ++__i)
{
_UIntType __tmp = 0;
_UIntType __factor = 1;
for (int __j = 0; __j < __n; ++__j)
{
__tmp += __detail::__mod<__detail::_UInt32Type, 1, 0, 0>
(__gen()) * __factor;
__factor *= __detail::_Shift<_UIntType, 32>::__value;
}
_M_x[__i] = __detail::__mod<_UIntType, 1, 0, modulus>(__tmp);
}
_M_carry = (_M_x[long_lag - 1] == 0) ? 1 : 0;
_M_p = 0;
}
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
template<typename _IntType, _IntType __m, int __s, int __r>
typename subtract_with_carry<_IntType, __m, __s, __r>::result_type
subtract_with_carry<_IntType, __m, __s, __r>::
operator()()
{
// Derive short lag index from current index.
int __ps = _M_p - short_lag;
if (__ps < 0)
__ps += long_lag;
// Calculate new x(i) without overflow or division.
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
// NB: Thanks to the requirements for _IntType, _M_x[_M_p] + _M_carry
// cannot overflow.
_UIntType __xi;
if (_M_x[__ps] >= _M_x[_M_p] + _M_carry)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
{
__xi = _M_x[__ps] - _M_x[_M_p] - _M_carry;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
_M_carry = 0;
}
else
{
__xi = modulus - _M_x[_M_p] - _M_carry + _M_x[__ps];
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
_M_carry = 1;
}
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
_M_x[_M_p] = __xi;
// Adjust current index to loop around in ring buffer.
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
if (++_M_p >= long_lag)
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
_M_p = 0;
return __xi;
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}
template<typename _IntType, _IntType __m, int __s, int __r,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const subtract_with_carry<_IntType, __m, __s, __r>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
__os.fill(__space);
for (int __i = 0; __i < __r; ++__i)
__os << __x._M_x[__i] << __space;
__os << __x._M_carry;
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<typename _IntType, _IntType __m, int __s, int __r,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
subtract_with_carry<_IntType, __m, __s, __r>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
for (int __i = 0; __i < __r; ++__i)
__is >> __x._M_x[__i];
__is >> __x._M_carry;
__is.flags(__flags);
return __is;
}
template<typename _RealType, int __w, int __s, int __r>
void
subtract_with_carry_01<_RealType, __w, __s, __r>::
_M_initialize_npows()
{
for (int __j = 0; __j < __n; ++__j)
#if _GLIBCXX_USE_C99_MATH_TR1
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_M_npows[__j] = std::_GLIBCXX_TR1 ldexp(_RealType(1), -__w + __j * 32);
#else
_M_npows[__j] = std::pow(_RealType(2), -__w + __j * 32);
#endif
}
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
template<typename _RealType, int __w, int __s, int __r>
void
subtract_with_carry_01<_RealType, __w, __s, __r>::
seed(unsigned long __value)
{
if (__value == 0)
__value = 19780503;
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 512. Seeding subtract_with_carry_01 from a single unsigned long.
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
std::_GLIBCXX_TR1 linear_congruential<unsigned long, 40014, 0, 2147483563>
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
__lcg(__value);
this->seed(__lcg);
}
template<typename _RealType, int __w, int __s, int __r>
template<class _Gen>
void
subtract_with_carry_01<_RealType, __w, __s, __r>::
seed(_Gen& __gen, false_type)
{
for (int __i = 0; __i < long_lag; ++__i)
{
for (int __j = 0; __j < __n - 1; ++__j)
_M_x[__i][__j] = __detail::__mod<_UInt32Type, 1, 0, 0>(__gen());
_M_x[__i][__n - 1] = __detail::__mod<_UInt32Type, 1, 0,
__detail::_Shift<_UInt32Type, __w % 32>::__value>(__gen());
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
}
_M_carry = 1;
for (int __j = 0; __j < __n; ++__j)
if (_M_x[long_lag - 1][__j] != 0)
{
_M_carry = 0;
break;
}
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
_M_p = 0;
}
template<typename _RealType, int __w, int __s, int __r>
typename subtract_with_carry_01<_RealType, __w, __s, __r>::result_type
subtract_with_carry_01<_RealType, __w, __s, __r>::
operator()()
{
// Derive short lag index from current index.
int __ps = _M_p - short_lag;
if (__ps < 0)
__ps += long_lag;
_UInt32Type __new_carry;
for (int __j = 0; __j < __n - 1; ++__j)
{
if (_M_x[__ps][__j] > _M_x[_M_p][__j]
|| (_M_x[__ps][__j] == _M_x[_M_p][__j] && _M_carry == 0))
__new_carry = 0;
else
__new_carry = 1;
_M_x[_M_p][__j] = _M_x[__ps][__j] - _M_x[_M_p][__j] - _M_carry;
_M_carry = __new_carry;
}
if (_M_x[__ps][__n - 1] > _M_x[_M_p][__n - 1]
|| (_M_x[__ps][__n - 1] == _M_x[_M_p][__n - 1] && _M_carry == 0))
__new_carry = 0;
else
__new_carry = 1;
_M_x[_M_p][__n - 1] = __detail::__mod<_UInt32Type, 1, 0,
__detail::_Shift<_UInt32Type, __w % 32>::__value>
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
(_M_x[__ps][__n - 1] - _M_x[_M_p][__n - 1] - _M_carry);
_M_carry = __new_carry;
result_type __ret = 0.0;
for (int __j = 0; __j < __n; ++__j)
__ret += _M_x[_M_p][__j] * _M_npows[__j];
// Adjust current index to loop around in ring buffer.
if (++_M_p >= long_lag)
_M_p = 0;
return __ret;
}
template<typename _RealType, int __w, int __s, int __r,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const subtract_with_carry_01<_RealType, __w, __s, __r>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
const _CharT __fill = __os.fill();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
__os.fill(__space);
for (int __i = 0; __i < __r; ++__i)
for (int __j = 0; __j < __x.__n; ++__j)
__os << __x._M_x[__i][__j] << __space;
__os << __x._M_carry;
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<typename _RealType, int __w, int __s, int __r,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
subtract_with_carry_01<_RealType, __w, __s, __r>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
random (class subtract_with_carry_01): Add. 2006-08-22 Paolo Carlini <pcarlini@suse.de> * include/tr1/random (class subtract_with_carry_01): Add. * include/tr1/random.tcc (subtract_with_carry_01<>:: seed(unsigned long), subtract_with_carry_01<>:: seed(_Gen&, false_type), subtract_with_carry_01<>:: operator(), operator<<(std::basic_ostream<>&, const subtract_with_carry_01<>&), operator>>(std::basic_istream<>&, subtract_with_carry_01<>&)): Define. * testsuite/tr1/5_numerical_facilities/random/ranlux3_01.cc: New. * testsuite/tr1/5_numerical_facilities/random/ranlux4_01.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry_01/operators/serialize.cc: Likewise. * docs/html/ext/howto.html: Add two implemented TR1 issues. * include/tr1/random.tcc (struct _To_Unsigned_Type): Move... * include/tr1/random: ... here. (class subtract_with_carry): Use it everywhere. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed1.cc: Qualify 1 as 1UL. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilities/random/ subtract_with_carry/operators/serialize.cc: Likewise. From-SVN: r116327
2006-08-22 20:07:55 +02:00
for (int __i = 0; __i < __r; ++__i)
for (int __j = 0; __j < __x.__n; ++__j)
__is >> __x._M_x[__i][__j];
__is >> __x._M_carry;
__is.flags(__flags);
return __is;
}
template<class _UniformRandomNumberGenerator, int __p, int __r>
typename discard_block<_UniformRandomNumberGenerator,
__p, __r>::result_type
discard_block<_UniformRandomNumberGenerator, __p, __r>::
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
operator()()
{
if (_M_n >= used_block)
{
while (_M_n < block_size)
{
_M_b();
++_M_n;
}
_M_n = 0;
}
++_M_n;
return _M_b();
}
template<class _UniformRandomNumberGenerator, int __p, int __r,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const discard_block<_UniformRandomNumberGenerator,
__p, __r>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::dec | __ios_base::fixed
| __ios_base::left);
__os.fill(__space);
__os << __x._M_b << __space << __x._M_n;
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<class _UniformRandomNumberGenerator, int __p, int __r,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
discard_block<_UniformRandomNumberGenerator, __p, __r>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
__is >> __x._M_b >> __x._M_n;
__is.flags(__flags);
return __is;
}
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2>
void
xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::
_M_initialize_max()
{
const int __w = std::numeric_limits<result_type>::digits;
const result_type __m1 =
std::min(result_type(_M_b1.max() - _M_b1.min()),
__detail::_Shift<result_type, __w - __s1>::__value - 1);
const result_type __m2 =
std::min(result_type(_M_b2.max() - _M_b2.min()),
__detail::_Shift<result_type, __w - __s2>::__value - 1);
// NB: In TR1 s1 is not required to be >= s2.
if (__s1 < __s2)
_M_max = _M_initialize_max_aux(__m2, __m1, __s2 - __s1) << __s1;
else
_M_max = _M_initialize_max_aux(__m1, __m2, __s1 - __s2) << __s2;
}
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2>
typename xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::result_type
xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>::
_M_initialize_max_aux(result_type __a, result_type __b, int __d)
{
const result_type __two2d = result_type(1) << __d;
const result_type __c = __a * __two2d;
if (__a == 0 || __b < __two2d)
return __c + __b;
const result_type __t = std::max(__c, __b);
const result_type __u = std::min(__c, __b);
result_type __ub = __u;
result_type __p;
for (__p = 0; __ub != 1; __ub >>= 1)
++__p;
const result_type __two2p = result_type(1) << __p;
const result_type __k = __t / __two2p;
if (__k & 1)
return (__k + 1) * __two2p - 1;
if (__c >= __b)
return (__k + 1) * __two2p + _M_initialize_max_aux((__t % __two2p)
/ __two2d,
__u % __two2p, __d);
else
return (__k + 1) * __two2p + _M_initialize_max_aux((__u % __two2p)
/ __two2d,
__t % __two2p, __d);
}
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left);
__os.fill(__space);
__os << __x.base1() << __space << __x.base2();
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<class _UniformRandomNumberGenerator1, int __s1,
class _UniformRandomNumberGenerator2, int __s2,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
xor_combine<_UniformRandomNumberGenerator1, __s1,
_UniformRandomNumberGenerator2, __s2>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::skipws);
__is >> __x._M_b1 >> __x._M_b2;
__is.flags(__flags);
return __is;
}
template<typename _IntType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const uniform_int<_IntType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__space);
__os << __x.min() << __space << __x.max();
__os.flags(__flags);
__os.fill(__fill);
return __os;
}
template<typename _IntType, typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
uniform_int<_IntType>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
__is >> __x._M_min >> __x._M_max;
__is.flags(__flags);
return __is;
}
template<typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const bernoulli_distribution& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__os.widen(' '));
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<double>::__max_digits10);
__os << __x.p();
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
template<typename _IntType, typename _RealType>
template<class _UniformRandomNumberGenerator>
typename geometric_distribution<_IntType, _RealType>::result_type
geometric_distribution<_IntType, _RealType>::
operator()(_UniformRandomNumberGenerator& __urng)
{
// About the epsilon thing see this thread:
// http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00971.html
const _RealType __naf =
(1 - std::numeric_limits<_RealType>::epsilon()) / 2;
// The largest _RealType convertible to _IntType.
const _RealType __thr =
std::numeric_limits<_IntType>::max() + __naf;
_RealType __cand;
do
__cand = std::ceil(std::log(__urng()) / _M_log_p);
while (__cand >= __thr);
return result_type(__cand + __naf);
}
template<typename _IntType, typename _RealType,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const geometric_distribution<_IntType, _RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__os.widen(' '));
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.p();
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
template<typename _IntType, typename _RealType>
void
poisson_distribution<_IntType, _RealType>::
_M_initialize()
{
#if _GLIBCXX_USE_C99_MATH_TR1
if (_M_mean >= 12)
{
const _RealType __m = std::floor(_M_mean);
_M_lm_thr = std::log(_M_mean);
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_M_lfm = std::_GLIBCXX_TR1 lgamma(__m + 1);
_M_sm = std::sqrt(__m);
const _RealType __pi_4 = 0.7853981633974483096156608458198757L;
const _RealType __dx = std::sqrt(2 * __m * std::log(32 * __m
/ __pi_4));
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_M_d = std::_GLIBCXX_TR1 round(std::max(_RealType(6),
std::min(__m, __dx)));
const _RealType __cx = 2 * __m + _M_d;
_M_scx = std::sqrt(__cx / 2);
_M_1cx = 1 / __cx;
_M_c2b = std::sqrt(__pi_4 * __cx) * std::exp(_M_1cx);
_M_cb = 2 * __cx * std::exp(-_M_d * _M_1cx * (1 + _M_d / 2)) / _M_d;
}
else
#endif
_M_lm_thr = std::exp(-_M_mean);
}
/**
* A rejection algorithm when mean >= 12 and a simple method based
* upon the multiplication of uniform random variates otherwise.
* NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
* is defined.
*
* Reference:
* Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
* New York, 1986, Ch. X, Sects. 3.3 & 3.4 (+ Errata!).
*/
template<typename _IntType, typename _RealType>
template<class _UniformRandomNumberGenerator>
typename poisson_distribution<_IntType, _RealType>::result_type
poisson_distribution<_IntType, _RealType>::
operator()(_UniformRandomNumberGenerator& __urng)
{
#if _GLIBCXX_USE_C99_MATH_TR1
if (_M_mean >= 12)
{
_RealType __x;
// See comments above...
const _RealType __naf =
(1 - std::numeric_limits<_RealType>::epsilon()) / 2;
const _RealType __thr =
std::numeric_limits<_IntType>::max() + __naf;
const _RealType __m = std::floor(_M_mean);
// sqrt(pi / 2)
const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
const _RealType __c1 = _M_sm * __spi_2;
const _RealType __c2 = _M_c2b + __c1;
const _RealType __c3 = __c2 + 1;
const _RealType __c4 = __c3 + 1;
// e^(1 / 78)
const _RealType __e178 = 1.0129030479320018583185514777512983L;
const _RealType __c5 = __c4 + __e178;
const _RealType __c = _M_cb + __c5;
const _RealType __2cx = 2 * (2 * __m + _M_d);
bool __reject = true;
do
{
const _RealType __u = __c * __urng();
const _RealType __e = -std::log(__urng());
_RealType __w = 0.0;
if (__u <= __c1)
{
const _RealType __n = _M_nd(__urng);
const _RealType __y = -std::abs(__n) * _M_sm - 1;
__x = std::floor(__y);
__w = -__n * __n / 2;
if (__x < -__m)
continue;
}
else if (__u <= __c2)
{
const _RealType __n = _M_nd(__urng);
const _RealType __y = 1 + std::abs(__n) * _M_scx;
__x = std::ceil(__y);
__w = __y * (2 - __y) * _M_1cx;
if (__x > _M_d)
continue;
}
else if (__u <= __c3)
// NB: This case not in the book, nor in the Errata,
// but should be ok...
__x = -1;
else if (__u <= __c4)
__x = 0;
else if (__u <= __c5)
__x = 1;
else
{
const _RealType __v = -std::log(__urng());
const _RealType __y = _M_d + __v * __2cx / _M_d;
__x = std::ceil(__y);
__w = -_M_d * _M_1cx * (1 + __y / 2);
}
__reject = (__w - __e - __x * _M_lm_thr
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
> _M_lfm - std::_GLIBCXX_TR1 lgamma(__x + __m + 1));
__reject |= __x + __m >= __thr;
} while (__reject);
return result_type(__x + __m + __naf);
}
else
#endif
{
_IntType __x = 0;
_RealType __prod = 1.0;
do
{
__prod *= __urng();
__x += 1;
}
while (__prod > _M_lm_thr);
return __x - 1;
}
}
template<typename _IntType, typename _RealType,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const poisson_distribution<_IntType, _RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__space);
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.mean() << __space << __x._M_nd;
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
template<typename _IntType, typename _RealType,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
poisson_distribution<_IntType, _RealType>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::skipws);
__is >> __x._M_mean >> __x._M_nd;
__x._M_initialize();
__is.flags(__flags);
return __is;
}
template<typename _IntType, typename _RealType>
void
binomial_distribution<_IntType, _RealType>::
_M_initialize()
{
const _RealType __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p;
_M_easy = true;
#if _GLIBCXX_USE_C99_MATH_TR1
if (_M_t * __p12 >= 8)
{
_M_easy = false;
const _RealType __np = std::floor(_M_t * __p12);
const _RealType __pa = __np / _M_t;
const _RealType __1p = 1 - __pa;
const _RealType __pi_4 = 0.7853981633974483096156608458198757L;
const _RealType __d1x =
std::sqrt(__np * __1p * std::log(32 * __np
/ (81 * __pi_4 * __1p)));
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_M_d1 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d1x));
const _RealType __d2x =
std::sqrt(__np * __1p * std::log(32 * _M_t * __1p
/ (__pi_4 * __pa)));
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_M_d2 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d2x));
// sqrt(pi / 2)
const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
_M_s1 = std::sqrt(__np * __1p) * (1 + _M_d1 / (4 * __np));
_M_s2 = std::sqrt(__np * __1p) * (1 + _M_d2 / (4 * _M_t * __1p));
_M_c = 2 * _M_d1 / __np;
_M_a1 = std::exp(_M_c) * _M_s1 * __spi_2;
const _RealType __a12 = _M_a1 + _M_s2 * __spi_2;
const _RealType __s1s = _M_s1 * _M_s1;
_M_a123 = __a12 + (std::exp(_M_d1 / (_M_t * __1p))
* 2 * __s1s / _M_d1
* std::exp(-_M_d1 * _M_d1 / (2 * __s1s)));
const _RealType __s2s = _M_s2 * _M_s2;
_M_s = (_M_a123 + 2 * __s2s / _M_d2
* std::exp(-_M_d2 * _M_d2 / (2 * __s2s)));
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_M_lf = (std::_GLIBCXX_TR1 lgamma(__np + 1)
+ std::_GLIBCXX_TR1 lgamma(_M_t - __np + 1));
_M_lp1p = std::log(__pa / __1p);
_M_q = -std::log(1 - (__p12 - __pa) / __1p);
}
else
#endif
_M_q = -std::log(1 - __p12);
}
template<typename _IntType, typename _RealType>
template<class _UniformRandomNumberGenerator>
typename binomial_distribution<_IntType, _RealType>::result_type
binomial_distribution<_IntType, _RealType>::
_M_waiting(_UniformRandomNumberGenerator& __urng, _IntType __t)
{
_IntType __x = 0;
_RealType __sum = 0;
do
{
const _RealType __e = -std::log(__urng());
__sum += __e / (__t - __x);
__x += 1;
}
while (__sum <= _M_q);
return __x - 1;
}
/**
* A rejection algorithm when t * p >= 8 and a simple waiting time
* method - the second in the referenced book - otherwise.
* NB: The former is available only if _GLIBCXX_USE_C99_MATH_TR1
* is defined.
*
* Reference:
* Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
* New York, 1986, Ch. X, Sect. 4 (+ Errata!).
*/
template<typename _IntType, typename _RealType>
template<class _UniformRandomNumberGenerator>
typename binomial_distribution<_IntType, _RealType>::result_type
binomial_distribution<_IntType, _RealType>::
operator()(_UniformRandomNumberGenerator& __urng)
{
result_type __ret;
const _RealType __p12 = _M_p <= 0.5 ? _M_p : 1.0 - _M_p;
#if _GLIBCXX_USE_C99_MATH_TR1
if (!_M_easy)
{
_RealType __x;
// See comments above...
const _RealType __naf =
(1 - std::numeric_limits<_RealType>::epsilon()) / 2;
const _RealType __thr =
std::numeric_limits<_IntType>::max() + __naf;
const _RealType __np = std::floor(_M_t * __p12);
const _RealType __pa = __np / _M_t;
// sqrt(pi / 2)
const _RealType __spi_2 = 1.2533141373155002512078826424055226L;
const _RealType __a1 = _M_a1;
const _RealType __a12 = __a1 + _M_s2 * __spi_2;
const _RealType __a123 = _M_a123;
const _RealType __s1s = _M_s1 * _M_s1;
const _RealType __s2s = _M_s2 * _M_s2;
bool __reject;
do
{
const _RealType __u = _M_s * __urng();
_RealType __v;
if (__u <= __a1)
{
const _RealType __n = _M_nd(__urng);
const _RealType __y = _M_s1 * std::abs(__n);
__reject = __y >= _M_d1;
if (!__reject)
{
const _RealType __e = -std::log(__urng());
__x = std::floor(__y);
__v = -__e - __n * __n / 2 + _M_c;
}
}
else if (__u <= __a12)
{
const _RealType __n = _M_nd(__urng);
const _RealType __y = _M_s2 * std::abs(__n);
__reject = __y >= _M_d2;
if (!__reject)
{
const _RealType __e = -std::log(__urng());
__x = std::floor(-__y);
__v = -__e - __n * __n / 2;
}
}
else if (__u <= __a123)
{
const _RealType __e1 = -std::log(__urng());
const _RealType __e2 = -std::log(__urng());
const _RealType __y = _M_d1 + 2 * __s1s * __e1 / _M_d1;
__x = std::floor(__y);
__v = (-__e2 + _M_d1 * (1 / (_M_t - __np)
-__y / (2 * __s1s)));
__reject = false;
}
else
{
const _RealType __e1 = -std::log(__urng());
const _RealType __e2 = -std::log(__urng());
const _RealType __y = _M_d2 + 2 * __s2s * __e1 / _M_d2;
__x = std::floor(-__y);
__v = -__e2 - _M_d2 * __y / (2 * __s2s);
__reject = false;
}
__reject = __reject || __x < -__np || __x > _M_t - __np;
if (!__reject)
{
const _RealType __lfx =
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
std::_GLIBCXX_TR1 lgamma(__np + __x + 1)
+ std::_GLIBCXX_TR1 lgamma(_M_t - (__np + __x) + 1);
__reject = __v > _M_lf - __lfx + __x * _M_lp1p;
}
__reject |= __x + __np >= __thr;
}
while (__reject);
__x += __np + __naf;
const _IntType __z = _M_waiting(__urng, _M_t - _IntType(__x));
__ret = _IntType(__x) + __z;
}
else
#endif
__ret = _M_waiting(__urng, _M_t);
if (__p12 != _M_p)
__ret = _M_t - __ret;
return __ret;
}
template<typename _IntType, typename _RealType,
typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const binomial_distribution<_IntType, _RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__space);
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.t() << __space << __x.p()
<< __space << __x._M_nd;
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
template<typename _IntType, typename _RealType,
typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
binomial_distribution<_IntType, _RealType>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
__is >> __x._M_t >> __x._M_p >> __x._M_nd;
__x._M_initialize();
__is.flags(__flags);
return __is;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const uniform_real<_RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__space);
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.min() << __space << __x.max();
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
uniform_real<_RealType>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::skipws);
__is >> __x._M_min >> __x._M_max;
__is.flags(__flags);
return __is;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const exponential_distribution<_RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__os.widen(' '));
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.lambda();
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
/**
* Polar method due to Marsaglia.
*
* Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
* New York, 1986, Ch. V, Sect. 4.4.
*/
template<typename _RealType>
template<class _UniformRandomNumberGenerator>
typename normal_distribution<_RealType>::result_type
normal_distribution<_RealType>::
operator()(_UniformRandomNumberGenerator& __urng)
{
result_type __ret;
if (_M_saved_available)
{
_M_saved_available = false;
__ret = _M_saved;
}
else
{
result_type __x, __y, __r2;
do
{
__x = result_type(2.0) * __urng() - 1.0;
__y = result_type(2.0) * __urng() - 1.0;
__r2 = __x * __x + __y * __y;
}
while (__r2 > 1.0 || __r2 == 0.0);
const result_type __mult = std::sqrt(-2 * std::log(__r2) / __r2);
_M_saved = __x * __mult;
_M_saved_available = true;
__ret = __y * __mult;
}
__ret = __ret * _M_sigma + _M_mean;
return __ret;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const normal_distribution<_RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
const _CharT __space = __os.widen(' ');
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__space);
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x._M_saved_available << __space
<< __x.mean() << __space
<< __x.sigma();
if (__x._M_saved_available)
__os << __space << __x._M_saved;
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_istream<_CharT, _Traits>&
operator>>(std::basic_istream<_CharT, _Traits>& __is,
normal_distribution<_RealType>& __x)
{
typedef std::basic_istream<_CharT, _Traits> __istream_type;
typedef typename __istream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __is.flags();
__is.flags(__ios_base::dec | __ios_base::skipws);
__is >> __x._M_saved_available >> __x._M_mean
>> __x._M_sigma;
if (__x._M_saved_available)
__is >> __x._M_saved;
__is.flags(__flags);
return __is;
}
template<typename _RealType>
void
gamma_distribution<_RealType>::
_M_initialize()
{
if (_M_alpha >= 1)
_M_l_d = std::sqrt(2 * _M_alpha - 1);
else
_M_l_d = (std::pow(_M_alpha, _M_alpha / (1 - _M_alpha))
* (1 - _M_alpha));
}
/**
* Cheng's rejection algorithm GB for alpha >= 1 and a modification
* of Vaduva's rejection from Weibull algorithm due to Devroye for
* alpha < 1.
*
* References:
* Cheng, R. C. "The Generation of Gamma Random Variables with Non-integral
* Shape Parameter." Applied Statistics, 26, 71-75, 1977.
*
* Vaduva, I. "Computer Generation of Gamma Gandom Variables by Rejection
* and Composition Procedures." Math. Operationsforschung and Statistik,
* Series in Statistics, 8, 545-576, 1977.
*
* Devroye, L. "Non-Uniform Random Variates Generation." Springer-Verlag,
* New York, 1986, Ch. IX, Sect. 3.4 (+ Errata!).
*/
template<typename _RealType>
template<class _UniformRandomNumberGenerator>
typename gamma_distribution<_RealType>::result_type
gamma_distribution<_RealType>::
operator()(_UniformRandomNumberGenerator& __urng)
{
result_type __x;
bool __reject;
if (_M_alpha >= 1)
{
// alpha - log(4)
const result_type __b = _M_alpha
- result_type(1.3862943611198906188344642429163531L);
const result_type __c = _M_alpha + _M_l_d;
const result_type __1l = 1 / _M_l_d;
// 1 + log(9 / 2)
const result_type __k = 2.5040773967762740733732583523868748L;
do
{
const result_type __u = __urng();
const result_type __v = __urng();
const result_type __y = __1l * std::log(__v / (1 - __v));
__x = _M_alpha * std::exp(__y);
const result_type __z = __u * __v * __v;
const result_type __r = __b + __c * __y - __x;
__reject = __r < result_type(4.5) * __z - __k;
if (__reject)
__reject = __r < std::log(__z);
}
while (__reject);
}
else
{
const result_type __c = 1 / _M_alpha;
do
{
const result_type __z = -std::log(__urng());
const result_type __e = -std::log(__urng());
__x = std::pow(__z, __c);
__reject = __z + __e < _M_l_d + __x;
}
while (__reject);
}
return __x;
}
template<typename _RealType, typename _CharT, typename _Traits>
std::basic_ostream<_CharT, _Traits>&
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
const gamma_distribution<_RealType>& __x)
{
typedef std::basic_ostream<_CharT, _Traits> __ostream_type;
typedef typename __ostream_type::ios_base __ios_base;
const typename __ios_base::fmtflags __flags = __os.flags();
const _CharT __fill = __os.fill();
const std::streamsize __precision = __os.precision();
__os.flags(__ios_base::scientific | __ios_base::left);
__os.fill(__os.widen(' '));
type_traits.h: New. 2006-09-18 Benjamin Kosnik <bkoz@redhat.com> Peter Doerfler <gcc@pdoerfler.com> Paolo Carlini <pcarlini@suse.de> * include/ext/type_traits.h: New. (__conditional_type): New. (__numeric_traits): New. (__add_unsigned): New. (__remove_unsigned): New. (__enable_if): New. * include/Makefile.am: Add. * include/Makefile.in: Regenerate. * include/ext/pb_ds/detail/type_utils.hpp: Use ext include, remove duplicates. * include/tr1/hashtable_policy.h (IF): Use __conditional_type. (_Max_digits10): Same. (identity): Use _Identity. (extract1st): Use _Select1st. * include/tr1/random (_Select): Use __conditional_type. (_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups. * include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use __add_unsigned. * include/tr1/random.tcc: Fixups as above. * include/tr1/unordered_map: Same. * include/tr1/hashtable: Same. * include/tr1/unordered_set: Same. * include/ext/pb_ds/detail/gp_hash_table_map_/ standard_policies.hpp: Same. * include/ext/pb_ds/detail/standard_policies.hpp: Same. * include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same. * include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same. * include/ext/pb_ds/detail/type_utils.hpp: Same. * include/ext/pb_ds/trie_policy.hpp: Same. * docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same. * include/bits/cpp_type_traits.h (__enable_if): Move to ext, make boolean argument first. * include/bits/locale_facets.h: Fixups for __enable_if argument and namespace switch. * include/bits/stl_algobase.h: Same. * include/bits/stl_algo.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/streambuf_iterator.h: Same. * include/debug/safe_iterator.h: Same. * include/tr1/hashtable_policy.h: Same. * include/tr1/cmath: Same. * include/tr1/functional: Same. * include/tr1/functional_iterate.h: Same. * include/std/std_streambuf.h: Same. * include/c_std/std_cmath.h: Same. * testsuite/util/testsuite_tr1.h: Same. * testsuite/util/performance/assoc/multimap_common_type.hpp: Same. Co-Authored-By: Paolo Carlini <pcarlini@suse.de> Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com> From-SVN: r117024
2006-09-18 15:30:56 +02:00
__os.precision(__gnu_cxx::__numeric_traits<_RealType>::__max_digits10);
__os << __x.alpha();
__os.flags(__flags);
__os.fill(__fill);
__os.precision(__precision);
return __os;
}
re PR libstdc++/31426 (TR1 includes do not work with -std=c++0x) 2007-05-31 Paolo Carlini <pcarlini@suse.de> PR libstdc++/31426 * include/bits/c++config: Remove namespace association bits from tr1 to std. * include/ext/type_traits.h (__promote, __promote2, __promote3, __promote4): Add. * include/bits/hashtable.h: New. * include/bits/functional_hash.h: Likewise. * include/tr1/hashtable.h: Likewise. * include/tr1_impl/random: New. * include/tr1_impl/cinttypes: Likewise. * include/tr1_impl/cstdlib: Likewise. * include/tr1_impl/unordered_map: Likewise. * include/tr1_impl/cstdio: Likewise. * include/tr1_impl/boost_shared_ptr.h: Likewise. * include/tr1_impl/cctype: Likewise. * include/tr1_impl/random.tcc: Likewise. * include/tr1_impl/tuple: Likewise. * include/tr1_impl/functional_hash.h: Likewise. * include/tr1_impl/hashtable: Likewise. * include/tr1_impl/cmath: Likewise. * include/tr1_impl/type_traitsfwd.h: Likewise. * include/tr1_impl/hashtable_policy.h: Likewise. * include/tr1_impl/cfenv: Likewise. * include/tr1_impl/unordered_set: Likewise. * include/tr1_impl/functional: Likewise. * include/tr1_impl/utility: Likewise. * include/tr1_impl/complex: Likewise. * include/tr1_impl/type_traits: Likewise. * include/tr1_impl/cwchar: Likewise. * include/tr1_impl/cstdint: Likewise. * include/tr1_impl/regex: Likewise. * include/tr1_impl/array: Likewise. * include/tr1_impl/cwctype: Likewise. * include/tr1/type_traitsfwd.h: Remove. * include/tr1/boost_shared_ptr.h: Likewise. * include/tr1/common.h: Likewise. * include/tr1/hashtable: Likewise. * include/tr1/hashtable_policy.h: Likewise. * include/tr1/random.tcc: Likewise. * include/c_global/cinttypes: Include tr1_impl/cinttypes. * include/c_global/cstdlib: Likewise for cstdlib. * include/c_global/cstdio: Likewise for cstdio. * include/c_global/cctype: Likewise for cctype. * include/c_global/cmath: Likewise for cmath. * include/c_global/cfenv: Likewise for cfenv. * include/c_global/cwchar: Likewise for cwchar. * include/c_global/cstdint: Likewise for cstdint. * include/c_global/cwctype: Likewise for cwctype. * include/tr1/cinttypes: Likewise for cinttypes. * include/tr1/cstdlib: Likewise for cstdlib. * include/tr1/cstdio: Likewise for cstdio. * include/tr1/cctype: Likewise for cctype. * include/tr1/cmath: Likewise for cmath. * include/tr1/cfenv: Likewise for cfenv. * include/tr1/cwchar: Likewise for cwchar. * include/tr1/cstdint: Likewise for cstdint. * include/tr1/cwctype: Likewise for cwctype. * include/tr1/functional_hash.h: Likewise for functional_hash. * include/std/tuple: Include tr1_impl/tuple. * include/std/utility: Likewise for utility. * include/std/type_traits: Likewise for type_traits. (is_pod): Just forward to __is_pod. (has_trivial_default_constructor): Just forward to __has_trivial_constructor. (has_trivial_copy_constructor): Just forward to __has_trivial_copy. (has_trivial_assign): Just forward to __has_trivial_assign. (has_trivial_destructor): Just forward to __has_trivial_destructor. (has_nothrow_default_constructor): Just forward to __has_nothrow_constructor. (has_nothrow_copy_constructor): Just forward to __has_nothrow_copy. (has_nothrow_assign): Just forward to __has_nothrow_assign. (is_base_of): Just forward to __is_base_of. (is_signed, is_unsigned): Implement according to the C++0x specifications. * include/std/memory: Likewise for memory. * include/std/regex: Likewise for regex. * include/std/random: Likewise for random. * include/std/unordered_map: Likewise for unordered_map. * include/std/unordered_set: Likewise for unordered_set. * include/std/functional: Likewise for functional. * include/std/complex: Likewise for complex. * include/std/array: Likewise for array. * include/tr1/tuple: Likewise for tuple. * include/tr1/utility: Likewise for utility. * include/tr1/type_traits: Likewise for type_traits * include/tr1/memory: Likewise for memory. * include/tr1/regex: Likewise for regex. * include/tr1/random: Likewise for random. * include/tr1/unordered_map: Likewise for unordered_map. * include/tr1/unordered_set: Likewise for unordered_set. * include/tr1/functional: Likewise for functional. * include/tr1/complex: Likewise for complex. * include/tr1/array: Likewise for array. * include/c_global/ctgmath: Tweak. * include/c_global/cstdarg: Likewise. * include/c_global/ctime: Likewise. * include/c_global/climits: Likewise. * include/c_global/cfloat: Likewise. * include/c_global/ccomplex: Likewise. * include/c_global/cstdbool: Likewise. * include/tr1/poly_laguerre.tcc: Tweak, don't use _GLIBCXX_TR1. * include/tr1/riemann_zeta.tcc: Likewise. * include/tr1/beta_function.tcc: Likewise. * include/tr1/exp_integral.tcc: Likewise. * include/tr1/hypergeometric.tcc: Likewise. * include/tr1/modified_bessel_func.tcc: Likewise. * include/tr1/legendre_function.tcc: Likewise. * include/tr1/special_function_util.h: Likewise. * include/tr1/bessel_function.tcc: Likewise. * include/tr1/poly_hermite.tcc: Likewise. * include/tr1/ell_integral.tcc: Likewise. * include/tr1/gamma.tcc: Likewise. * include/tr1/stdlib.h: Likewise. * include/tr1/math.h: Likewise. * include/tr1/complex.h: Minor tweaks. * include/tr1/wctype.h: Likewise. * include/tr1/wchar.h: Likewise. * include/tr1/inttypes.h: Likewise. * include/tr1/tgmath.h: Likewise. * include/tr1/cstdbool: Likewise. * include/tr1/cfloat: Likewise. * include/tr1/ccomplex: Likewise. * include/tr1/ctime: Likewise. * include/tr1/climits: Likewise. * include/tr1/ctgmath: Likewise. * include/tr1/cstdarg: Likewise. * testsuite/tr1/headers.cc: Move... * testsuite/tr1/headers/all.cc: ... here. * testsuite/tr1/using_namespace_std_tr1.cc: Move... * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: ... here. * testsuite/tr1/headers/using_namespace_std_tr1.cc ... here. * testsuite/tr1/headers/c++200x/using_namespace_std_tr1.cc: New. * testsuite/20_util/tuple/requirements/explicit_instantiation.cc: Adjust namespace. * testsuite/20_util/has_nothrow_copy_constructor/value.cc: Adjust to the C++0x requirements. * testsuite/20_util/has_nothrow_default_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise. * testsuite/20_util/has_trivial_default_constructor/value.cc: Likewise. * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust dg-error lines. * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise. * testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc: Un-xfail. * testsuite/20_util/is_signed/value.cc: New. * testsuite/20_util/is_signed/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_signed/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_unsigned/value.cc: Likewise.. * testsuite/20_util/is_unsigned/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_unsigned/requirements/explicit_instantiation.cc: Likewise. * include/Makefile.am: Adjust. * include/Makefile.in: Regenerate. From-SVN: r125244
2007-06-01 01:37:56 +02:00
_GLIBCXX_END_NAMESPACE_TR1
[multiple changes] 2006-06-05 Paolo Carlini <pcarlini@suse.de> * include/tr1/random.tcc (Max::value()): Cast 1 to Tp(1) and adjust shift count to w; rename as Max_w. (struct Mod_w): New. (mersenne_twister<>::seed(Gen&, false_type): Use the latter. (mersenne_twister<>::operator()()): Fix ~0ul to ~_UInt(). * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Fix ~0ul to 2^32-1. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. 2006-06-05 Stephen M. Webb <stephen.webb@bregmasoft.com> * include/tr1/random: New. * include/tr1/random.tcc: Likewise. * include/Makefile.am: Add. * testsuite/tr1/5_numerical_facilies/random/ranlux3.cc: New. * testsuite/tr1/5_numerical_facilies/random/ranlux4.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mt19937.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/variate_generator/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/subtract_with_carry/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_real/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/discard_block/ requirements/requirements.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/non_uint_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/not_equal.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/linear_congruential/ operators/serialize.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/xor_combine/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/minstd_rand0.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ cons/range_neg.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/uniform_int/ requirements/typedefs.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/seed2.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/default.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ cons/gen1.cc: Likewise. * testsuite/tr1/5_numerical_facilies/random/mersenne_twister/ requirements/typedefs.cc: Likewise. * include/Makefile.in: Regenerate. * testsuite/tr1/headers.cc: Update. From-SVN: r114384
2006-06-05 09:33:18 +02:00
}