CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

Random/Random/Stat.h
Go to the documentation of this file.
1 // $Id: Stat.h,v 1.3 2003/10/23 21:29:51 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- HepStat ---
7 // Purely static class containing useful statistics methods
8 
9 // -----------------------------------------------------------------------
10 
11 // HepStat is a substitute for using a namespace.
12 // One would never instantiate a HepStat object;
13 // usage of any of these methods looks like --
14 //
15 // double x = HepStat::erf ( .1 );
16 //
17 // A user may wish to improve the readability of algortihm code which uses
18 // one method many times by lines like using HepStat::erf
19 //
20 // and later, x = erf(u); will work.
21 //
22 
23 // These methods are implemented in separate .cc files so that
24 // user code need pull in only the code that is necessary. Time
25 // (ROUGH estimates in cycles) and table footprint info is provided
26 // in this header.
27 
28 
29 // =======================================================================
30 // M. Fischler - Created: 1/25/00
31 //
32 // M. Fischler - Inserted flatToGaussian 1/25/00
33 // From code of an attempt to speed up RandGauss
34 // by use of tables and splines. The code was not
35 // significantly faster than Box-Mueller, so that
36 // algorithm is left as the RandGauss implementation.
37 // - Inserted inverseErf
38 // M. Fischler - Inserted gammln 2/4/00
39 // M. Fischler - Made constructor private; removed private destructor 4/17/00
40 // =======================================================================
41 
42 #ifndef HepStat_h
43 #define HepStat_h 1
44 
45 #include "CLHEP/Random/defs.h"
46 
47 namespace CLHEP {
48 
53 class HepStat {
54 
55 private:
56  HepStat();
57  // You CANNOT instantiate a HepStat object.
58 
59 public:
60 
61  static double flatToGaussian (double r);
62  // This is defined by the satement that if e() provides a uniform random
63  // on (0,1) then flatToGaussian(e()) is distributed as a unit normal
64  // Gaussian. That is, flatToGaussian is the inverse of the c.d.f. of
65  // a Gaussian.
66  // Footprint: 30 K // Time: 150 cycles
67 
68  static double inverseErf (double t);
69  static double erf (double x);
70  // defined in flatToGaussian.cc
71 
72  static double erfQ (double x);
73  // Quicker, and with less footprint, than erf and gaussianCDF
74  // but only accurate to 7 digits.
75  // Footprint: 0 // Time:
76 
77  static double gammln (double x);
78  // ln (gamma(x))
79 
80 };
81 
82 } // namespace CLHEP
83 
84 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
85 // backwards compatibility will be enabled ONLY in CLHEP 1.9
86 using namespace CLHEP;
87 #endif
88 
89 #endif
CLHEP::HepStat::erf
static double erf(double x)
Definition: flatToGaussian.cc:275
CLHEP::HepStat::erfQ
static double erfQ(double x)
Definition: erfQ.cc:25
CLHEP::HepStat::flatToGaussian
static double flatToGaussian(double r)
Definition: flatToGaussian.cc:92
CLHEP
Definition: ClhepVersion.h:13
CLHEP::HepStat::inverseErf
static double inverseErf(double t)
Definition: flatToGaussian.cc:266
x
any side effects of that construction would occur twice The semantics of throw x
Definition: whyZMthrowRethrows.txt:37
CLHEP::HepStat::gammln
static double gammln(double x)
Definition: gammln.cc:20