source: trunk/source/global/HEPNumerics/include/G4Integrator.hh @ 1350

Last change on this file since 1350 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 5.4 KB
Line 
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,v 1.7 2006/06/29 18:59:45 gunter Exp $
28// GEANT4 tag $Name: geant4-09-04-beta-01 $
29//
30// Class description:
31//
32// Template class collecting integrator methods for generic funtions.
33
34// History:
35//
36// 04.09.99 V.Grichine, first implementation based on G4SimpleIntegration class
37//                      H.P.Wellisch, G.Cosmo, and E.Cherniaev advises
38// 08.09.99 V.Grichine, methods involving orthogonal polynomials
39//
40
41
42#ifndef G4INTEGRATOR_HH
43#define G4INTEGRATOR_HH 1
44
45#include "G4Types.hh"
46#include <cmath>
47
48template <class T, class F>
49class G4Integrator
50{
51  public:  // with description
52
53   G4Integrator(){;}
54  ~G4Integrator(){;}
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 ) ;
58 G4double Simpson( G4double (*f)(G4double), 
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 ) ;
64 G4double AdaptiveGauss( G4double (*f)(G4double), 
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) ;
73 G4double Legendre( G4double (*f)(G4double), 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) ;
79 G4double Legendre10( G4double (*f)(G4double), 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) ;
85 G4double Legendre96( G4double (*f)(G4double), 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) ;
91 G4double Chebyshev( G4double (*f)(G4double), 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) ;
97 G4double Laguerre( G4double (*f)(G4double), 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) ;
103 G4double Hermite( G4double (*f)(G4double), 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 ) ;
120 G4double Gauss( G4double (*f)(G4double), 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 ) ;
126 void AdaptGauss( G4double (*f)(G4double), G4double a, G4double b, 
127                  G4double e, G4double& sum, G4int& n ) ;
128
129 G4double GammaLogarithm(G4double xx) ;
130
131 
132} ;
133
134#include "G4Integrator.icc"
135
136#endif
Note: See TracBrowser for help on using the repository browser.