File indexing completed on 2025-01-18 09:58:30
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef G4INTEGRATOR_HH
0037 #define G4INTEGRATOR_HH 1
0038
0039 #include "G4Types.hh"
0040 #include <CLHEP/Units/PhysicalConstants.h>
0041 #include <cmath>
0042
0043 template <class T, class F>
0044 class G4Integrator
0045 {
0046 public:
0047 G4Integrator() { ; }
0048 ~G4Integrator() { ; }
0049
0050 G4double Simpson(T& typeT, F f, G4double a, G4double b, G4int n);
0051 G4double Simpson(T* ptrT, F f, G4double a, G4double b, G4int n);
0052 G4double Simpson(G4double (*f)(G4double), G4double a, G4double b, G4int n);
0053
0054
0055 G4double AdaptiveGauss(T& typeT, F f, G4double a, G4double b, G4double e);
0056 G4double AdaptiveGauss(T* ptrT, F f, G4double a, G4double b, G4double e);
0057 G4double AdaptiveGauss(G4double (*f)(G4double), G4double a, G4double b,
0058 G4double e);
0059
0060
0061
0062
0063 G4double Legendre(T& typeT, F f, G4double a, G4double b, G4int n);
0064 G4double Legendre(T* ptrT, F f, G4double a, G4double b, G4int n);
0065 G4double Legendre(G4double (*f)(G4double), G4double a, G4double b, G4int n);
0066
0067
0068
0069 G4double Legendre10(T& typeT, F f, G4double a, G4double b);
0070 G4double Legendre10(T* ptrT, F f, G4double a, G4double b);
0071 G4double Legendre10(G4double (*f)(G4double), G4double a, G4double b);
0072
0073
0074
0075 G4double Legendre96(T& typeT, F f, G4double a, G4double b);
0076 G4double Legendre96(T* ptrT, F f, G4double a, G4double b);
0077 G4double Legendre96(G4double (*f)(G4double), G4double a, G4double b);
0078
0079
0080
0081 G4double Chebyshev(T& typeT, F f, G4double a, G4double b, G4int n);
0082 G4double Chebyshev(T* ptrT, F f, G4double a, G4double b, G4int n);
0083 G4double Chebyshev(G4double (*f)(G4double), G4double a, G4double b, G4int n);
0084
0085
0086
0087 G4double Laguerre(T& typeT, F f, G4double alpha, G4int n);
0088 G4double Laguerre(T* ptrT, F f, G4double alpha, G4int n);
0089 G4double Laguerre(G4double (*f)(G4double), G4double alpha, G4int n);
0090
0091
0092
0093 G4double Hermite(T& typeT, F f, G4int n);
0094 G4double Hermite(T* ptrT, F f, G4int n);
0095 G4double Hermite(G4double (*f)(G4double), G4int n);
0096
0097
0098
0099 G4double Jacobi(T& typeT, F f, G4double alpha, G4double beta, G4int n);
0100 G4double Jacobi(T* ptrT, F f, G4double alpha, G4double beta, G4int n);
0101 G4double Jacobi(G4double (*f)(G4double), G4double alpha, G4double beta,
0102 G4int n);
0103
0104
0105 protected:
0106
0107
0108 G4double Gauss(T& typeT, F f, G4double a, G4double b);
0109 G4double Gauss(T* ptrT, F f, G4double a, G4double b);
0110 G4double Gauss(G4double (*f)(G4double), G4double a, G4double b);
0111
0112 void AdaptGauss(T& typeT, F f, G4double a, G4double b, G4double e,
0113 G4double& sum, G4int& n);
0114 void AdaptGauss(T* typeT, F f, G4double a, G4double b, G4double e,
0115 G4double& sum, G4int& n);
0116 void AdaptGauss(G4double (*f)(G4double), G4double a, G4double b, G4double e,
0117 G4double& sum, G4int& n);
0118
0119 G4double GammaLogarithm(G4double xx);
0120 };
0121
0122 #include "G4Integrator.icc"
0123
0124 #endif