/usr/include/boost/random/detail
NameSizeModeActions
auto_link.hpp9590644editdlrm
config.hpp5380644editdlrm
const_mod.hpp55660644editdlrm
disable_warnings.hpp8230644editdlrm
enable_warnings.hpp5520644editdlrm
generator_bits.hpp8740644editdlrm
generator_seed_seq.hpp8610644editdlrm
gray_coded_qrng.hpp46620644editdlrm
integer_log2.hpp21810644editdlrm
int_float_pair.hpp41780644editdlrm
iterator_mixin.hpp13030644editdlrm
large_arithmetic.hpp36150644editdlrm
niederreiter_base2_table.hpp362850644editdlrm
operators.hpp36730644editdlrm
polynomial.hpp133050644editdlrm
ptr_helper.hpp15340644editdlrm
qrng_base.hpp86590644editdlrm
seed.hpp50200644editdlrm
seed_impl.hpp142830644editdlrm
signed_unsigned_tools.hpp25350644editdlrm
sobol_table.hpp2340130644editdlrm
uniform_int_float.hpp21230644editdlrm
vector_io.hpp17920644editdlrm
Edit: /usr/include/boost/random/detail/integer_log2.hpp (2181B)
/* boost random/detail/integer_log2.hpp header file * * Copyright Steven Watanabe 2011 * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * * See http://www.boost.org for most recent version including documentation. * * $Id$ * */ #ifndef BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP #define BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP #include #include #include namespace boost { namespace random { namespace detail { #if !defined(BOOST_NO_CXX11_CONSTEXPR) #define BOOST_RANDOM_DETAIL_CONSTEXPR constexpr #elif defined(BOOST_MSVC) #define BOOST_RANDOM_DETAIL_CONSTEXPR __forceinline #elif defined(__GNUC__) && __GNUC__ >= 4 #define BOOST_RANDOM_DETAIL_CONSTEXPR inline __attribute__((__const__)) __attribute__((__always_inline__)) #else #define BOOST_RANDOM_DETAIL_CONSTEXPR inline #endif template struct integer_log2_impl { #if defined(BOOST_NO_CXX11_CONSTEXPR) template BOOST_RANDOM_DETAIL_CONSTEXPR static int apply(T t, int accum) { int update = ((t >> Shift) != 0) * Shift; return integer_log2_impl::apply(t >> update, accum + update); } #else template BOOST_RANDOM_DETAIL_CONSTEXPR static int apply2(T t, int accum, int update) { return integer_log2_impl::apply(t >> update, accum + update); } template BOOST_RANDOM_DETAIL_CONSTEXPR static int apply(T t, int accum) { return apply2(t, accum, ((t >> Shift) != 0) * Shift); } #endif }; template<> struct integer_log2_impl<1> { template BOOST_RANDOM_DETAIL_CONSTEXPR static int apply(T t, int accum) { return int(t >> 1) + accum; } }; template BOOST_RANDOM_DETAIL_CONSTEXPR int integer_log2(T t) { return integer_log2_impl< ::boost::detail::max_pow2_less< ::std::numeric_limits::digits, 4 >::value >::apply(t, 0); } } // namespace detail } // namespace random } // namespace boost #endif // BOOST_RANDOM_DETAIL_INTEGER_LOG2_HPP