PageRenderTime 52ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/boost/random/mersenne_twister.hpp

http://deltaenginecpp.codeplex.com
C++ Header | 548 lines | 337 code | 51 blank | 160 comment | 40 complexity | a9db4d6de8c39ad016d1b6ac20249bad MD5 | raw file
Possible License(s): Apache-2.0
  1. /* boost random/mersenne_twister.hpp header file
  2. *
  3. * Copyright Jens Maurer 2000-2001
  4. * Copyright Steven Watanabe 2010
  5. * Distributed under the Boost Software License, Version 1.0. (See
  6. * accompanying file LICENSE_1_0.txt or copy at
  7. * http://www.boost.org/LICENSE_1_0.txt)
  8. *
  9. * See http://www.boost.org for most recent version including documentation.
  10. *
  11. * $Id: mersenne_twister.hpp 74867 2011-10-09 23:13:31Z steven_watanabe $
  12. *
  13. * Revision history
  14. * 2001-02-18 moved to individual header files
  15. */
  16. #ifndef BOOST_RANDOM_MERSENNE_TWISTER_HPP
  17. #define BOOST_RANDOM_MERSENNE_TWISTER_HPP
  18. #include <iosfwd>
  19. #include <istream>
  20. #include <stdexcept>
  21. #include <boost/config.hpp>
  22. #include <boost/cstdint.hpp>
  23. #include <boost/integer/integer_mask.hpp>
  24. #include <boost/random/detail/config.hpp>
  25. #include <boost/random/detail/ptr_helper.hpp>
  26. #include <boost/random/detail/seed.hpp>
  27. #include <boost/random/detail/seed_impl.hpp>
  28. #include <boost/random/detail/generator_seed_seq.hpp>
  29. namespace boost {
  30. namespace random {
  31. /**
  32. * Instantiations of class template mersenne_twister_engine model a
  33. * \pseudo_random_number_generator. It uses the algorithm described in
  34. *
  35. * @blockquote
  36. * "Mersenne Twister: A 623-dimensionally equidistributed uniform
  37. * pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura,
  38. * ACM Transactions on Modeling and Computer Simulation: Special Issue on
  39. * Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
  40. * @endblockquote
  41. *
  42. * @xmlnote
  43. * The boost variant has been implemented from scratch and does not
  44. * derive from or use mt19937.c provided on the above WWW site. However, it
  45. * was verified that both produce identical output.
  46. * @endxmlnote
  47. *
  48. * The seeding from an integer was changed in April 2005 to address a
  49. * <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">weakness</a>.
  50. *
  51. * The quality of the generator crucially depends on the choice of the
  52. * parameters. User code should employ one of the sensibly parameterized
  53. * generators such as \mt19937 instead.
  54. *
  55. * The generator requires considerable amounts of memory for the storage of
  56. * its state array. For example, \mt11213b requires about 1408 bytes and
  57. * \mt19937 requires about 2496 bytes.
  58. */
  59. template<class UIntType,
  60. std::size_t w, std::size_t n, std::size_t m, std::size_t r,
  61. UIntType a, std::size_t u, UIntType d, std::size_t s,
  62. UIntType b, std::size_t t,
  63. UIntType c, std::size_t l, UIntType f>
  64. class mersenne_twister_engine
  65. {
  66. public:
  67. typedef UIntType result_type;
  68. BOOST_STATIC_CONSTANT(std::size_t, word_size = w);
  69. BOOST_STATIC_CONSTANT(std::size_t, state_size = n);
  70. BOOST_STATIC_CONSTANT(std::size_t, shift_size = m);
  71. BOOST_STATIC_CONSTANT(std::size_t, mask_bits = r);
  72. BOOST_STATIC_CONSTANT(UIntType, xor_mask = a);
  73. BOOST_STATIC_CONSTANT(std::size_t, tempering_u = u);
  74. BOOST_STATIC_CONSTANT(UIntType, tempering_d = d);
  75. BOOST_STATIC_CONSTANT(std::size_t, tempering_s = s);
  76. BOOST_STATIC_CONSTANT(UIntType, tempering_b = b);
  77. BOOST_STATIC_CONSTANT(std::size_t, tempering_t = t);
  78. BOOST_STATIC_CONSTANT(UIntType, tempering_c = c);
  79. BOOST_STATIC_CONSTANT(std::size_t, tempering_l = l);
  80. BOOST_STATIC_CONSTANT(UIntType, initialization_multiplier = f);
  81. BOOST_STATIC_CONSTANT(UIntType, default_seed = 5489u);
  82. // backwards compatibility
  83. BOOST_STATIC_CONSTANT(UIntType, parameter_a = a);
  84. BOOST_STATIC_CONSTANT(std::size_t, output_u = u);
  85. BOOST_STATIC_CONSTANT(std::size_t, output_s = s);
  86. BOOST_STATIC_CONSTANT(UIntType, output_b = b);
  87. BOOST_STATIC_CONSTANT(std::size_t, output_t = t);
  88. BOOST_STATIC_CONSTANT(UIntType, output_c = c);
  89. BOOST_STATIC_CONSTANT(std::size_t, output_l = l);
  90. // old Boost.Random concept requirements
  91. BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
  92. /**
  93. * Constructs a @c mersenne_twister_engine and calls @c seed().
  94. */
  95. mersenne_twister_engine() { seed(); }
  96. /**
  97. * Constructs a @c mersenne_twister_engine and calls @c seed(value).
  98. */
  99. BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(mersenne_twister_engine,
  100. UIntType, value)
  101. { seed(value); }
  102. template<class It> mersenne_twister_engine(It& first, It last)
  103. { seed(first,last); }
  104. /**
  105. * Constructs a mersenne_twister_engine and calls @c seed(gen).
  106. *
  107. * @xmlnote
  108. * The copy constructor will always be preferred over
  109. * the templated constructor.
  110. * @endxmlnote
  111. */
  112. BOOST_RANDOM_DETAIL_SEED_SEQ_CONSTRUCTOR(mersenne_twister_engine,
  113. SeedSeq, seq)
  114. { seed(seq); }
  115. // compiler-generated copy ctor and assignment operator are fine
  116. /** Calls @c seed(default_seed). */
  117. void seed() { seed(default_seed); }
  118. /**
  119. * Sets the state x(0) to v mod 2w. Then, iteratively,
  120. * sets x(i) to
  121. * (i + f * (x(i-1) xor (x(i-1) rshift w-2))) mod 2<sup>w</sup>
  122. * for i = 1 .. n-1. x(n) is the first value to be returned by operator().
  123. */
  124. BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(mersenne_twister_engine, UIntType, value)
  125. {
  126. // New seeding algorithm from
  127. // http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
  128. // In the previous versions, MSBs of the seed affected only MSBs of the
  129. // state x[].
  130. const UIntType mask = (max)();
  131. x[0] = value & mask;
  132. for (i = 1; i < n; i++) {
  133. // See Knuth "The Art of Computer Programming"
  134. // Vol. 2, 3rd ed., page 106
  135. x[i] = (f * (x[i-1] ^ (x[i-1] >> (w-2))) + i) & mask;
  136. }
  137. }
  138. /**
  139. * Seeds a mersenne_twister_engine using values produced by seq.generate().
  140. */
  141. BOOST_RANDOM_DETAIL_SEED_SEQ_SEED(mersenne_twister_engine, SeeqSeq, seq)
  142. {
  143. detail::seed_array_int<w>(seq, x);
  144. i = n;
  145. // fix up the state if it's all zeroes.
  146. if((x[0] & (~static_cast<UIntType>(0) << r)) == 0) {
  147. for(std::size_t j = 1; j < n; ++j) {
  148. if(x[j] != 0) return;
  149. }
  150. x[0] = static_cast<UIntType>(1) << (w-1);
  151. }
  152. }
  153. /** Sets the state of the generator using values from an iterator range. */
  154. template<class It>
  155. void seed(It& first, It last)
  156. {
  157. detail::fill_array_int<w>(first, last, x);
  158. i = n;
  159. // fix up the state if it's all zeroes.
  160. if((x[0] & (~static_cast<UIntType>(0) << r)) == 0) {
  161. for(std::size_t j = 1; j < n; ++j) {
  162. if(x[j] != 0) return;
  163. }
  164. x[0] = static_cast<UIntType>(1) << (w-1);
  165. }
  166. }
  167. /** Returns the smallest value that the generator can produce. */
  168. static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
  169. { return 0; }
  170. /** Returns the largest value that the generator can produce. */
  171. static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
  172. { return boost::low_bits_mask_t<w>::sig_bits; }
  173. /** Produces the next value of the generator. */
  174. result_type operator()();
  175. /** Fills a range with random values */
  176. template<class Iter>
  177. void generate(Iter first, Iter last)
  178. { detail::generate_from_int(*this, first, last); }
  179. /**
  180. * Advances the state of the generator by @c z steps. Equivalent to
  181. *
  182. * @code
  183. * for(unsigned long long i = 0; i < z; ++i) {
  184. * gen();
  185. * }
  186. * @endcode
  187. */
  188. void discard(boost::uintmax_t z)
  189. {
  190. for(boost::uintmax_t j = 0; j < z; ++j) {
  191. (*this)();
  192. }
  193. }
  194. #ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
  195. /** Writes a mersenne_twister_engine to a @c std::ostream */
  196. template<class CharT, class Traits>
  197. friend std::basic_ostream<CharT,Traits>&
  198. operator<<(std::basic_ostream<CharT,Traits>& os,
  199. const mersenne_twister_engine& mt)
  200. {
  201. mt.print(os);
  202. return os;
  203. }
  204. /** Reads a mersenne_twister_engine from a @c std::istream */
  205. template<class CharT, class Traits>
  206. friend std::basic_istream<CharT,Traits>&
  207. operator>>(std::basic_istream<CharT,Traits>& is,
  208. mersenne_twister_engine& mt)
  209. {
  210. for(std::size_t j = 0; j < mt.state_size; ++j)
  211. is >> mt.x[j] >> std::ws;
  212. // MSVC (up to 7.1) and Borland (up to 5.64) don't handle the template
  213. // value parameter "n" available from the class template scope, so use
  214. // the static constant with the same value
  215. mt.i = mt.state_size;
  216. return is;
  217. }
  218. #endif
  219. /**
  220. * Returns true if the two generators are in the same state,
  221. * and will thus produce identical sequences.
  222. */
  223. friend bool operator==(const mersenne_twister_engine& x,
  224. const mersenne_twister_engine& y)
  225. {
  226. if(x.i < y.i) return x.equal_imp(y);
  227. else return y.equal_imp(x);
  228. }
  229. /**
  230. * Returns true if the two generators are in different states.
  231. */
  232. friend bool operator!=(const mersenne_twister_engine& x,
  233. const mersenne_twister_engine& y)
  234. { return !(x == y); }
  235. private:
  236. /// \cond show_private
  237. void twist();
  238. /**
  239. * Does the work of operator==. This is in a member function
  240. * for portability. Some compilers, such as msvc 7.1 and
  241. * Sun CC 5.10 can't access template parameters or static
  242. * members of the class from inline friend functions.
  243. *
  244. * requires i <= other.i
  245. */
  246. bool equal_imp(const mersenne_twister_engine& other) const
  247. {
  248. UIntType back[n];
  249. std::size_t offset = other.i - i;
  250. for(std::size_t j = 0; j + offset < n; ++j)
  251. if(x[j] != other.x[j+offset])
  252. return false;
  253. rewind(&back[n-1], offset);
  254. for(std::size_t j = 0; j < offset; ++j)
  255. if(back[j + n - offset] != other.x[j])
  256. return false;
  257. return true;
  258. }
  259. /**
  260. * Does the work of operator<<. This is in a member function
  261. * for portability.
  262. */
  263. template<class CharT, class Traits>
  264. void print(std::basic_ostream<CharT, Traits>& os) const
  265. {
  266. UIntType data[n];
  267. for(std::size_t j = 0; j < i; ++j) {
  268. data[j + n - i] = x[j];
  269. }
  270. if(i != n) {
  271. rewind(&data[n - i - 1], n - i);
  272. }
  273. os << data[0];
  274. for(std::size_t j = 1; j < n; ++j) {
  275. os << ' ' << data[j];
  276. }
  277. }
  278. /**
  279. * Copies z elements of the state preceding x[0] into
  280. * the array whose last element is last.
  281. */
  282. void rewind(UIntType* last, std::size_t z) const
  283. {
  284. const UIntType upper_mask = (~static_cast<UIntType>(0)) << r;
  285. const UIntType lower_mask = ~upper_mask;
  286. UIntType y0 = x[m-1] ^ x[n-1];
  287. if(y0 & (static_cast<UIntType>(1) << (w-1))) {
  288. y0 = ((y0 ^ a) << 1) | 1;
  289. } else {
  290. y0 = y0 << 1;
  291. }
  292. for(std::size_t sz = 0; sz < z; ++sz) {
  293. UIntType y1 =
  294. rewind_find(last, sz, m-1) ^ rewind_find(last, sz, n-1);
  295. if(y1 & (static_cast<UIntType>(1) << (w-1))) {
  296. y1 = ((y1 ^ a) << 1) | 1;
  297. } else {
  298. y1 = y1 << 1;
  299. }
  300. *(last - sz) = (y0 & upper_mask) | (y1 & lower_mask);
  301. y0 = y1;
  302. }
  303. }
  304. /**
  305. * Given a pointer to the last element of the rewind array,
  306. * and the current size of the rewind array, finds an element
  307. * relative to the next available slot in the rewind array.
  308. */
  309. UIntType
  310. rewind_find(UIntType* last, std::size_t size, std::size_t j) const
  311. {
  312. std::size_t index = (j + n - size + n - 1) % n;
  313. if(index < n - size) {
  314. return x[index];
  315. } else {
  316. return *(last - (n - 1 - index));
  317. }
  318. }
  319. /// \endcond
  320. // state representation: next output is o(x(i))
  321. // x[0] ... x[k] x[k+1] ... x[n-1] represents
  322. // x(i-k) ... x(i) x(i+1) ... x(i-k+n-1)
  323. UIntType x[n];
  324. std::size_t i;
  325. };
  326. /// \cond show_private
  327. #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
  328. // A definition is required even for integral static constants
  329. #define BOOST_RANDOM_MT_DEFINE_CONSTANT(type, name) \
  330. template<class UIntType, std::size_t w, std::size_t n, std::size_t m, \
  331. std::size_t r, UIntType a, std::size_t u, UIntType d, std::size_t s, \
  332. UIntType b, std::size_t t, UIntType c, std::size_t l, UIntType f> \
  333. const type mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::name
  334. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, word_size);
  335. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, state_size);
  336. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, shift_size);
  337. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, mask_bits);
  338. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, xor_mask);
  339. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_u);
  340. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, tempering_d);
  341. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_s);
  342. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, tempering_b);
  343. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_t);
  344. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, tempering_c);
  345. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, tempering_l);
  346. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, initialization_multiplier);
  347. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, default_seed);
  348. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, parameter_a);
  349. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_u );
  350. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_s);
  351. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, output_b);
  352. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_t);
  353. BOOST_RANDOM_MT_DEFINE_CONSTANT(UIntType, output_c);
  354. BOOST_RANDOM_MT_DEFINE_CONSTANT(std::size_t, output_l);
  355. BOOST_RANDOM_MT_DEFINE_CONSTANT(bool, has_fixed_range);
  356. #undef BOOST_RANDOM_MT_DEFINE_CONSTANT
  357. #endif
  358. template<class UIntType,
  359. std::size_t w, std::size_t n, std::size_t m, std::size_t r,
  360. UIntType a, std::size_t u, UIntType d, std::size_t s,
  361. UIntType b, std::size_t t,
  362. UIntType c, std::size_t l, UIntType f>
  363. void
  364. mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::twist()
  365. {
  366. const UIntType upper_mask = (~static_cast<UIntType>(0)) << r;
  367. const UIntType lower_mask = ~upper_mask;
  368. const std::size_t unroll_factor = 6;
  369. const std::size_t unroll_extra1 = (n-m) % unroll_factor;
  370. const std::size_t unroll_extra2 = (m-1) % unroll_factor;
  371. // split loop to avoid costly modulo operations
  372. { // extra scope for MSVC brokenness w.r.t. for scope
  373. for(std::size_t j = 0; j < n-m-unroll_extra1; j++) {
  374. UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
  375. x[j] = x[j+m] ^ (y >> 1) ^ ((x[j+1]&1) * a);
  376. }
  377. }
  378. {
  379. for(std::size_t j = n-m-unroll_extra1; j < n-m; j++) {
  380. UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
  381. x[j] = x[j+m] ^ (y >> 1) ^ ((x[j+1]&1) * a);
  382. }
  383. }
  384. {
  385. for(std::size_t j = n-m; j < n-1-unroll_extra2; j++) {
  386. UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
  387. x[j] = x[j-(n-m)] ^ (y >> 1) ^ ((x[j+1]&1) * a);
  388. }
  389. }
  390. {
  391. #pragma warning(suppress: 6294)
  392. for(std::size_t j = n-1-unroll_extra2; j < n-1; j++) {
  393. #pragma warning(suppress: 6201)
  394. UIntType y = (x[j] & upper_mask) | (x[j+1] & lower_mask);
  395. x[j] = x[j-(n-m)] ^ (y >> 1) ^ ((x[j+1]&1) * a);
  396. }
  397. }
  398. // last iteration
  399. UIntType y = (x[n-1] & upper_mask) | (x[0] & lower_mask);
  400. x[n-1] = x[m-1] ^ (y >> 1) ^ ((x[0]&1) * a);
  401. i = 0;
  402. }
  403. /// \endcond
  404. template<class UIntType,
  405. std::size_t w, std::size_t n, std::size_t m, std::size_t r,
  406. UIntType a, std::size_t u, UIntType d, std::size_t s,
  407. UIntType b, std::size_t t,
  408. UIntType c, std::size_t l, UIntType f>
  409. inline typename
  410. mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::result_type
  411. mersenne_twister_engine<UIntType,w,n,m,r,a,u,d,s,b,t,c,l,f>::operator()()
  412. {
  413. if(i == n)
  414. twist();
  415. // Step 4
  416. #pragma warning(suppress: 6385)
  417. UIntType z = x[i];
  418. ++i;
  419. z ^= ((z >> u) & d);
  420. z ^= ((z << s) & b);
  421. z ^= ((z << t) & c);
  422. z ^= (z >> l);
  423. return z;
  424. }
  425. /**
  426. * The specializations \mt11213b and \mt19937 are from
  427. *
  428. * @blockquote
  429. * "Mersenne Twister: A 623-dimensionally equidistributed
  430. * uniform pseudo-random number generator", Makoto Matsumoto
  431. * and Takuji Nishimura, ACM Transactions on Modeling and
  432. * Computer Simulation: Special Issue on Uniform Random Number
  433. * Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
  434. * @endblockquote
  435. */
  436. typedef mersenne_twister_engine<uint32_t,32,351,175,19,0xccab8ee7,
  437. 11,0xffffffff,7,0x31b6ab00,15,0xffe50000,17,1812433253> mt11213b;
  438. /**
  439. * The specializations \mt11213b and \mt19937 are from
  440. *
  441. * @blockquote
  442. * "Mersenne Twister: A 623-dimensionally equidistributed
  443. * uniform pseudo-random number generator", Makoto Matsumoto
  444. * and Takuji Nishimura, ACM Transactions on Modeling and
  445. * Computer Simulation: Special Issue on Uniform Random Number
  446. * Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
  447. * @endblockquote
  448. */
  449. typedef mersenne_twister_engine<uint32_t,32,624,397,31,0x9908b0df,
  450. 11,0xffffffff,7,0x9d2c5680,15,0xefc60000,18,1812433253> mt19937;
  451. #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
  452. typedef mersenne_twister_engine<uint64_t,64,312,156,31,
  453. UINT64_C(0xb5026f5aa96619e9),29,UINT64_C(0x5555555555555555),17,
  454. UINT64_C(0x71d67fffeda60000),37,UINT64_C(0xfff7eee000000000),43,
  455. UINT64_C(6364136223846793005)> mt19937_64;
  456. #endif
  457. /// \cond show_deprecated
  458. template<class UIntType,
  459. int w, int n, int m, int r,
  460. UIntType a, int u, std::size_t s,
  461. UIntType b, int t,
  462. UIntType c, int l, UIntType v>
  463. class mersenne_twister :
  464. public mersenne_twister_engine<UIntType,
  465. w, n, m, r, a, u, ~(UIntType)0, s, b, t, c, l, 1812433253>
  466. {
  467. typedef mersenne_twister_engine<UIntType,
  468. w, n, m, r, a, u, ~(UIntType)0, s, b, t, c, l, 1812433253> base_type;
  469. public:
  470. mersenne_twister() {}
  471. BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(mersenne_twister, Gen, gen)
  472. { seed(gen); }
  473. BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(mersenne_twister, UIntType, val)
  474. { seed(val); }
  475. template<class It>
  476. mersenne_twister(It& first, It last) : base_type(first, last) {}
  477. void seed() { base_type::seed(); }
  478. BOOST_RANDOM_DETAIL_GENERATOR_SEED(mersenne_twister, Gen, gen)
  479. {
  480. detail::generator_seed_seq<Gen> seq(gen);
  481. base_type::seed(seq);
  482. }
  483. BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(mersenne_twister, UIntType, val)
  484. { base_type::seed(val); }
  485. template<class It>
  486. void seed(It& first, It last) { base_type::seed(first, last); }
  487. };
  488. /// \endcond
  489. } // namespace random
  490. using random::mt11213b;
  491. using random::mt19937;
  492. using random::mt19937_64;
  493. } // namespace boost
  494. BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt11213b)
  495. BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt19937)
  496. BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt19937_64)
  497. #endif // BOOST_RANDOM_MERSENNE_TWISTER_HPP