ranlux.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* boost random/ranlux.hpp header file
  2. *
  3. * Copyright Jens Maurer 2002
  4. * Distributed under the Boost Software License, Version 1.0. (See
  5. * accompanying file LICENSE_1_0.txt or copy at
  6. * http://www.boost.org/LICENSE_1_0.txt)
  7. *
  8. * See http://www.boost.org for most recent version including documentation.
  9. *
  10. * $Id$
  11. *
  12. * Revision history
  13. * 2001-02-18 created
  14. */
  15. #ifndef BOOST_RANDOM_RANLUX_HPP
  16. #define BOOST_RANDOM_RANLUX_HPP
  17. #include <boost/config.hpp>
  18. #include <boost/random/subtract_with_carry.hpp>
  19. #include <boost/random/discard_block.hpp>
  20. namespace boost {
  21. namespace random {
  22. namespace detail {
  23. /**
  24. * The ranlux family of generators are described in
  25. *
  26. * @blockquote
  27. * "A portable high-quality random number generator for lattice field theory
  28. * calculations", M. Luescher, Computer Physics Communications, 79 (1994)
  29. * pp 100-110.
  30. * @endblockquote
  31. *
  32. * The levels are given in
  33. *
  34. * @blockquote
  35. * "RANLUX: A Fortran implementation of the high-quality
  36. * pseudorandom number generator of Luescher", F. James,
  37. * Computer Physics Communications 79 (1994) 111-114
  38. * @endblockquote
  39. */
  40. class ranlux_documentation {};
  41. }
  42. typedef subtract_with_carry_engine<uint32_t, 24, 10, 24> ranlux_base;
  43. typedef subtract_with_carry_01_engine<float, 24, 10, 24> ranlux_base_01;
  44. typedef subtract_with_carry_01_engine<double, 48, 10, 24> ranlux64_base_01;
  45. /** @copydoc boost::random::detail::ranlux_documentation */
  46. typedef discard_block_engine<ranlux_base, 223, 24> ranlux3;
  47. /** @copydoc boost::random::detail::ranlux_documentation */
  48. typedef discard_block_engine<ranlux_base, 389, 24> ranlux4;
  49. /** @copydoc boost::random::detail::ranlux_documentation */
  50. typedef discard_block_engine<ranlux_base_01, 223, 24> ranlux3_01;
  51. /** @copydoc boost::random::detail::ranlux_documentation */
  52. typedef discard_block_engine<ranlux_base_01, 389, 24> ranlux4_01;
  53. /** @copydoc boost::random::detail::ranlux_documentation */
  54. typedef discard_block_engine<ranlux64_base_01, 223, 24> ranlux64_3_01;
  55. /** @copydoc boost::random::detail::ranlux_documentation */
  56. typedef discard_block_engine<ranlux64_base_01, 389, 24> ranlux64_4_01;
  57. #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
  58. typedef subtract_with_carry_engine<uint64_t, 48, 10, 24> ranlux64_base;
  59. /** @copydoc boost::random::detail::ranlux_documentation */
  60. typedef discard_block_engine<ranlux64_base, 223, 24> ranlux64_3;
  61. /** @copydoc boost::random::detail::ranlux_documentation */
  62. typedef discard_block_engine<ranlux64_base, 389, 24> ranlux64_4;
  63. #endif /* !BOOST_NO_INT64_T && !BOOST_NO_INTEGRAL_INT64_T */
  64. typedef subtract_with_carry_engine<uint32_t, 24, 10, 24> ranlux24_base;
  65. typedef subtract_with_carry_engine<uint64_t, 48, 5, 12> ranlux48_base;
  66. typedef discard_block_engine<ranlux24_base, 223, 23> ranlux24;
  67. #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
  68. typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48;
  69. #endif
  70. }
  71. using random::ranlux3;
  72. using random::ranlux4;
  73. using random::ranlux3_01;
  74. using random::ranlux4_01;
  75. using random::ranlux64_3_01;
  76. using random::ranlux64_4_01;
  77. #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
  78. using random::ranlux64_3;
  79. using random::ranlux64_4;
  80. #endif
  81. } // namespace boost
  82. #endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP