File indexing completed on 2025-01-18 09:30:28
0001 #ifndef BOOST_CORE_DETAIL_SPLITMIX64_HPP_INCLUDED
0002 #define BOOST_CORE_DETAIL_SPLITMIX64_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <boost/cstdint.hpp>
0013
0014 namespace boost
0015 {
0016 namespace detail
0017 {
0018
0019 class splitmix64
0020 {
0021 private:
0022
0023 boost::uint64_t x_;
0024
0025 public:
0026
0027 splitmix64(): x_( 0 )
0028 {
0029 }
0030
0031 explicit splitmix64( boost::uint64_t seed ): x_( seed )
0032 {
0033 }
0034
0035 boost::uint64_t operator()()
0036 {
0037 x_ += ( boost::uint64_t(0x9e3779b9u) << 32 ) + 0x7f4a7c15u;
0038
0039 boost::uint64_t z = x_;
0040
0041 z ^= z >> 30;
0042 z *= ( boost::uint64_t(0xbf58476du) << 32 ) + 0x1ce4e5b9u;
0043 z ^= z >> 27;
0044 z *= ( boost::uint64_t(0x94d049bbu) << 32 ) + 0x133111ebu;
0045 z ^= z >> 31;
0046
0047 return z;
0048 }
0049 };
0050
0051 }
0052 }
0053
0054 #endif