00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifndef G4INTEGRATOR_HH
00042 #define G4INTEGRATOR_HH 1
00043
00044 #include "G4Types.hh"
00045 #include <cmath>
00046 #include <CLHEP/Units/PhysicalConstants.h>
00047
00048 template <class T, class F>
00049 class G4Integrator
00050 {
00051 public:
00052
00053 G4Integrator(){;}
00054 ~G4Integrator(){;}
00055
00056 G4double Simpson( T& typeT, F f, G4double a, G4double b, G4int n ) ;
00057 G4double Simpson( T* ptrT, F f, G4double a, G4double b, G4int n ) ;
00058 G4double Simpson( G4double (*f)(G4double),
00059 G4double a, G4double b, G4int n ) ;
00060
00061
00062 G4double AdaptiveGauss( T& typeT, F f, G4double a, G4double b, G4double e ) ;
00063 G4double AdaptiveGauss( T* ptrT, F f, G4double a, G4double b, G4double e ) ;
00064 G4double AdaptiveGauss( G4double (*f)(G4double),
00065 G4double a, G4double b, G4double e ) ;
00066
00067
00068
00069
00070
00071 G4double Legendre( T& typeT, F f, G4double a, G4double b, G4int n) ;
00072 G4double Legendre( T* ptrT, F f, G4double a, G4double b, G4int n) ;
00073 G4double Legendre( G4double (*f)(G4double), G4double a, G4double b, G4int n) ;
00074
00075
00076
00077 G4double Legendre10( T& typeT, F f,G4double a, G4double b) ;
00078 G4double Legendre10( T* ptrT, F f,G4double a, G4double b) ;
00079 G4double Legendre10( G4double (*f)(G4double), G4double a, G4double b) ;
00080
00081
00082
00083 G4double Legendre96( T& typeT, F f,G4double a, G4double b) ;
00084 G4double Legendre96( T* ptrT, F f,G4double a, G4double b) ;
00085 G4double Legendre96( G4double (*f)(G4double), G4double a, G4double b) ;
00086
00087
00088
00089 G4double Chebyshev( T& typeT, F f, G4double a, G4double b, G4int n) ;
00090 G4double Chebyshev( T* ptrT, F f, G4double a, G4double b, G4int n) ;
00091 G4double Chebyshev( G4double (*f)(G4double), G4double a, G4double b, G4int n) ;
00092
00093
00094
00095 G4double Laguerre( T& typeT, F f, G4double alpha, G4int n) ;
00096 G4double Laguerre( T* ptrT, F f, G4double alpha, G4int n) ;
00097 G4double Laguerre( G4double (*f)(G4double), G4double alpha, G4int n) ;
00098
00099
00100
00101 G4double Hermite( T& typeT, F f, G4int n) ;
00102 G4double Hermite( T* ptrT, F f, G4int n) ;
00103 G4double Hermite( G4double (*f)(G4double), G4int n) ;
00104
00105
00106
00107 G4double Jacobi( T& typeT, F f, G4double alpha, G4double beta, G4int n) ;
00108 G4double Jacobi( T* ptrT, F f, G4double alpha, G4double beta, G4int n) ;
00109 G4double Jacobi( G4double (*f)(G4double), G4double alpha,
00110 G4double beta, G4int n) ;
00111
00112
00113
00114 protected:
00115
00116
00117
00118 G4double Gauss( T& typeT, F f, G4double a, G4double b ) ;
00119 G4double Gauss( T* ptrT, F f, G4double a, G4double b ) ;
00120 G4double Gauss( G4double (*f)(G4double), G4double a, G4double b) ;
00121
00122 void AdaptGauss( T& typeT, F f, G4double a, G4double b,
00123 G4double e, G4double& sum, G4int& n) ;
00124 void AdaptGauss( T* typeT, F f, G4double a, G4double b,
00125 G4double e, G4double& sum, G4int& n ) ;
00126 void AdaptGauss( G4double (*f)(G4double), G4double a, G4double b,
00127 G4double e, G4double& sum, G4int& n ) ;
00128
00129 G4double GammaLogarithm(G4double xx) ;
00130
00131
00132 } ;
00133
00134 #include "G4Integrator.icc"
00135
00136 #endif