CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: Bessel.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $ 00003 //---------------------Bessel-------------------------------------------------// 00004 // // 00005 // Class Bessel, providing Bessel Functions The Namespace "FractionalORder" // 00006 // and "Integral order" are nested here, so that you fully specify the class // 00007 // like this: // 00008 // // 00009 // Genfun::FractionalOrder::Bessel // 00010 // // 00011 // or // 00012 // // 00013 // Genfun::IntegralOrder::Bessel // 00014 // // 00015 // // 00016 // Joe Boudreau, April 2001 // 00017 // // 00018 //-------------------------------------------------------------------------- // 00019 #ifndef Bessel_h 00020 #define Bessel_h 1 00021 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00022 #include "CLHEP/GenericFunctions/Parameter.hh" 00023 namespace Genfun { 00024 00025 namespace FractionalOrder { 00030 class Bessel : public AbsFunction { 00031 00032 FUNCTION_OBJECT_DEF(Bessel) 00033 00034 public: 00035 00036 // Enumerated type: 00037 enum Type {J, Y}; 00038 00039 // Constructor: Use this one and you will get a Bessel function of 00040 // integer order 00041 Bessel (Type type); 00042 00043 // Copy constructor 00044 Bessel(const Bessel &right); 00045 00046 // Destructor 00047 virtual ~Bessel(); 00048 00049 // Retreive function value 00050 virtual double operator ()(double argument) const; 00051 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00052 00053 // Get the order of the Bessel Function. Default value, 0.0. If modified the 00054 // Bessel function 00055 Parameter & order(); 00056 const Parameter & order() const; 00057 00058 private: 00059 00060 // It is illegal to assign an adjustable constant 00061 const Bessel & operator=(const Bessel &right); 00062 00063 // The type and order of the Bessel function 00064 Type _type; 00065 Parameter _order; // the fractional order: 00066 00067 }; 00068 } // namespace FractionalOrder 00069 00070 namespace IntegralOrder { 00075 class Bessel : public AbsFunction { 00076 00077 FUNCTION_OBJECT_DEF(Bessel) 00078 00079 public: 00080 00081 // Enumerated type: 00082 enum Type {J, Y}; 00083 00084 // Constructor: Use this one and you will get a Bessel function of 00085 // integer order 00086 Bessel (Type type, unsigned int order); 00087 00088 // Copy constructor 00089 Bessel(const Bessel &right); 00090 00091 // Destructor 00092 virtual ~Bessel(); 00093 00094 // Retreive function value 00095 virtual double operator ()(double argument) const; 00096 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00097 00098 private: 00099 00100 // It is illegal to assign an adjustable constant 00101 const Bessel & operator=(const Bessel &right); 00102 00103 // The type and order of the Bessel function 00104 Type _type; 00105 unsigned int _order; 00106 00107 double _bessel_IJ_taylor(double nu, 00108 double x, 00109 int sign, 00110 int kmax, 00111 double threshhold) const; 00112 00113 }; 00114 } // namespace IntegralOrder 00115 00116 } // namespace Genfun 00117 00118 00119 #include "CLHEP/GenericFunctions/Bessel.icc" 00120 #endif