|
||||
File indexing completed on 2025-01-18 09:54:38
0001 // $Id: Stat.h,v 1.3 2003/10/23 21:29:51 garren Exp $ 0002 // -*- C++ -*- 0003 // 0004 // ----------------------------------------------------------------------- 0005 // HEP Random 0006 // --- HepStat --- 0007 // Purely static class containing useful statistics methods 0008 0009 // ----------------------------------------------------------------------- 0010 0011 // HepStat is a substitute for using a namespace. 0012 // One would never instantiate a HepStat object; 0013 // usage of any of these methods looks like -- 0014 // 0015 // double x = HepStat::erf ( .1 ); 0016 // 0017 // A user may wish to improve the readability of algortihm code which uses 0018 // one method many times by lines like using HepStat::erf 0019 // 0020 // and later, x = erf(u); will work. 0021 // 0022 0023 // These methods are implemented in separate .cc files so that 0024 // user code need pull in only the code that is necessary. Time 0025 // (ROUGH estimates in cycles) and table footprint info is provided 0026 // in this header. 0027 0028 0029 // ======================================================================= 0030 // M. Fischler - Created: 1/25/00 0031 // 0032 // M. Fischler - Inserted flatToGaussian 1/25/00 0033 // From code of an attempt to speed up RandGauss 0034 // by use of tables and splines. The code was not 0035 // significantly faster than Box-Mueller, so that 0036 // algorithm is left as the RandGauss implementation. 0037 // - Inserted inverseErf 0038 // M. Fischler - Inserted gammln 2/4/00 0039 // M. Fischler - Made constructor private; removed private destructor 4/17/00 0040 // ======================================================================= 0041 0042 #ifndef HepStat_h 0043 #define HepStat_h 1 0044 0045 #include "CLHEP/Random/defs.h" 0046 0047 namespace CLHEP { 0048 0049 /** 0050 * @author 0051 * @ingroup random 0052 */ 0053 class HepStat { 0054 0055 private: 0056 HepStat(); 0057 // You CANNOT instantiate a HepStat object. 0058 0059 public: 0060 0061 static double flatToGaussian (double r); 0062 // This is defined by the satement that if e() provides a uniform random 0063 // on (0,1) then flatToGaussian(e()) is distributed as a unit normal 0064 // Gaussian. That is, flatToGaussian is the inverse of the c.d.f. of 0065 // a Gaussian. 0066 // Footprint: 30 K // Time: 150 cycles 0067 0068 static double inverseErf (double t); 0069 static double erf (double x); 0070 // defined in flatToGaussian.cc 0071 0072 static double erfQ (double x); 0073 // Quicker, and with less footprint, than erf and gaussianCDF 0074 // but only accurate to 7 digits. 0075 // Footprint: 0 // Time: 0076 0077 static double gammln (double x); 0078 // ln (gamma(x)) 0079 0080 }; 0081 0082 } // namespace CLHEP 0083 0084 #ifdef ENABLE_BACKWARDS_COMPATIBILITY 0085 // backwards compatibility will be enabled ONLY in CLHEP 1.9 0086 using namespace CLHEP; 0087 #endif 0088 0089 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |