File indexing completed on 2025-01-18 10:10:21
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_Math_RanluxppEngine
0013 #define ROOT_Math_RanluxppEngine
0014
0015 #include "Math/TRandomEngine.h"
0016
0017 #include <cstdint>
0018 #include <memory>
0019
0020 namespace ROOT {
0021 namespace Math {
0022
0023 template <int w, int p, int u = 0>
0024 class RanluxppEngineImpl;
0025
0026 template <int p>
0027 class RanluxppEngine final : public TRandomEngine {
0028
0029 private:
0030 using ImplType = RanluxppEngineImpl<48, p>;
0031 std::unique_ptr<ImplType> fImpl;
0032
0033 public:
0034 RanluxppEngine(uint64_t seed = 314159265);
0035 ~RanluxppEngine() override;
0036
0037
0038 double Rndm() override;
0039
0040 double operator()();
0041
0042 uint64_t IntRndm();
0043
0044
0045 void SetSeed(uint64_t seed);
0046
0047 void Skip(uint64_t n);
0048
0049
0050 static const char *Name() { return "RANLUX++"; }
0051 };
0052
0053 using RanluxppEngine24 = RanluxppEngine<24>;
0054 using RanluxppEngine2048 = RanluxppEngine<2048>;
0055
0056 extern template class RanluxppEngine<24>;
0057 extern template class RanluxppEngine<2048>;
0058
0059
0060 template <int p>
0061 class RanluxppCompatEngineJames final : public TRandomEngine {
0062
0063 private:
0064 using ImplType = RanluxppEngineImpl<24, p>;
0065 std::unique_ptr<ImplType> fImpl;
0066
0067 public:
0068 RanluxppCompatEngineJames(uint64_t seed = 314159265);
0069 ~RanluxppCompatEngineJames() override;
0070
0071
0072 double Rndm() override;
0073
0074 double operator()();
0075
0076 uint64_t IntRndm();
0077
0078
0079 void SetSeed(uint64_t seed);
0080
0081 void Skip(uint64_t n);
0082
0083
0084 static const char *Name() { return "RanluxppCompatJames"; }
0085 };
0086
0087
0088
0089 using RanluxppCompatEngineJamesP3 = RanluxppCompatEngineJames<223>;
0090
0091
0092 using RanluxppCompatEngineJamesP4 = RanluxppCompatEngineJames<389>;
0093
0094 extern template class RanluxppCompatEngineJames<223>;
0095 extern template class RanluxppCompatEngineJames<389>;
0096
0097
0098
0099 template <int p>
0100 class RanluxppCompatEngineGslRanlxs final : public TRandomEngine {
0101
0102 private:
0103 using ImplType = RanluxppEngineImpl<24, p>;
0104 std::unique_ptr<ImplType> fImpl;
0105
0106 public:
0107 RanluxppCompatEngineGslRanlxs(uint64_t seed = 1);
0108 ~RanluxppCompatEngineGslRanlxs() override;
0109
0110
0111 double Rndm() override;
0112
0113 double operator()();
0114
0115 uint64_t IntRndm();
0116
0117
0118 void SetSeed(uint64_t seed);
0119
0120 void Skip(uint64_t n);
0121
0122
0123 static const char *Name() { return "RanluxppCompatGslRanlxs"; }
0124 };
0125
0126 using RanluxppCompatEngineGslRanlxs0 = RanluxppCompatEngineGslRanlxs<218>;
0127 using RanluxppCompatEngineGslRanlxs1 = RanluxppCompatEngineGslRanlxs<404>;
0128 using RanluxppCompatEngineGslRanlxs2 = RanluxppCompatEngineGslRanlxs<794>;
0129
0130 extern template class RanluxppCompatEngineGslRanlxs<218>;
0131 extern template class RanluxppCompatEngineGslRanlxs<404>;
0132 extern template class RanluxppCompatEngineGslRanlxs<794>;
0133
0134
0135
0136 template <int p>
0137 class RanluxppCompatEngineGslRanlxd final : public TRandomEngine {
0138
0139 private:
0140 using ImplType = RanluxppEngineImpl<48, p>;
0141 std::unique_ptr<ImplType> fImpl;
0142
0143 public:
0144 RanluxppCompatEngineGslRanlxd(uint64_t seed = 1);
0145 ~RanluxppCompatEngineGslRanlxd() override;
0146
0147
0148 double Rndm() override;
0149
0150 double operator()();
0151
0152 uint64_t IntRndm();
0153
0154
0155 void SetSeed(uint64_t seed);
0156
0157 void Skip(uint64_t n);
0158
0159
0160 static const char *Name() { return "RanluxppCompatGslRanlxd"; }
0161 };
0162
0163 using RanluxppCompatEngineGslRanlxd1 = RanluxppCompatEngineGslRanlxd<404>;
0164 using RanluxppCompatEngineGslRanlxd2 = RanluxppCompatEngineGslRanlxd<794>;
0165
0166 extern template class RanluxppCompatEngineGslRanlxd<404>;
0167 extern template class RanluxppCompatEngineGslRanlxd<794>;
0168
0169
0170 template <int w, int p>
0171 class RanluxppCompatEngineLuescherImpl;
0172
0173
0174 template <int p>
0175 class RanluxppCompatEngineLuescherRanlxs final : public TRandomEngine {
0176
0177 private:
0178 using ImplType = RanluxppCompatEngineLuescherImpl<24, p>;
0179 std::unique_ptr<ImplType> fImpl;
0180
0181 public:
0182 RanluxppCompatEngineLuescherRanlxs(uint64_t seed = 314159265);
0183 ~RanluxppCompatEngineLuescherRanlxs() override;
0184
0185
0186 double Rndm() override;
0187
0188 double operator()();
0189
0190 uint64_t IntRndm();
0191
0192
0193 void SetSeed(uint64_t seed);
0194
0195 void Skip(uint64_t n);
0196
0197
0198 static const char *Name() { return "RanluxppCompatLuescherRanlxs"; }
0199 };
0200
0201 using RanluxppCompatEngineLuescherRanlxs0 = RanluxppCompatEngineLuescherRanlxs<218>;
0202 using RanluxppCompatEngineLuescherRanlxs1 = RanluxppCompatEngineLuescherRanlxs<404>;
0203 using RanluxppCompatEngineLuescherRanlxs2 = RanluxppCompatEngineLuescherRanlxs<794>;
0204
0205 extern template class RanluxppCompatEngineLuescherRanlxs<218>;
0206 extern template class RanluxppCompatEngineLuescherRanlxs<404>;
0207 extern template class RanluxppCompatEngineLuescherRanlxs<794>;
0208
0209
0210
0211 template <int p>
0212 class RanluxppCompatEngineLuescherRanlxd final : public TRandomEngine {
0213
0214 private:
0215 using ImplType = RanluxppCompatEngineLuescherImpl<48, p>;
0216 std::unique_ptr<ImplType> fImpl;
0217
0218 public:
0219 RanluxppCompatEngineLuescherRanlxd(uint64_t seed = 314159265);
0220 ~RanluxppCompatEngineLuescherRanlxd() override;
0221
0222
0223 double Rndm() override;
0224
0225 double operator()();
0226
0227 uint64_t IntRndm();
0228
0229
0230 void SetSeed(uint64_t seed);
0231
0232 void Skip(uint64_t n);
0233
0234
0235 static const char *Name() { return "RanluxppCompatLuescherRanlxd"; }
0236 };
0237 using RanluxppCompatEngineLuescherRanlxd1 = RanluxppCompatEngineLuescherRanlxd<404>;
0238 using RanluxppCompatEngineLuescherRanlxd2 = RanluxppCompatEngineLuescherRanlxd<794>;
0239
0240 extern template class RanluxppCompatEngineLuescherRanlxd<404>;
0241 extern template class RanluxppCompatEngineLuescherRanlxd<794>;
0242
0243
0244
0245 class RanluxppCompatEngineStdRanlux24 final : public TRandomEngine {
0246
0247 private:
0248 using ImplType = RanluxppEngineImpl<24, 223, 23>;
0249 std::unique_ptr<ImplType> fImpl;
0250
0251 public:
0252 RanluxppCompatEngineStdRanlux24(uint64_t seed = 19780503);
0253 ~RanluxppCompatEngineStdRanlux24() override;
0254
0255
0256 double Rndm() override;
0257
0258 double operator()();
0259
0260 uint64_t IntRndm();
0261
0262
0263 void SetSeed(uint64_t seed);
0264
0265 void Skip(uint64_t n);
0266
0267
0268 static const char *Name() { return "RanluxppCompatStdRanlux24"; }
0269 };
0270
0271
0272
0273 class RanluxppCompatEngineStdRanlux48 final : public TRandomEngine {
0274
0275 private:
0276 using ImplType = RanluxppEngineImpl<48, 2 * 389, 11>;
0277 std::unique_ptr<ImplType> fImpl;
0278
0279 public:
0280 RanluxppCompatEngineStdRanlux48(uint64_t seed = 19780503);
0281 ~RanluxppCompatEngineStdRanlux48() override;
0282
0283
0284 double Rndm() override;
0285
0286 double operator()();
0287
0288 uint64_t IntRndm();
0289
0290
0291 void SetSeed(uint64_t seed);
0292
0293 void Skip(uint64_t n);
0294
0295
0296 static const char *Name() { return "RanluxppCompatStdRanlux48"; }
0297 };
0298
0299 }
0300 }
0301
0302 #endif