class ROOT::Math::GaussLegendreIntegrator: public ROOT::Math::VirtualIntegratorOneDim


   User class for performing function integration.

   It will use the Gauss-Legendre Method for function integration in a given interval.
   This class is implemented from TF1::Integral().

   @ingroup Integration


Function Members (Methods)

public:
virtual~GaussLegendreIntegrator()
virtual doubleError() const
ROOT::Math::GaussLegendreIntegratorGaussLegendreIntegrator(const ROOT::Math::GaussLegendreIntegrator&)
ROOT::Math::GaussLegendreIntegratorGaussLegendreIntegrator(int num = 10, double eps = 1e-12)
voidGetWeightVectors(double* x, double* w)
virtual doubleIntegral()
virtual doubleIntegral(const vector<double>& pts)
virtual doubleIntegral(double a, double b)
virtual doubleIntegralCauchy(double a, double b, double c)
virtual doubleIntegralLow(double b)
virtual doubleIntegralUp(double a)
ROOT::Math::VirtualIntegratorOneDim&ROOT::Math::VirtualIntegratorOneDim::operator=(const ROOT::Math::VirtualIntegratorOneDim&)
virtual doubleResult() const
virtual voidSetAbsTolerance(double)
virtual voidSetFunction(const ROOT::Math::IGenFunction&, bool copy = false)
voidSetNumberPoints(int num)
virtual voidSetRelTolerance(double)
virtual intStatus() const
private:
voidCalcGaussLegendreSamplingPoints()

Data Members

protected:
doublefEpsilonDesired relative error.
const ROOT::Math::IGenFunction*fFunctionPointer to function used.
boolfFunctionCopiedBool value to check if the function was copied when set.
doublefLastErrorError from the last stimation.
doublefLastResultResult from the last stimation.
intfNumNumber of points used in the stimation of the integral.
boolfUsedOnceBool value to check if the function was at least called once.
double*fWWeights of the points used.
double*fXAbscisa of the points used.

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

GaussLegendreIntegrator(int num = 10, double eps = 1e-12)
 Basic contructor of GaussLegendreIntegrator.
       \@param num Number of desired points to calculate the integration.
       \@param eps Desired relative error.

virtual ~GaussLegendreIntegrator()
 Default Destructor 
void SetNumberPoints(int num)
 Set the number of points used in the calculation of the
integral 
void GetWeightVectors(double* x, double* w)
 Returns the arrays x and w containing the abscissa and weight of
       the Gauss-Legendre n-point quadrature formula.

       Gauss-Legendre: W(x)=1 -1<x<1
                       (j+1)P_{j+1} = (2j+1)xP_j-jP_{j-1}

void SetRelTolerance(double )
 Implementing VirtualIntegrator Interface
 Set the desired relative Error. 
void SetAbsTolerance(double )
 Absolute Tolerance is not used in this class. 
double Result()
 Returns the result of the last integral calculation. 
double Error()
 Return the estimate of the absolute Error of the last Integral calculation. 
int Status()
 This method is not implemented. 
double Integral(double a, double b)
 Implementing VirtualIntegratorOneDim Interface
 Gauss-Legendre integral, see CalcGaussLegendreSamplingPoints. 
void SetFunction(const ROOT::Math::IGenFunction& , bool copy = false)
 Set integration function (flag control if function must be copied inside).
       \@param f Function to be used in the calculations.
       \@param copy Indicates whether the function has to be copied.

double Integral(const vector<double>& pts)
 This method is not implemented. 
double IntegralUp(double a)
 This method is not implemented. 
double IntegralLow(double b)
This method is not implemented. 
double Integral(const vector<double>& pts)
 This method is not implemented. 
double IntegralCauchy(double a, double b, double c)
 This method is not implemented. 
void CalcGaussLegendreSamplingPoints()
 Middle functions

      Type: unsafe but fast interface filling the arrays x and w (static method)

      Given the number of sampling points this routine fills the arrays x and w
      of length num, containing the abscissa and weight of the Gauss-Legendre
      n-point quadrature formula.

      Gauss-Legendre: W(x)=1  -1<x<1
                      (j+1)P_{j+1} = (2j+1)xP_j-jP_{j-1}

      num is the number of sampling points (>0)
      x and w are arrays of size num
      eps is the relative precision

      If num<=0 or eps<=0 no action is done.

      Reference: Numerical Recipes in C, Second Edition


Last change: root/mathcore:$Id: GaussLegendreIntegrator.h 22728 2008-03-19 10:05:41Z moneta $
Last generated: 2008-06-25 08:29
Copyright (c) 2006 , LCG ROOT MathLib Team *

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.