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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/RanluxEngine.h (Version 11.3.0) and /externals/clhep/include/CLHEP/Random/RanluxEngine.h (Version 4.1)


  1 // -*- C++ -*-                                      1 
  2 //                                                
  3 // -------------------------------------------    
  4 //                             HEP Random         
  5 //                        --- RanluxEngine ---    
  6 //                          class header file     
  7 // -------------------------------------------    
  8 // This file is part of Geant4 (simulation too    
  9 //                                                
 10 // The algorithm for this random engine has be    
 11 // implementation in FORTRAN by Fred James as     
 12 // library.                                       
 13 // The initialisation is carried out using a M    
 14 // generator using formula constants of L'Ecuy    
 15 // Comp. Phys. Comm. 60 (1990) 329-344".          
 16                                                   
 17 // ===========================================    
 18 // Adeyemi Adesanya - Created: 6th November 19    
 19 // Gabriele Cosmo - Adapted & Revised: 22nd No    
 20 // Adeyemi Adesanya - Added setSeeds() method:    
 21 // Gabriele Cosmo - Added flatArray() method:     
 22 //                - Added methods for engine s    
 23 //                - Added default luxury value    
 24 //                  and setSeeds(): 21st July     
 25 // J.Marraffino   - Added stream operators and    
 26 //                  Added automatic seed selec    
 27 //                  engine counter: 14th Feb 1    
 28 // Ken Smith      - Added conversion operators    
 29 // Mark Fischler    Methods put, get for insta    
 30 // Mark Fischler    methods for anonymous save    
 31 // ===========================================    
 32                                                   
 33 #ifndef RanluxEngine_h                            
 34 #define RanluxEngine_h 1                          
 35                                                   
 36 #include "CLHEP/Random/RandomEngine.h"            
 37                                                   
 38 namespace CLHEP {                                 
 39                                                   
 40 /**                                               
 41  * @author                                        
 42  * @ingroup random                                
 43  */                                               
 44 class RanluxEngine : public HepRandomEngine {     
 45                                                   
 46 public:                                           
 47                                                   
 48   RanluxEngine( std::istream& is );               
 49   RanluxEngine();                                 
 50   RanluxEngine( long seed, int lxr = 3 );         
 51   RanluxEngine( int rowIndex, int colIndex, in    
 52   virtual ~RanluxEngine();                        
 53   // Constructors and destructor                  
 54                                                   
 55 // Luxury level is set in the same way as the     
 56 //  level 0  (p=24): equivalent to the origina    
 57 //           and Zaman, very long period, but     
 58 //  level 1  (p=48): considerable improvement     
 59 //           now passes the gap test, but stil    
 60 //  level 2  (p=97): passes all known tests, b    
 61 //           defective.                           
 62 //  level 3  (p=223): DEFAULT VALUE.  Any theo    
 63 //           correlations have very small chan    
 64 //  level 4  (p=389): highest possible luxury,    
 65                                                   
 66   double flat();                                  
 67   // It returns a pseudo random number between    
 68   // excluding the end points.                    
 69                                                   
 70   void flatArray (const int size, double* vect    
 71   // Fills the array "vect" of specified size     
 72                                                   
 73   void setSeed(long seed, int lxr=3);             
 74   // Sets the state of the algorithm according    
 75                                                   
 76   void setSeeds(const long * seeds, int lxr=3)    
 77   // Sets the state of the algorithm according    
 78   // array of seeds. Only the first seed is us    
 79                                                   
 80   void saveStatus( const char filename[] = "Ra    
 81   // Saves on file Ranlux.conf the current eng    
 82                                                   
 83   void restoreStatus( const char filename[] =     
 84   // Reads from file Ranlux.conf the last save    
 85   // and restores it.                             
 86                                                   
 87   void showStatus() const;                        
 88   // Dumps the engine status on the screen.       
 89                                                   
 90   int getLuxury() const { return luxury; }        
 91   // Gets the luxury level.                       
 92                                                   
 93   operator double();       // Returns same as     
 94   operator float();        // less precise fla    
 95   operator unsigned int(); // 32-bit flat, but    
 96                                                   
 97   virtual std::ostream & put (std::ostream & o    
 98   virtual std::istream & get (std::istream & i    
 99   static  std::string beginTag ( );               
100   virtual std::istream & getState ( std::istre    
101                                                   
102   std::string name() const;                       
103   static std::string engineName() {return "Ran    
104                                                   
105   std::vector<unsigned long> put () const;        
106   bool get (const std::vector<unsigned long> &    
107   bool getState (const std::vector<unsigned lo    
108                                                   
109   static const unsigned int VECTOR_STATE_SIZE     
110                                                   
111 private:                                          
112                                                   
113   int nskip, luxury;                              
114   float float_seed_table[24];                     
115   int i_lag,j_lag;                                
116   float carry;                                    
117   int count24;                                    
118   static const int int_modulus = 0x1000000;       
119 };                                                
120                                                   
121 }  // namespace CLHEP                             
122                                                   
123 #endif                                            
124