G4Integrator.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 // Class description:
00030 //
00031 // Template class collecting integrator methods for generic funtions.
00032 
00033 // History:
00034 //
00035 // 04.09.99 V.Grichine, first implementation based on G4SimpleIntegration class
00036 //                      H.P.Wellisch, G.Cosmo, and E.Cherniaev advises
00037 // 08.09.99 V.Grichine, methods involving orthogonal polynomials
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:  // with description
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   // Simpson integration method
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   // Adaptive Gauss method
00067 
00068 
00069   // Integration methods involving orthogohol polynomials
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   // Methods involving Legendre polynomials  
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   // Legendre10 is very fast and accurate enough
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   // Legendre96 is very accurate and fast enough
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   // Methods involving Chebyshev  polynomials  
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   // Method involving Laguerre polynomials
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   // Method involving Hermite polynomials
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   // Method involving Jacobi polynomials
00112 
00113 
00114  protected:
00115 
00116   // Auxiliary function for adaptive Gauss method
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

Generated on Mon May 27 17:48:38 2013 for Geant4 by  doxygen 1.4.7