comparison DEPENDENCIES/generic/include/boost/random/generate_canonical.hpp @ 101:c530137014c0

Update Boost headers (1.58.0)
author Chris Cannam
date Mon, 07 Sep 2015 11:12:49 +0100
parents 2665513ce2d3
children
comparison
equal deleted inserted replaced
100:793467b5e61c 101:c530137014c0
5 * accompanying file LICENSE_1_0.txt or copy at 5 * accompanying file LICENSE_1_0.txt or copy at
6 * http://www.boost.org/LICENSE_1_0.txt) 6 * http://www.boost.org/LICENSE_1_0.txt)
7 * 7 *
8 * See http://www.boost.org for most recent version including documentation. 8 * See http://www.boost.org for most recent version including documentation.
9 * 9 *
10 * $Id: generate_canonical.hpp 72951 2011-07-07 04:57:37Z steven_watanabe $ 10 * $Id$
11 * 11 *
12 */ 12 */
13 13
14 #ifndef BOOST_RANDOM_GENERATE_CANONICAL_HPP 14 #ifndef BOOST_RANDOM_GENERATE_CANONICAL_HPP
15 #define BOOST_RANDOM_GENERATE_CANONICAL_HPP 15 #define BOOST_RANDOM_GENERATE_CANONICAL_HPP
17 #include <algorithm> 17 #include <algorithm>
18 #include <boost/assert.hpp> 18 #include <boost/assert.hpp>
19 #include <boost/config/no_tr1/cmath.hpp> 19 #include <boost/config/no_tr1/cmath.hpp>
20 #include <boost/limits.hpp> 20 #include <boost/limits.hpp>
21 #include <boost/type_traits/is_integral.hpp> 21 #include <boost/type_traits/is_integral.hpp>
22 #include <boost/math/special_functions.hpp> 22 #include <boost/mpl/bool.hpp>
23 #include <boost/random/detail/signed_unsigned_tools.hpp> 23 #include <boost/random/detail/signed_unsigned_tools.hpp>
24 #include <boost/random/detail/generator_bits.hpp> 24 #include <boost/random/detail/generator_bits.hpp>
25 25
26 namespace boost { 26 namespace boost {
27 namespace random { 27 namespace random {
53 { 53 {
54 using std::pow; 54 using std::pow;
55 using std::floor; 55 using std::floor;
56 BOOST_ASSERT((g.min)() == 0); 56 BOOST_ASSERT((g.min)() == 0);
57 BOOST_ASSERT((g.max)() == 1); 57 BOOST_ASSERT((g.max)() == 1);
58 typedef typename URNG::result_type base_result;
59 std::size_t digits = std::numeric_limits<RealType>::digits; 58 std::size_t digits = std::numeric_limits<RealType>::digits;
60 std::size_t engine_bits = detail::generator_bits<URNG>::value(); 59 std::size_t engine_bits = detail::generator_bits<URNG>::value();
61 std::size_t b = (std::min)(bits, digits); 60 std::size_t b = (std::min)(bits, digits);
62 RealType R = pow(RealType(2), RealType(engine_bits)); 61 RealType R = pow(RealType(2), RealType(engine_bits));
63 RealType mult = R; 62 RealType mult = R;