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


  1 // -*- C++ -*-                                      1 // -*- C++ -*-
  2 //                                                  2 //
  3 // -------------------------------------------      3 // -----------------------------------------------------------------------
  4 //                             HEP Random           4 //                             HEP Random
  5 //                        --- NonRandomEngine       5 //                        --- NonRandomEngine ---
  6 //                          class header file       6 //                          class header file
  7 // -------------------------------------------      7 // -----------------------------------------------------------------------
  8                                                     8 
  9 // This class is present EXCLUSIVELY as a mean      9 // This class is present EXCLUSIVELY as a means to test distributions (and
 10 // other programs that depend on random number     10 // other programs that depend on random numbers) by feeding them a stream
 11 // of "randoms" that the testing program suppl     11 // of "randoms" that the testing program supplies explicitly.
 12 //                                                 12 //
 13 // The testing program calls setNextRandom (do     13 // The testing program calls setNextRandom (double) to setup the next
 14 // value to be produced when flat() is done.       14 // value to be produced when flat() is done.  
 15 //                                                 15 //
 16 // To protect against accidental use of this N     16 // To protect against accidental use of this NON-RANDOM engine as a random
 17 // engine, if setNextRandom () is never called     17 // engine, if setNextRandom () is never called, all attempts to generate
 18 // a random will fail and exit.                    18 // a random will fail and exit.
 19                                                    19 
 20 // ===========================================     20 // =======================================================================
 21 // Mark Fischler  - Created: 9/30/99               21 // Mark Fischler  - Created: 9/30/99
 22 // Mark Fischler    methods for distrib. insta     22 // Mark Fischler    methods for distrib. instance save/restore 12/8/04    
 23 // Mark Fischler    methods for anonymous save     23 // Mark Fischler    methods for anonymous save/restore 12/27/04    
 24 // ===========================================     24 // =======================================================================
 25                                                    25 
 26 #ifndef NonRandomEngine_h                          26 #ifndef NonRandomEngine_h
 27 #define NonRandomEngine_h 1                        27 #define NonRandomEngine_h 1
 28                                                    28 
 29 #include "CLHEP/Random/RandomEngine.h"             29 #include "CLHEP/Random/RandomEngine.h"
 30 #include <vector>                                  30 #include <vector>
 31                                                    31 
 32 namespace CLHEP {                                  32 namespace CLHEP {
 33                                                    33 
 34 /**                                                34 /**
 35  * @author                                         35  * @author
 36  * @ingroup random                                 36  * @ingroup random
 37  */                                                37  */
 38 class NonRandomEngine : public HepRandomEngine     38 class NonRandomEngine : public HepRandomEngine {
 39                                                    39 
 40 public:                                            40 public:
 41                                                    41 
 42   NonRandomEngine();                               42   NonRandomEngine();
 43   virtual ~NonRandomEngine();                      43   virtual ~NonRandomEngine();
 44   // Constructors and destructor                   44   // Constructors and destructor
 45                                                    45 
 46   void setNextRandom     (double r);               46   void setNextRandom     (double r);
 47   // Preset the next random to be delivered        47   // Preset the next random to be delivered
 48   void setRandomSequence (double *s, int n);       48   void setRandomSequence (double *s, int n);
 49   // Establish a sequence of n next randoms;       49   // Establish a sequence of n next randoms; 
 50   // replaces setNextRandom n times.               50   // replaces setNextRandom n times.
 51   void setRandomInterval (double x);               51   void setRandomInterval (double x);
 52   // Establish that if there is no sequence ac     52   // Establish that if there is no sequence active each 
 53   // random should be bumped by this interval      53   // random should be bumped by this interval (mod 1) compared 
 54   // to the last.  x should be between 0 and 1     54   // to the last.  x should be between 0 and 1.
 55                                                    55 
 56   double flat();                                   56   double flat();
 57   // It returns the previously established set     57   // It returns the previously established setNextRandom and bumps that up
 58   // by the non-zero randomInterval supplied.      58   // by the non-zero randomInterval supplied.  Thus repeated calls to flat()
 59   // generate an evenly spaced sequence (mod 1     59   // generate an evenly spaced sequence (mod 1).
 60                                                    60 
 61   void flatArray (const int size, double* vect     61   void flatArray (const int size, double* vect);
 62   // Fills the array "vect" of specified size      62   // Fills the array "vect" of specified size with flat random values.
 63                                                    63 
 64   virtual std::ostream & put (std::ostream & o     64   virtual std::ostream & put (std::ostream & os) const;
 65   virtual std::istream & get (std::istream & i     65   virtual std::istream & get (std::istream & is);
 66   static  std::string beginTag ( );                66   static  std::string beginTag ( );
 67   virtual std::istream & getState ( std::istre     67   virtual std::istream & getState ( std::istream & is );
 68                                                    68 
 69   std::string name() const;                        69   std::string name() const;
 70   static std::string engineName() {return "Non     70   static std::string engineName() {return "NonRandomEngine";}
 71                                                    71 
 72   std::vector<unsigned long> put () const;         72   std::vector<unsigned long> put () const;
 73   bool get (const std::vector<unsigned long> &     73   bool get (const std::vector<unsigned long> & v);
 74   bool getState (const std::vector<unsigned lo     74   bool getState (const std::vector<unsigned long> & v);
 75                                                    75   
 76 private:                                           76 private:
 77                                                    77 
 78   bool nextHasBeenSet;                             78   bool nextHasBeenSet;
 79   bool sequenceHasBeenSet;                         79   bool sequenceHasBeenSet;
 80   bool intervalHasBeenSet;                         80   bool intervalHasBeenSet;
 81   double  nextRandom;                              81   double  nextRandom;
 82   std::vector<double> sequence;                    82   std::vector<double> sequence;
 83   unsigned int nInSeq;                             83   unsigned int nInSeq;
 84   double  randomInterval;                          84   double  randomInterval;
 85                                                    85 
 86   // The following are necessary to fill virtu     86   // The following are necessary to fill virtual methods but should never 
 87   // be used:                                      87   // be used:
 88                                                    88 
 89   virtual void setSeed(long , int) {};             89   virtual void setSeed(long , int) {};
 90   virtual void setSeeds(const long * , int) {}     90   virtual void setSeeds(const long * , int) {};
 91   virtual void saveStatus( const char * ) cons     91   virtual void saveStatus( const char * ) const {};
 92   virtual void restoreStatus( const char * ) {     92   virtual void restoreStatus( const char * ) {};
 93   virtual void showStatus() const {};              93   virtual void showStatus() const {};
 94                                                    94 
 95                                                    95  
 96 };                                                 96 };
 97                                                    97 
 98 }  // namespace CLHEP                              98 }  // namespace CLHEP
 99                                                    99 
100 #endif                                            100 #endif
101                                                   101