/
usr
/
include
/
boost
/
random
/
/usr/include/boost/random
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
additive_combine.hpp
8826
0644
edit
dl
rm
bernoulli_distribution.hpp
5608
0644
edit
dl
rm
beta_distribution.hpp
5900
0644
edit
dl
rm
binomial_distribution.hpp
12985
0644
edit
dl
rm
cauchy_distribution.hpp
6528
0644
edit
dl
rm
chi_squared_distribution.hpp
6322
0644
edit
dl
rm
discard_block.hpp
7991
0644
edit
dl
rm
discrete_distribution.hpp
21137
0644
edit
dl
rm
exponential_distribution.hpp
20895
0644
edit
dl
rm
extreme_value_distribution.hpp
5611
0644
edit
dl
rm
faure.hpp
11474
0644
edit
dl
rm
fisher_f_distribution.hpp
5924
0644
edit
dl
rm
gamma_distribution.hpp
9166
0644
edit
dl
rm
generate_canonical.hpp
2954
0644
edit
dl
rm
geometric_distribution.hpp
7339
0644
edit
dl
rm
hyperexponential_distribution.hpp
36980
0644
edit
dl
rm
independent_bits.hpp
9117
0644
edit
dl
rm
inversive_congruential.hpp
9550
0644
edit
dl
rm
lagged_fibonacci.hpp
18256
0644
edit
dl
rm
laplace_distribution.hpp
5743
0644
edit
dl
rm
linear_congruential.hpp
16214
0644
edit
dl
rm
linear_feedback_shift.hpp
7162
0644
edit
dl
rm
lognormal_distribution.hpp
8051
0644
edit
dl
rm
mersenne_twister.hpp
24094
0644
edit
dl
rm
negative_binomial_distribution.hpp
6911
0644
edit
dl
rm
niederreiter_base2.hpp
11736
0644
edit
dl
rm
non_central_chi_squared_distribution.hpp
7724
0644
edit
dl
rm
normal_distribution.hpp
17441
0644
edit
dl
rm
piecewise_constant_distribution.hpp
17186
0644
edit
dl
rm
piecewise_linear_distribution.hpp
18802
0644
edit
dl
rm
poisson_distribution.hpp
10145
0644
edit
dl
rm
random_device.hpp
5032
0644
edit
dl
rm
random_number_generator.hpp
1958
0644
edit
dl
rm
ranlux.hpp
3292
0644
edit
dl
rm
seed_seq.hpp
3792
0644
edit
dl
rm
shuffle_order.hpp
9181
0644
edit
dl
rm
shuffle_output.hpp
1352
0644
edit
dl
rm
sobol.hpp
7704
0644
edit
dl
rm
student_t_distribution.hpp
5633
0644
edit
dl
rm
subtract_with_carry.hpp
21590
0644
edit
dl
rm
taus88.hpp
1164
0644
edit
dl
rm
traits.hpp
4165
0644
edit
dl
rm
triangle_distribution.hpp
7033
0644
edit
dl
rm
uniform_01.hpp
7538
0644
edit
dl
rm
uniform_int.hpp
2909
0644
edit
dl
rm
uniform_int_distribution.hpp
16199
0644
edit
dl
rm
uniform_on_sphere.hpp
8812
0644
edit
dl
rm
uniform_real.hpp
2449
0644
edit
dl
rm
uniform_real_distribution.hpp
7726
0644
edit
dl
rm
uniform_smallint.hpp
12230
0644
edit
dl
rm
variate_generator.hpp
3708
0644
edit
dl
rm
weibull_distribution.hpp
5524
0644
edit
dl
rm
xor_combine.hpp
7049
0644
edit
dl
rm
Edit:
/usr/include/boost/random/seed_seq.hpp
(3792B)
/* boost random/seed_seq.hpp header file * * Copyright Steven Watanabe 2010 * 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_SEED_SEQ_HPP #define BOOST_RANDOM_SEED_SEQ_HPP #include <boost/config.hpp> #include <boost/cstdint.hpp> #include <boost/range/begin.hpp> #include <boost/range/end.hpp> #include <cstddef> #include <vector> #include <algorithm> #include <iterator> #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST #include <initializer_list> #endif namespace boost { namespace random { /** * The class @c seed_seq stores a sequence of 32-bit words * for seeding a \pseudo_random_number_generator. These * words will be combined to fill the entire state of the * generator. */ class seed_seq { public: typedef boost::uint_least32_t result_type; /** Initializes a seed_seq to hold an empty sequence. */ seed_seq() {} #ifndef BOOST_NO_CXX11_HDR_INITIALIZER_LIST /** Initializes the sequence from an initializer_list. */ template<class T> seed_seq(const std::initializer_list<T>& il) : v(il.begin(), il.end()) {} #endif /** Initializes the sequence from an iterator range. */ template<class Iter> seed_seq(Iter first, Iter last) : v(first, last) {} /** Initializes the sequence from Boost.Range range. */ template<class Range> explicit seed_seq(const Range& range) : v(boost::begin(range), boost::end(range)) {} /** * Fills a range with 32-bit values based on the stored sequence. * * Requires: Iter must be a Random Access Iterator whose value type * is an unsigned integral type at least 32 bits wide. */ template<class Iter> void generate(Iter first, Iter last) const { typedef typename std::iterator_traits<Iter>::value_type value_type; std::fill(first, last, static_cast<value_type>(0x8b8b8b8bu)); std::size_t s = v.size(); std::size_t n = last - first; std::size_t t = (n >= 623) ? 11 : (n >= 68) ? 7 : (n >= 39) ? 5 : (n >= 7) ? 3 : (n - 1)/2; std::size_t p = (n - t) / 2; std::size_t q = p + t; std::size_t m = (std::max)(s+1, n); value_type mask = 0xffffffffu; for(std::size_t k = 0; k < m; ++k) { value_type r1 = static_cast<value_type> (*(first + k%n) ^ *(first + (k+p)%n) ^ *(first + (k+n-1)%n)); r1 = r1 ^ (r1 >> 27); r1 = (r1 * 1664525u) & mask; value_type r2 = static_cast<value_type>(r1 + ((k == 0) ? s : (k <= s) ? k % n + v[k - 1] : (k % n))); *(first + (k+p)%n) = (*(first + (k+p)%n) + r1) & mask; *(first + (k+q)%n) = (*(first + (k+q)%n) + r2) & mask; *(first + k%n) = r2; } for(std::size_t k = m; k < m + n; ++k) { value_type r3 = static_cast<value_type> ((*(first + k%n) + *(first + (k+p)%n) + *(first + (k+n-1)%n)) & mask); r3 = r3 ^ (r3 >> 27); r3 = (r3 * 1566083941u) & mask; value_type r4 = static_cast<value_type>(r3 - k%n); *(first + (k+p)%n) ^= r3; *(first + (k+q)%n) ^= r4; *(first + k%n) = r4; } } /** Returns the size of the sequence. */ std::size_t size() const { return v.size(); } /** Writes the stored sequence to iter. */ template<class Iter> void param(Iter out) { std::copy(v.begin(), v.end(), out); } private: std::vector<result_type> v; }; } } #endif
Save
cmd:
run