Geant4_10
G4Integrator.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4Integrator.hh 67970 2013-03-13 10:10:06Z gcosmo $
28 //
29 // Class description:
30 //
31 // Template class collecting integrator methods for generic funtions.
32 
33 // History:
34 //
35 // 04.09.99 V.Grichine, first implementation based on G4SimpleIntegration class
36 // H.P.Wellisch, G.Cosmo, and E.Cherniaev advises
37 // 08.09.99 V.Grichine, methods involving orthogonal polynomials
38 //
39 
40 
41 #ifndef G4INTEGRATOR_HH
42 #define G4INTEGRATOR_HH 1
43 
44 #include "G4Types.hh"
45 #include <cmath>
47 
48 template <class T, class F>
50 {
51  public: // with description
52 
55 
56  G4double Simpson( T& typeT, F f, G4double a, G4double b, G4int n ) ;
57  G4double Simpson( T* ptrT, F f, G4double a, G4double b, G4int n ) ;
59  G4double a, G4double b, G4int n ) ;
60  // Simpson integration method
61 
62  G4double AdaptiveGauss( T& typeT, F f, G4double a, G4double b, G4double e ) ;
63  G4double AdaptiveGauss( T* ptrT, F f, G4double a, G4double b, G4double e ) ;
65  G4double a, G4double b, G4double e ) ;
66  // Adaptive Gauss method
67 
68 
69  // Integration methods involving orthogohol polynomials
70 
71  G4double Legendre( T& typeT, F f, G4double a, G4double b, G4int n) ;
72  G4double Legendre( T* ptrT, F f, G4double a, G4double b, G4int n) ;
74  //
75  // Methods involving Legendre polynomials
76 
77  G4double Legendre10( T& typeT, F f,G4double a, G4double b) ;
78  G4double Legendre10( T* ptrT, F f,G4double a, G4double b) ;
80  //
81  // Legendre10 is very fast and accurate enough
82 
83  G4double Legendre96( T& typeT, F f,G4double a, G4double b) ;
84  G4double Legendre96( T* ptrT, F f,G4double a, G4double b) ;
86  //
87  // Legendre96 is very accurate and fast enough
88 
89  G4double Chebyshev( T& typeT, F f, G4double a, G4double b, G4int n) ;
90  G4double Chebyshev( T* ptrT, F f, G4double a, G4double b, G4int n) ;
92  //
93  // Methods involving Chebyshev polynomials
94 
95  G4double Laguerre( T& typeT, F f, G4double alpha, G4int n) ;
96  G4double Laguerre( T* ptrT, F f, G4double alpha, G4int n) ;
98  //
99  // Method involving Laguerre polynomials
100 
101  G4double Hermite( T& typeT, F f, G4int n) ;
102  G4double Hermite( T* ptrT, F f, G4int n) ;
104  //
105  // Method involving Hermite polynomials
106 
107  G4double Jacobi( T& typeT, F f, G4double alpha, G4double beta, G4int n) ;
108  G4double Jacobi( T* ptrT, F f, G4double alpha, G4double beta, G4int n) ;
109  G4double Jacobi( G4double (*f)(G4double), G4double alpha,
110  G4double beta, G4int n) ;
111  // Method involving Jacobi polynomials
112 
113 
114  protected:
115 
116  // Auxiliary function for adaptive Gauss method
117 
118  G4double Gauss( T& typeT, F f, G4double a, G4double b ) ;
119  G4double Gauss( T* ptrT, F f, G4double a, G4double b ) ;
121 
122  void AdaptGauss( T& typeT, F f, G4double a, G4double b,
123  G4double e, G4double& sum, G4int& n) ;
124  void AdaptGauss( T* typeT, F f, G4double a, G4double b,
125  G4double e, G4double& sum, G4int& n ) ;
127  G4double e, G4double& sum, G4int& n ) ;
128 
130 
131 
132 } ;
133 
134 #include "G4Integrator.icc"
135 
136 #endif
G4double Legendre10(T &typeT, F f, G4double a, G4double b)
G4double GammaLogarithm(G4double xx)
G4double Legendre96(T &typeT, F f, G4double a, G4double b)
tuple a
Definition: test.py:11
void AdaptGauss(T &typeT, F f, G4double a, G4double b, G4double e, G4double &sum, G4int &n)
G4double Hermite(T &typeT, F f, G4int n)
Double_t xx
Definition: macro.C:10
G4double Legendre(T &typeT, F f, G4double a, G4double b, G4int n)
int G4int
Definition: G4Types.hh:78
G4double Jacobi(T &typeT, F f, G4double alpha, G4double beta, G4int n)
TFile f
Definition: plotHisto.C:6
G4double AdaptiveGauss(T &typeT, F f, G4double a, G4double b, G4double e)
tuple b
Definition: test.py:12
Char_t n[5]
G4double Chebyshev(T &typeT, F f, G4double a, G4double b, G4int n)
G4double Simpson(T &typeT, F f, G4double a, G4double b, G4int n)
double G4double
Definition: G4Types.hh:76
G4double Gauss(T &typeT, F f, G4double a, G4double b)
G4double Laguerre(T &typeT, F f, G4double alpha, G4int n)