ROOT logo
ROOT » MATH » MATHCORE » ROOT::Math::GaussLegendreIntegrator

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
virtual doubleROOT::Math::VirtualIntegrator::Error() 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 doubleROOT::Math::VirtualIntegratorOneDim::Integral()
virtual doubleIntegral(const vector<double>& pts)
virtual doubleROOT::Math::VirtualIntegratorOneDim::Integral(const vector<double>& pts)
virtual doubleIntegral(double a, double b)
virtual doubleROOT::Math::VirtualIntegratorOneDim::Integral(double a, double b)
virtual doubleIntegralCauchy(double a, double b, double c)
virtual doubleROOT::Math::VirtualIntegratorOneDim::IntegralCauchy(double a, double b, double c)
virtual doubleIntegralLow(double b)
virtual doubleROOT::Math::VirtualIntegratorOneDim::IntegralLow(double b)
virtual doubleIntegralUp(double a)
virtual doubleROOT::Math::VirtualIntegratorOneDim::IntegralUp(double a)
ROOT::Math::VirtualIntegratorOneDim&ROOT::Math::VirtualIntegratorOneDim::operator=(const ROOT::Math::VirtualIntegratorOneDim&)
ROOT::Math::VirtualIntegrator&ROOT::Math::VirtualIntegrator::operator=(const ROOT::Math::VirtualIntegrator&)
virtual doubleResult() const
virtual doubleROOT::Math::VirtualIntegrator::Result() const
virtual voidSetAbsTolerance(double)
virtual voidROOT::Math::VirtualIntegrator::SetAbsTolerance(double)
virtual voidSetFunction(const ROOT::Math::IGenFunction&, bool copy = false)
virtual voidROOT::Math::VirtualIntegratorOneDim::SetFunction(const ROOT::Math::IGenFunction&, bool copy = false)
voidSetNumberPoints(int num)
virtual voidSetRelTolerance(double)
virtual voidROOT::Math::VirtualIntegrator::SetRelTolerance(double)
virtual intStatus() const
virtual intROOT::Math::VirtualIntegrator::Status() const

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() const
 Returns the result of the last integral calculation. 
double Error() const
 Return the estimate of the absolute Error of the last Integral calculation. 
int Status() const
 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()
 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