CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: IncompleteGamma.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $ 00003 //---------------------IncompleteGamma--------------------------------------// 00004 // // 00005 // Class IncompleteGamma, the incomplete Gamma function // 00006 // Joe Boudreau, October 2000 // 00007 // // 00008 //--------------------------------------------------------------------------// 00009 #ifndef IncompleteGamma_h 00010 #define IncompleteGamma_h 1 00011 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00012 #include "CLHEP/GenericFunctions/Parameter.hh" 00013 #include "CLHEP/GenericFunctions/LogGamma.hh" 00014 namespace Genfun { 00015 00020 class IncompleteGamma : public AbsFunction { 00021 00022 FUNCTION_OBJECT_DEF(IncompleteGamma) 00023 00024 public: 00025 00026 // Constructor 00027 IncompleteGamma(); 00028 00029 // Copy constructor 00030 IncompleteGamma(const IncompleteGamma &right); 00031 00032 // Destructor 00033 virtual ~IncompleteGamma(); 00034 00035 // Retreive function value 00036 virtual double operator ()(double argument) const; 00037 virtual double operator ()(const Argument & arg) const {return operator() (arg[0]);} 00038 00039 // Get the paramter a 00040 Parameter & a(); 00041 00042 private: 00043 00044 // It is illegal to assign an adjustable constant 00045 const IncompleteGamma & operator=(const IncompleteGamma &right); 00046 00047 // Here is the parameter of the Incomplete Gamma Function 00048 Parameter _a; 00049 00050 // Compute via series representation: 00051 double _gamser(double a, double x, double logGamma) const; 00052 00053 // Compute via continued fraction representation: 00054 double _gammcf(double a, double x, double logGamma) const; 00055 00056 // This function has a LogGamma Function; 00057 LogGamma _logGamma; 00058 00059 static const int ITMAX; 00060 static const double EPS; 00061 static const double FPMIN; 00062 00063 }; 00064 } // namespace Genfun 00065 #endif