MCKL
Monte Carlo Kernel Library
philox_constants.hpp
Go to the documentation of this file.
1 //============================================================================
2 // MCKL/include/mckl/random/internal/philox_constants.hpp
3 //----------------------------------------------------------------------------
4 // MCKL: Monte Carlo Kernel Library
5 //----------------------------------------------------------------------------
6 // Copyright (c) 2013-2018, Yan Zhou
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 // POSSIBILITY OF SUCH DAMAGE.
30 //============================================================================
31 
32 #ifndef MCKL_RANDOM_INTERNAL_PHILOX_CONSTANTS_HPP
33 #define MCKL_RANDOM_INTERNAL_PHILOX_CONSTANTS_HPP
34 
36 
37 namespace mckl {
38 
39 namespace internal {
40 
41 template <typename T, std::size_t, int = std::numeric_limits<T>::digits>
43 
44 template <typename T>
45 class PhiloxConstantsWeyl<T, 2, 32>
46 {
47  public:
48  static constexpr T value[1] = {0x9E3779B9};
49 }; // class PhiloxConstantsWeyl
50 
51 template <typename T>
52 class PhiloxConstantsWeyl<T, 4, 32>
53 {
54  public:
55  static constexpr T value[2] = {0x9E3779B9, 0xBB67AE85};
56 }; // class PhiloxConstantsWeyl
57 
58 template <typename T>
59 class PhiloxConstantsWeyl<T, 2, 64>
60 {
61  public:
62  static constexpr T value[1] = {0x9E3779B97F4A7C15};
63 }; // class PhiloxConstantsWeyl
64 
65 template <typename T>
66 class PhiloxConstantsWeyl<T, 4, 64>
67 {
68  public:
69  static constexpr T value[2] = {0x9E3779B97F4A7C15, 0xBB67AE8584CAA73B};
70 }; // class PhiloxConstantsWeyl
71 
72 template <typename T, std::size_t, int = std::numeric_limits<T>::digits>
74 
75 template <typename T>
77 {
78  public:
79  static constexpr T value[1] = {0xD256D193};
80 }; // class PhiloxConstantsMultiplier
81 
82 template <typename T>
84 {
85  public:
86  static constexpr T value[2] = {0xCD9E8D57, 0xD2511F53};
87 }; // class PhiloxConstantsMultiplier
88 
89 template <typename T>
91 {
92  public:
93  static constexpr T value[1] = {0xD2B74407B1CE6E93};
94 }; // class PhiloxConstantsMultiplier
95 
96 template <typename T>
98 {
99  public:
100  static constexpr T value[2] = {0xCA5A826395121157, 0xD2E7470EE14C6C93};
101 }; // class PhiloxConstantsMultiplier
102 
103 } // namespace internal
104 
107 template <typename T, std::size_t K>
109 {
110  public:
113 }; // class PhiloxConstants
114 
115 } // namespace mckl
116 
117 #endif // MCKL_RANDOM_INTERNAL_PHILOX_CONSTANTS_HPP
Default Philox constants.
Definition: mcmc.hpp:40