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


  1 // -*- C++ -*-                                      1 
  2 //                                                
  3 // -------------------------------------------    
  4 //                             HEP Random         
  5 //                        --- HepJamesRandom -    
  6 //                          class header file     
  7 // -------------------------------------------    
  8 // This file is part of Geant4 (simulation too    
  9 //                                                
 10 // HepJamesRandom implements the algorithm by     
 11 // described in "F.James, Comp. Phys. Comm. 60    
 12 // in FORTRAN77 as part of the MATHLIB HEP lib    
 13 // numbers generation.                            
 14 // This is the default random engine invoked b    
 15 // the user sets a different one.                 
 16                                                   
 17 // ===========================================    
 18 // Gabriele Cosmo - Created: 5th September 199    
 19 //                - Minor corrections: 31st Oc    
 20 //                - Added methods for engine s    
 21 //                - setSeed(), setSeeds() now     
 22 //                  set to zero: 11th July 199    
 23 // J.Marraffino   - Added stream operators and    
 24 //                  Added automatic seed selec    
 25 //                  engine counter: 16th Feb 1    
 26 // Ken Smith      - Added conversion operators    
 27 // V. Innocente   - changed pointers to indice    
 28 // Mark Fischler  - Methods for distrib. insta    
 29 //  Mark Fischler    methods for anonymous sav    
 30 // ===========================================    
 31                                                   
 32 #ifndef HepJamesRandom_h                          
 33 #define HepJamesRandom_h 1                        
 34                                                   
 35 #include "CLHEP/Random/RandomEngine.h"            
 36                                                   
 37 namespace CLHEP {                                 
 38                                                   
 39 /**                                               
 40  * @author                                        
 41  * @ingroup random                                
 42  */                                               
 43 class HepJamesRandom: public HepRandomEngine {    
 44                                                   
 45 public:                                           
 46                                                   
 47   HepJamesRandom(std::istream& is);               
 48   HepJamesRandom();                               
 49   HepJamesRandom(long seed);                      
 50   HepJamesRandom(int rowIndex, int colIndex);     
 51   virtual ~HepJamesRandom();                      
 52   // Constructor and destructor.                  
 53                                                   
 54   double flat();                                  
 55   // Returns a pseudo random number between 0     
 56   // (excluding the end points)                   
 57                                                   
 58   void flatArray (const int size, double* vect    
 59   // Fills the array "vect" of specified size     
 60                                                   
 61   void setSeed(long seed, int dum=0);             
 62   // Sets the state of the algorithm according    
 63                                                   
 64   void setSeeds(const long * seeds, int dum=0)    
 65   // Sets the state of the algorithm according    
 66   // array of seeds. Only the first seed is us    
 67                                                   
 68   void saveStatus( const char filename[] = "Ja    
 69   // Saves on file JamesRand.conf the current     
 70                                                   
 71   void restoreStatus( const char filename[] =     
 72   // Reads from file JamesRand.conf the last s    
 73   // and restores it.                             
 74                                                   
 75   void showStatus() const;                        
 76   // Dumps the engine status on the screen.       
 77                                                   
 78   operator double();                              
 79   // Returns same as flat()                       
 80   operator float();                               
 81   // less precise flat, faster if possible        
 82   operator unsigned int();                        
 83   // 32-bit flat, but slower than double or fl    
 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 "Hep    
 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   // Members defining the current status of th    
102   double u[97];                                   
103   double c, cd, cm;                               
104   int i97, j97;                                   
105 };                                                
106                                                   
107 }  // namespace CLHEP                             
108                                                   
109 #endif                                            
110