Warning, file /include/CLHEP/Random/DualRand.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039 #ifndef DualRand_h
0040 #define DualRand_h
0041
0042 #include "CLHEP/Random/defs.h"
0043 #include "CLHEP/Random/RandomEngine.h"
0044
0045 namespace CLHEP {
0046
0047
0048
0049
0050
0051 class DualRand: public HepRandomEngine {
0052
0053 public:
0054
0055 DualRand();
0056 DualRand(long seed);
0057 DualRand(std::istream & is);
0058 DualRand(int rowIndex, int colIndex);
0059 virtual ~DualRand();
0060
0061
0062
0063
0064
0065 double flat();
0066
0067
0068
0069 void flatArray(const int size, double * vect);
0070
0071
0072 void setSeed(long seed, int);
0073
0074
0075 void setSeeds(const long * seeds, int);
0076
0077
0078
0079 void saveStatus( const char filename[] = "DualRand.conf") const;
0080
0081
0082 void restoreStatus( const char filename[] = "DualRand.conf" );
0083
0084
0085 void showStatus() const;
0086
0087
0088 operator double();
0089 operator float();
0090 operator unsigned int();
0091
0092 virtual std::ostream & put (std::ostream & os) const;
0093 virtual std::istream & get (std::istream & is);
0094 static std::string beginTag ( );
0095 virtual std::istream & getState ( std::istream & is );
0096
0097 std::string name() const;
0098 static std::string engineName() {return "DualRand";}
0099
0100 std::vector<unsigned long> put () const;
0101 bool get (const std::vector<unsigned long> & v);
0102 bool getState (const std::vector<unsigned long> & v);
0103
0104 static const unsigned int VECTOR_STATE_SIZE = 9;
0105
0106 private:
0107
0108
0109
0110 class Tausworthe {
0111 public:
0112 Tausworthe();
0113 Tausworthe(unsigned int seed);
0114 operator unsigned int();
0115 void put(std::ostream & os) const;
0116 void put(std::vector<unsigned long> & v) const;
0117 void get(std::istream & is);
0118 bool get(std::vector<unsigned long>::const_iterator & iv);
0119 private:
0120 int wordIndex;
0121 unsigned int words[4];
0122 };
0123
0124 class IntegerCong {
0125 public:
0126 IntegerCong();
0127 IntegerCong(unsigned int seed, int streamNumber);
0128 operator unsigned int();
0129 void put(std::ostream & os) const;
0130 void put(std::vector<unsigned long> & v) const;
0131 void get(std::istream & is);
0132 bool get(std::vector<unsigned long>::const_iterator & iv);
0133 private:
0134 unsigned int state, multiplier, addend;
0135 };
0136
0137 int numEngines;
0138 Tausworthe tausworthe;
0139 IntegerCong integerCong;
0140
0141 };
0142
0143 }
0144
0145 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
0146
0147 using namespace CLHEP;
0148 #endif
0149
0150 #endif