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[ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/clhep/include/CLHEP/Random/Ranlux64Engine.h (Version 11.3.0) and /externals/clhep/include/CLHEP/Random/Ranlux64Engine.h (Version 9.3.p2)


  1 // -*- C++ -*-                                      1 
  2 //                                                
  3 // -------------------------------------------    
  4 //                             HEP Random         
  5 //                        --- Ranlux64Engine -    
  6 //                          class header file     
  7 // -------------------------------------------    
  8 // The algorithm for this random engine has be    
  9 // a double-precision ranlux implementation by    
 10 // November 1997.                                 
 11 //                                                
 12 // Like the previous ranlux generator, this on    
 13 // determining how many pseudo-random numbers     
 14 // twelve values used. Three levels are given,    
 15 // himself advocates only the highest two leve    
 16 //  level 0  (p=109):              Throw away     
 17 //  level 1  (p=202):   (default)  Throw away     
 18 //  level 2  (p=397):              Throw away     
 19 //                                                
 20 // The initialization is carried out using a M    
 21 // generator using formula constants of L'Ecuy    
 22 // Comp. Phys. Comm. 60 (1990) 329-344".          
 23 // ===========================================    
 24 // Ken Smith      - Created Initial draft: 14t    
 25 //                - Added conversion operators    
 26 // Mark Fischler                                  
 27 // 9/9/98   - Added update() routine to allow     
 28 //      - Replaced algorithm with jone exactly    
 29 //      48-bits generated                         
 30 //      skip n-12 instead of n numbers            
 31 //      - Corrected protection agains overflow    
 32 // 12/8/04        - Methods for instance save/    
 33 // 12/27/04       - methods for anonymous save    
 34 //                                                
 35 // ===========================================    
 36                                                   
 37 #ifndef Ranlux64Engine_h                          
 38 #define Ranlux64Engine_h                          
 39                                                   
 40 #include "CLHEP/Random/RandomEngine.h"            
 41                                                   
 42 namespace CLHEP {                                 
 43                                                   
 44 /**                                               
 45  * @author                                        
 46  * @ingroup random                                
 47  */                                               
 48 class Ranlux64Engine : public HepRandomEngine     
 49                                                   
 50 public:                                           
 51                                                   
 52   Ranlux64Engine( std::istream& is );             
 53   Ranlux64Engine();                               
 54   Ranlux64Engine( long seed, int lxr = 1 );       
 55   Ranlux64Engine( int rowIndex, int colIndex,     
 56   virtual ~Ranlux64Engine();                      
 57   // Constructors and destructor                  
 58                                                   
 59   double flat();                                  
 60   // It returns a pseudo random number between    
 61   // excluding the end points.                    
 62                                                   
 63   void flatArray (const int size, double* vect    
 64   // Fills the array "vect" of specified size     
 65                                                   
 66   void setSeed(long seed, int lxr=1);             
 67   // Sets the state of the algorithm according    
 68                                                   
 69   void setSeeds(const long * seeds, int lxr=1)    
 70   // Sets the state of the algorithm according    
 71   // array of seeds.  Only the first seed is u    
 72                                                   
 73   void saveStatus( const char filename[] = "Ra    
 74   // Saves in named file the current engine st    
 75                                                   
 76   void restoreStatus( const char filename[] =     
 77   // Reads from named file the last saved engi    
 78                                                   
 79   void showStatus() const;                        
 80   // Dumps the engine status on the screen.       
 81                                                   
 82   int getLuxury() const { return luxury; }        
 83   // Gets the luxury level.                       
 84                                                   
 85   virtual std::ostream & put (std::ostream & o    
 86   virtual std::istream & get (std::istream & i    
 87   static  std::string beginTag ( );               
 88   virtual std::istream & getState ( std::istre    
 89                                                   
 90   std::string name() const;                       
 91   static std::string engineName() {return "Ran    
 92                                                   
 93   std::vector<unsigned long> put () const;        
 94   bool get (const std::vector<unsigned long> &    
 95   bool getState (const std::vector<unsigned lo    
 96                                                   
 97   static const unsigned int VECTOR_STATE_SIZE     
 98                                                   
 99 private:                                          
100                                                   
101   void update();                                  
102   void advance(int dozens);                       
103                                                   
104   int pDiscard;     // separate sequence by p-    
105   int pDozens;      // pDiscard / 12;             
106   int endIters;     // pDiscard % 12;             
107   int luxury;                                     
108                                                   
109   int index;                                      
110   double randoms[12]; // randoms [i] is the x[    
111   double carry;                                   
112                                                   
113 }; // Ranlux64Engine                              
114                                                   
115 }  // namespace CLHEP                             
116                                                   
117 #endif // Ranlux64Engine_h                        
118