From: Paolo Carlini Date: Fri, 3 Apr 2009 10:01:47 +0000 (+0000) Subject: random: Remove, empty. X-Git-Tag: releases/gcc-4.5.0~6927 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95fe602ebea97abb5c5a303e7441fa055b65bb32;p=thirdparty%2Fgcc.git random: Remove, empty. 2009-04-03 Paolo Carlini * include/tr1_impl/random: Remove, empty. * include/tr1_impl/random.tcc: Likewise. * include/std/random: Minor clean-ups, formatting fixes, adjust copyright years. * include/bits/random.tcc: Likewise. * include/bits/random.h: Likewise. * include/tr1/random: Likewise. * include/tr1/random.tcc: Likewise. * include/tr1/random.h: Likewise. From-SVN: r145493 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 23954fbe8831..f0b1da6b2e1a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,16 @@ +2009-04-03 Paolo Carlini + + * include/tr1_impl/random: Remove, empty. + * include/tr1_impl/random.tcc: Likewise. + + * include/std/random: Minor clean-ups, formatting fixes, adjust + copyright years. + * include/bits/random.tcc: Likewise. + * include/bits/random.h: Likewise. + * include/tr1/random: Likewise. + * include/tr1/random.tcc: Likewise. + * include/tr1/random.h: Likewise. + 2009-04-02 Benjamin Kosnik * testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc: diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h index ad64a90a6817..33cf513a9920 100644 --- a/libstdc++-v3/include/bits/random.h +++ b/libstdc++-v3/include/bits/random.h @@ -1,6 +1,6 @@ // random number generation -*- C++ -*- -// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2009 Free Software Foundation, Inc. // // 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 @@ -64,7 +64,8 @@ namespace std namespace __detail { template(std::numeric_limits<_UIntType>::digits)> + bool = __w < static_cast + (std::numeric_limits<_UIntType>::digits)> struct _Shift { static const _UIntType __value = 0; }; @@ -74,9 +75,13 @@ namespace std // XXX need constexpr template(std::numeric_limits<_UIntType>::digits)> + bool = __w + (std::numeric_limits<_UIntType>::digits)> struct _ShiftMin1 - { static const _UIntType __value = __gnu_cxx::__numeric_traits<_UIntType>::max; }; + { + static const _UIntType __value = + __gnu_cxx::__numeric_traits<_UIntType>::max; + }; template struct _ShiftMin1<_UIntType, __w, true> diff --git a/libstdc++-v3/include/bits/random.tcc b/libstdc++-v3/include/bits/random.tcc index 0c4f7a4420da..022335adc178 100644 --- a/libstdc++-v3/include/bits/random.tcc +++ b/libstdc++-v3/include/bits/random.tcc @@ -1,6 +1,6 @@ // random number generation (out of line) -*- C++ -*- -// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2009 Free Software Foundation, Inc. // // 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 @@ -32,14 +32,11 @@ * You should not attempt to use it directly. */ -#include -#include #include #include namespace std { - /* * (Further) implementation-space details. */ @@ -107,7 +104,7 @@ namespace std seed(_UIntType __x0) { if ((__detail::__mod<_UIntType, 1U, 0U, __m>(__c) == 0U) - && (__detail::__mod<_UIntType, 1U, 0U, __m>(__x0) == 0U)) + && (__detail::__mod<_UIntType, 1U, 0U, __m>(__x0) == 0U)) _M_x = __detail::__mod<_UIntType, 1U, 0U, __m>(1U); else _M_x = __detail::__mod<_UIntType, 1U, 0U, __m>(__x0); @@ -150,7 +147,7 @@ namespace std { _UIntType __x0 = __g(); if ((__detail::__mod<_UIntType, 1U, 0U, __m>(__c) == 0U) - && (__detail::__mod<_UIntType, 1U, 0U, __m>(__x0) == 0U)) + && (__detail::__mod<_UIntType, 1U, 0U, __m>(__x0) == 0U)) _M_x = __detail::__mod<_UIntType, 1U, 0U, __m>(1U); else _M_x = __detail::__mod<_UIntType, 1U, 0U, __m>(__x0); @@ -181,9 +178,7 @@ namespace std 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.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__os.widen(' ')); __os << __lcr._M_x; @@ -347,9 +342,7 @@ namespace std 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.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); for (size_t __i = 0; __i < __n - 1; ++__i) @@ -487,9 +480,7 @@ namespace std 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.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); for (size_t __i = 0; __i < __r; ++__i) @@ -550,9 +541,7 @@ namespace std 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.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); __os << __x.base() << __space << __x._M_n; @@ -653,9 +642,7 @@ namespace std 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.flags(__ios_base::dec | __ios_base::fixed | __ios_base::left); __os.fill(__space); __os << __x.base(); @@ -2331,9 +2318,7 @@ namespace std piecewise_constant_distribution<_RealType>::param_type:: param_type() : _M_int(), _M_den(), _M_cp() - { - _M_initialize(); - } + { _M_initialize(); } template template @@ -2532,9 +2517,7 @@ namespace std piecewise_linear_distribution<_RealType>::param_type:: param_type() : _M_int(), _M_den(), _M_cp(), _M_m() - { - _M_initialize(); - } + { _M_initialize(); } template template @@ -2790,5 +2773,4 @@ namespace std } return __sum / __tmp; } - } diff --git a/libstdc++-v3/include/std/random b/libstdc++-v3/include/std/random index 52a0b73cf33b..ad79a87e82f9 100644 --- a/libstdc++-v3/include/std/random +++ b/libstdc++-v3/include/std/random @@ -1,6 +1,6 @@ // -*- C++ -*- -// Copyright (C) 2007, 2008 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. // // 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 @@ -40,10 +40,6 @@ # include #else -#if defined(_GLIBCXX_INCLUDE_AS_TR1) -# error C++0x header cannot be included from TR1 header -#endif - #include #include #include diff --git a/libstdc++-v3/include/tr1/random b/libstdc++-v3/include/tr1/random index 6f6e3234b89b..f420b2feeba4 100644 --- a/libstdc++-v3/include/tr1/random +++ b/libstdc++-v3/include/tr1/random @@ -1,6 +1,6 @@ // random number generation -*- C++ -*- -// Copyright (C) 2006, 2007 Free Software Foundation, Inc. +// Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc. // // 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 @@ -37,10 +37,6 @@ #pragma GCC system_header -#if defined(_GLIBCXX_INCLUDE_AS_CXX0X) -# error TR1 header cannot be included from C++0x header -#endif - #include #include #include @@ -54,14 +50,10 @@ #include #include -#if defined(_GLIBCXX_INCLUDE_AS_TR1) -# include -#else -# define _GLIBCXX_INCLUDE_AS_TR1 -# define _GLIBCXX_TR1 tr1:: -# include -# undef _GLIBCXX_TR1 -# undef _GLIBCXX_INCLUDE_AS_TR1 +#include + +#ifndef _GLIBCXX_EXPORT_TEMPLATE +# include #endif #endif // _GLIBCXX_TR1_RANDOM diff --git a/libstdc++-v3/include/tr1/random.h b/libstdc++-v3/include/tr1/random.h index 5a0f6b741b6c..f2c39ba5f587 100644 --- a/libstdc++-v3/include/tr1/random.h +++ b/libstdc++-v3/include/tr1/random.h @@ -1,6 +1,6 @@ // random number generation -*- C++ -*- -// Copyright (C) 2007, 2008 Free Software Foundation, Inc. +// Copyright (C) 2009 Free Software Foundation, Inc. // // 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 @@ -38,28 +38,10 @@ #pragma GCC system_header -#if defined(_GLIBCXX_INCLUDE_AS_CXX0X) -# error TR1 header cannot be included from C++0x header -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - namespace std { namespace tr1 { - // [5.1] Random number generation /** @@ -2427,10 +2409,7 @@ namespace tr1 /* @} */ // group tr1_random_distributions_continuous /* @} */ // group tr1_random_distributions /* @} */ // group tr1_random - } } -#include - #endif // _GLIBCXX_TR1_RANDOM_H diff --git a/libstdc++-v3/include/tr1/random.tcc b/libstdc++-v3/include/tr1/random.tcc index ec06ae31a6c7..5ec7bfe80053 100644 --- a/libstdc++-v3/include/tr1/random.tcc +++ b/libstdc++-v3/include/tr1/random.tcc @@ -1,6 +1,6 @@ // random number generation (out of line) -*- C++ -*- -// Copyright (C) 2007 Free Software Foundation, Inc. +// Copyright (C) 2009 Free Software Foundation, Inc. // // 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 @@ -36,7 +36,6 @@ namespace std { namespace tr1 { - /* * (Further) implementation-space details. */ @@ -324,7 +323,7 @@ namespace tr1 if (__value == 0) __value = 19780503; - std::_GLIBCXX_TR1 linear_congruential + std::tr1::linear_congruential __lcg(__value); for (int __i = 0; __i < long_lag; ++__i) @@ -443,7 +442,7 @@ namespace tr1 { for (int __j = 0; __j < __n; ++__j) #if _GLIBCXX_USE_C99_MATH_TR1 - _M_npows[__j] = std::_GLIBCXX_TR1 ldexp(_RealType(1), -__w + __j * 32); + _M_npows[__j] = std::tr1::ldexp(_RealType(1), -__w + __j * 32); #else _M_npows[__j] = std::pow(_RealType(2), -__w + __j * 32); #endif @@ -459,7 +458,7 @@ namespace tr1 // _GLIBCXX_RESOLVE_LIB_DEFECTS // 512. Seeding subtract_with_carry_01 from a single unsigned long. - std::_GLIBCXX_TR1 linear_congruential + std::tr1::linear_congruential __lcg(__value); this->seed(__lcg); @@ -905,14 +904,14 @@ namespace tr1 { const _RealType __m = std::floor(_M_mean); _M_lm_thr = std::log(_M_mean); - _M_lfm = std::_GLIBCXX_TR1 lgamma(__m + 1); + _M_lfm = std::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)); - _M_d = std::_GLIBCXX_TR1 round(std::max(_RealType(6), - std::min(__m, __dx))); + _M_d = std::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; @@ -1008,7 +1007,7 @@ namespace tr1 } __reject = (__w - __e - __x * _M_lm_thr - > _M_lfm - std::_GLIBCXX_TR1 lgamma(__x + __m + 1)); + > _M_lfm - std::tr1::lgamma(__x + __m + 1)); __reject |= __x + __m >= __thr; @@ -1099,11 +1098,11 @@ namespace tr1 const _RealType __d1x = std::sqrt(__np * __1p * std::log(32 * __np / (81 * __pi_4 * __1p))); - _M_d1 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d1x)); + _M_d1 = std::tr1::round(std::max(_RealType(1), __d1x)); const _RealType __d2x = std::sqrt(__np * __1p * std::log(32 * _M_t * __1p / (__pi_4 * __pa))); - _M_d2 = std::_GLIBCXX_TR1 round(std::max(_RealType(1), __d2x)); + _M_d2 = std::tr1::round(std::max(_RealType(1), __d2x)); // sqrt(pi / 2) const _RealType __spi_2 = 1.2533141373155002512078826424055226L; @@ -1119,8 +1118,8 @@ namespace tr1 const _RealType __s2s = _M_s2 * _M_s2; _M_s = (_M_a123 + 2 * __s2s / _M_d2 * std::exp(-_M_d2 * _M_d2 / (2 * __s2s))); - _M_lf = (std::_GLIBCXX_TR1 lgamma(__np + 1) - + std::_GLIBCXX_TR1 lgamma(_M_t - __np + 1)); + _M_lf = (std::tr1::lgamma(__np + 1) + + std::tr1::lgamma(_M_t - __np + 1)); _M_lp1p = std::log(__pa / __1p); _M_q = -std::log(1 - (__p12 - __pa) / __1p); @@ -1248,8 +1247,8 @@ namespace tr1 if (!__reject) { const _RealType __lfx = - std::_GLIBCXX_TR1 lgamma(__np + __x + 1) - + std::_GLIBCXX_TR1 lgamma(_M_t - (__np + __x) + 1); + std::tr1::lgamma(__np + __x + 1) + + std::tr1::lgamma(_M_t - (__np + __x) + 1); __reject = __v > _M_lf - __lfx + __x * _M_lp1p; } @@ -1578,6 +1577,5 @@ namespace tr1 __os.precision(__precision); return __os; } - } } diff --git a/libstdc++-v3/include/tr1_impl/random b/libstdc++-v3/include/tr1_impl/random deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/libstdc++-v3/include/tr1_impl/random.tcc b/libstdc++-v3/include/tr1_impl/random.tcc deleted file mode 100644 index e69de29bb2d1..000000000000