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 // Class for Gauss-Legendre integration method 00032 // Roots of ortogonal polynoms and corresponding weights are calculated based on 00033 // iteration method (by bisection Newton algorithm). Constant values for initial 00034 // approximations were derived from the book: M. Abramowitz, I. Stegun, Handbook 00035 // of mathematical functions, DOVER Publications INC, New York 1965 ; chapters 9, 00036 // 10, and 22 . 00037 // 00038 // ------------------------- CONSTRUCTORS: ------------------------------- 00039 // 00040 // Constructor for GaussLegendre quadrature method. The value nLegendre set the 00041 // accuracy required, i.e the number of points where the function pFunction will 00042 // be evaluated during integration. The constructor creates the arrays for 00043 // abscissas and weights that used in Gauss-Legendre quadrature method. 00044 // The values a and b are the limits of integration of the pFunction. 00045 // 00046 // G4GaussLegendreQ( function pFunction, 00047 // G4int nLegendre ) 00048 // 00049 // -------------------------- METHODS: --------------------------------------- 00050 // 00051 // Returns the integral of the function to be pointed by fFunction between a and b, 00052 // by 2*fNumber point Gauss-Legendre integration: the function is evaluated exactly 00053 // 2*fNumber Times at interior points in the range of integration. Since the weights 00054 // and abscissas are, in this case, symmetric around the midpoint of the range of 00055 // integration, there are actually only fNumber distinct values of each. 00056 // 00057 // G4double Integral(G4double a, G4double b) const 00058 // 00059 // ----------------------------------------------------------------------- 00060 // 00061 // Returns the integral of the function to be pointed by fFunction between a and b, 00062 // by ten point Gauss-Legendre integration: the function is evaluated exactly 00063 // ten Times at interior points in the range of integration. Since the weights 00064 // and abscissas are, in this case, symmetric around the midpoint of the range of 00065 // integration, there are actually only five distinct values of each 00066 // 00067 // G4double 00068 // QuickIntegral(G4double a, G4double b) const 00069 // 00070 // --------------------------------------------------------------------- 00071 // 00072 // Returns the integral of the function to be pointed by fFunction between a and b, 00073 // by 96 point Gauss-Legendre integration: the function is evaluated exactly 00074 // ten Times at interior points in the range of integration. Since the weights 00075 // and abscissas are, in this case, symmetric around the midpoint of the range of 00076 // integration, there are actually only five distinct values of each 00077 // 00078 // G4double 00079 // AccurateIntegral(G4double a, G4double b) const 00080 00081 // ------------------------------- HISTORY -------------------------------- 00082 // 00083 // 13.05.97 V.Grichine (Vladimir.Grichine@cern.chz0 00084 00085 #ifndef G4GAUSSLEGENDREQ_HH 00086 #define G4GAUSSLEGENDREQ_HH 00087 00088 #include "G4VGaussianQuadrature.hh" 00089 00090 class G4GaussLegendreQ : public G4VGaussianQuadrature 00091 { 00092 public: 00093 explicit G4GaussLegendreQ( function pFunction ) ; 00094 00095 00096 G4GaussLegendreQ( function pFunction, 00097 G4int nLegendre ) ; 00098 00099 // Methods 00100 00101 G4double Integral(G4double a, G4double b) const ; 00102 00103 G4double QuickIntegral(G4double a, G4double b) const ; 00104 00105 G4double AccurateIntegral(G4double a, G4double b) const ; 00106 00107 private: 00108 00109 G4GaussLegendreQ(const G4GaussLegendreQ&); 00110 G4GaussLegendreQ& operator=(const G4GaussLegendreQ&); 00111 }; 00112 00113 #endif