Geant4  10.01.p03
RandGeneral.icc
Go to the documentation of this file.
1 // $Id:$
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandGeneral ---
7 // inlined functions implementation file
8 // -----------------------------------------------------------------------
9 
10 // =======================================================================
11 // Gabriele Cosmo - Created: 20th August 1998
12 //
13 // M. Fischler - Moved fire() and shoot(anEngine) into inline so that
14 // the use of mapRandom does not cost an extra function call.
15 // =======================================================================
16 
17 namespace CLHEP {
18 
19 inline double RandGeneral::fire()
20 {
21  double rand = localEngine->flat();
22  return mapRandom(rand);
23 }
24 
25 inline double RandGeneral::shoot()
26 {
27  return fire();
28 }
29 
30 inline double RandGeneral::operator() ()
31 {
32  return fire();
33 }
34 
35 inline double RandGeneral::shoot( HepRandomEngine* anEngine )
36 {
37  double rand = anEngine->flat();
38  return mapRandom(rand);
39 }
40 
41 inline void RandGeneral::shootArray( const int size, double* vect )
42 {
43  fireArray(size, vect);
44 }
45 
46 } // namespace CLHEP