• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
16 #ifndef BOOST_RANDOM_RANLUX_HPP
17 #define BOOST_RANDOM_RANLUX_HPP
18 
19 #include <boost/config.hpp>
20 #include <boost/random/subtract_with_carry.hpp>
21 #include <boost/random/discard_block.hpp>
22 
23 namespace boost {
24 
25 namespace random {
26 
27 namespace detail {
28 /**
29  * The ranlux family of generators are described in
30  *
31  *  @blockquote
32  *  "A portable high-quality random number generator for lattice field theory
33  *  calculations", M. Luescher, Computer Physics Communications, 79 (1994)
34  *  pp 100-110.
35  *  @endblockquote
36  *
37  * The levels are given in
38  *
39  *  @blockquote
40  *  "RANLUX: A Fortran implementation of the high-quality
41  *  pseudorandom number generator of Luescher", F. James,
42  *  Computer Physics Communications 79 (1994) 111-114
43  *  @endblockquote
44  */
45 class ranlux_documentation {};
46 }
47 
48 typedef subtract_with_carry_engine<uint32_t, 24, 10, 24> ranlux_base;
49 typedef subtract_with_carry_01_engine<float, 24, 10, 24> ranlux_base_01;
50 typedef subtract_with_carry_01_engine<double, 48, 10, 24> ranlux64_base_01;
51 
52 
53 /** @copydoc boost::random::detail::ranlux_documentation */
54 typedef discard_block_engine<ranlux_base, 223, 24> ranlux3;
55 /** @copydoc boost::random::detail::ranlux_documentation */
56 typedef discard_block_engine<ranlux_base, 389, 24> ranlux4;
57 
58 /** @copydoc boost::random::detail::ranlux_documentation */
59 typedef discard_block_engine<ranlux_base_01, 223, 24> ranlux3_01;
60 /** @copydoc boost::random::detail::ranlux_documentation */
61 typedef discard_block_engine<ranlux_base_01, 389, 24> ranlux4_01;
62 
63 /** @copydoc boost::random::detail::ranlux_documentation */
64 typedef discard_block_engine<ranlux64_base_01, 223, 24> ranlux64_3_01;
65 /** @copydoc boost::random::detail::ranlux_documentation */
66 typedef discard_block_engine<ranlux64_base_01, 389, 24> ranlux64_4_01;
67 
68 #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
69 typedef subtract_with_carry_engine<uint64_t, 48, 10, 24> ranlux64_base;
70 /** @copydoc boost::random::detail::ranlux_documentation */
71 typedef discard_block_engine<ranlux64_base, 223, 24> ranlux64_3;
72 /** @copydoc boost::random::detail::ranlux_documentation */
73 typedef discard_block_engine<ranlux64_base, 389, 24> ranlux64_4;
74 #endif /* !BOOST_NO_INT64_T && !BOOST_NO_INTEGRAL_INT64_T */
75 
76 
77 typedef subtract_with_carry_engine<uint32_t, 24, 10, 24> ranlux24_base;
78 typedef subtract_with_carry_engine<uint64_t, 48, 5, 12> ranlux48_base;
79 
80 typedef discard_block_engine<ranlux24_base, 223, 23> ranlux24;
81 #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
82 typedef discard_block_engine<ranlux48_base, 389, 11> ranlux48;
83 #endif
84 }
85 
86 using random::ranlux3;
87 using random::ranlux4;
88 using random::ranlux3_01;
89 using random::ranlux4_01;
90 using random::ranlux64_3_01;
91 using random::ranlux64_4_01;
92 #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
93 using random::ranlux64_3;
94 using random::ranlux64_4;
95 #endif
96 
97 } // namespace boost
98 
99 #endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP
100