ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Integrator.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Integrator.hh
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 //
28 // Class description:
29 //
30 // Template class collecting integrator methods for generic funtions.
31 
32 // History:
33 //
34 // 04.09.99 V.Grichine, first implementation based on G4SimpleIntegration class
35 // H.P.Wellisch, G.Cosmo, and E.Cherniaev advises
36 // 08.09.99 V.Grichine, methods involving orthogonal polynomials
37 //
38 
39 
40 #ifndef G4INTEGRATOR_HH
41 #define G4INTEGRATOR_HH 1
42 
43 #include "G4Types.hh"
44 #include <cmath>
46 
47 template <class T, class F>
49 {
50  public: // with description
51 
54 
55  G4double Simpson( T& typeT, F f, G4double a, G4double b, G4int n ) ;
56  G4double Simpson( T* ptrT, F f, G4double a, G4double b, G4int n ) ;
58  G4double a, G4double b, G4int n ) ;
59  // Simpson integration method
60 
65  // Adaptive Gauss method
66 
67 
68  // Integration methods involving orthogohol polynomials
69 
70  G4double Legendre( T& typeT, F f, G4double a, G4double b, G4int n) ;
71  G4double Legendre( T* ptrT, F f, G4double a, G4double b, G4int n) ;
73  //
74  // Methods involving Legendre polynomials
75 
76  G4double Legendre10( T& typeT, F f,G4double a, G4double b) ;
77  G4double Legendre10( T* ptrT, F f,G4double a, G4double b) ;
79  //
80  // Legendre10 is very fast and accurate enough
81 
82  G4double Legendre96( T& typeT, F f,G4double a, G4double b) ;
83  G4double Legendre96( T* ptrT, F f,G4double a, G4double b) ;
85  //
86  // Legendre96 is very accurate and fast enough
87 
88  G4double Chebyshev( T& typeT, F f, G4double a, G4double b, G4int n) ;
89  G4double Chebyshev( T* ptrT, F f, G4double a, G4double b, G4int n) ;
91  //
92  // Methods involving Chebyshev polynomials
93 
94  G4double Laguerre( T& typeT, F f, G4double alpha, G4int n) ;
95  G4double Laguerre( T* ptrT, F f, G4double alpha, G4int n) ;
97  //
98  // Method involving Laguerre polynomials
99 
100  G4double Hermite( T& typeT, F f, G4int n) ;
101  G4double Hermite( T* ptrT, F f, G4int n) ;
103  //
104  // Method involving Hermite polynomials
105 
106  G4double Jacobi( T& typeT, F f, G4double alpha, G4double beta, G4int n) ;
107  G4double Jacobi( T* ptrT, F f, G4double alpha, G4double beta, G4int n) ;
109  G4double beta, G4int n) ;
110  // Method involving Jacobi polynomials
111 
112 
113  protected:
114 
115  // Auxiliary function for adaptive Gauss method
116 
117  G4double Gauss( T& typeT, F f, G4double a, G4double b ) ;
118  G4double Gauss( T* ptrT, F f, G4double a, G4double b ) ;
120 
121  void AdaptGauss( T& typeT, F f, G4double a, G4double b,
122  G4double e, G4double& sum, G4int& n) ;
123  void AdaptGauss( T* typeT, F f, G4double a, G4double b,
124  G4double e, G4double& sum, G4int& n ) ;
126  G4double e, G4double& sum, G4int& n ) ;
127 
129 
130 
131 } ;
132 
133 #include "G4Integrator.icc"
134 
135 #endif