File indexing completed on 2025-12-15 10:11:10
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef RanluxppEngine_h
0023 #define RanluxppEngine_h
0024
0025 #include "CLHEP/Random/RandomEngine.h"
0026
0027 #include <cstdint>
0028
0029 namespace CLHEP {
0030
0031
0032
0033
0034
0035 class RanluxppEngine final : public HepRandomEngine {
0036
0037 public:
0038 RanluxppEngine();
0039 RanluxppEngine(long seed);
0040 RanluxppEngine(std::istream &is);
0041 virtual ~RanluxppEngine();
0042
0043
0044 double flat() override;
0045
0046
0047
0048 void flatArray(const int size, double *vect) override;
0049
0050
0051 void setSeed(long seed, int dummy = 0) override;
0052
0053
0054 void setSeeds(const long *seeds, int dummy = 0) override;
0055
0056
0057
0058 void skip(uint64_t n);
0059
0060
0061 void saveStatus(const char filename[] = "Ranluxpp.conf") const override;
0062
0063
0064 void restoreStatus(const char filename[] = "Ranluxpp.conf") override;
0065
0066
0067 void showStatus() const override;
0068
0069
0070 std::string name() const override;
0071
0072
0073 static std::string engineName();
0074 static std::string beginTag();
0075
0076 std::ostream &put(std::ostream &os) const override;
0077 std::istream &get(std::istream &is) override;
0078
0079 std::istream &getState(std::istream &is) override;
0080
0081 std::vector<unsigned long> put() const override;
0082 bool get(const std::vector<unsigned long> &v) override;
0083 bool getState(const std::vector<unsigned long> &v) override;
0084
0085
0086 operator double() override { return flat(); }
0087 operator float() override { return float(flat()); }
0088 operator unsigned int() override { return (unsigned int)nextRandomBits(); }
0089
0090
0091
0092 static const unsigned int VECTOR_STATE_SIZE = 21;
0093
0094 private:
0095 void advance();
0096 uint64_t nextRandomBits();
0097
0098 uint64_t fState[9];
0099 unsigned fCarry;
0100 int fPosition = 0;
0101
0102 };
0103
0104 }
0105
0106 #endif