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

class ROOT::Math::GaussLegendreIntegrator: public ROOT::Math::GaussIntegrator


   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()
voidROOT::Math::GaussIntegrator::AbsValue(bool flag)
virtual doubleROOT::Math::GaussIntegrator::Error() const
ROOT::Math::GaussIntegratorROOT::Math::GaussIntegrator::GaussIntegrator(const ROOT::Math::GaussIntegrator&)
ROOT::Math::GaussIntegratorROOT::Math::GaussIntegrator::GaussIntegrator(double absTol = 0, double relTol = 0)
ROOT::Math::GaussLegendreIntegratorGaussLegendreIntegrator(const ROOT::Math::GaussLegendreIntegrator&)
ROOT::Math::GaussLegendreIntegratorGaussLegendreIntegrator(int num = 10, double eps = 1e-12)
intGetNumberPoints() const
voidGetWeightVectors(double* x, double* w) const
virtual doubleROOT::Math::GaussIntegrator::Integral()
virtual doubleROOT::Math::GaussIntegrator::Integral(const vector<double>& pts)
virtual doubleROOT::Math::GaussIntegrator::Integral(double a, double b)
virtual doubleROOT::Math::GaussIntegrator::IntegralCauchy(double a, double b, double c)
virtual doubleROOT::Math::GaussIntegrator::IntegralLow(double b)
virtual doubleROOT::Math::GaussIntegrator::IntegralUp(double a)
virtual intNEval() const
ROOT::Math::VirtualIntegratorOneDim&ROOT::Math::VirtualIntegratorOneDim::operator=(const ROOT::Math::VirtualIntegratorOneDim&)
virtual ROOT::Math::IntegratorOneDimOptionsOptions() const
virtual doubleROOT::Math::GaussIntegrator::Result() const
virtual voidSetAbsTolerance(double)
virtual voidROOT::Math::GaussIntegrator::SetFunction(const ROOT::Math::IGenFunction&)
voidSetNumberPoints(int num)
virtual voidSetOptions(const ROOT::Math::IntegratorOneDimOptions& opt)
virtual voidSetRelTolerance(double)
virtual intROOT::Math::GaussIntegrator::Status() const
virtual ROOT::Math::IntegrationOneDim::TypeROOT::Math::VirtualIntegratorOneDim::Type() const
private:
voidCalcGaussLegendreSamplingPoints()
virtual doubleDoIntegral(double a, double b, const ROOT::Math::IGenFunction* func)

Data Members

protected:
doubleROOT::Math::GaussIntegrator::fEpsAbsAbsolute error.
doubleROOT::Math::GaussIntegrator::fEpsRelRelative error.
const ROOT::Math::IGenFunction*ROOT::Math::GaussIntegrator::fFunctionPointer to function used.
doubleROOT::Math::GaussIntegrator::fLastErrorError from the last stimation.
doubleROOT::Math::GaussIntegrator::fLastResultResult from the last stimation.
intfNumNumber of points used in the stimation of the integral.
boolROOT::Math::GaussIntegrator::fUsedOnceBool value to check if the function was at least called once.
double*fWWeights of the points used.
double*fXAbscisa of the points used.
static boolROOT::Math::GaussIntegrator::fgAbsValueAbsValue used for the calculation of the integral

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 SetRelTolerance(double )
 Set the desired relative Error. 
void SetAbsTolerance(double )
 This method is not implemented. 
void GetWeightVectors(double* x, double* w) const
 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}

int GetNumberPoints() const
{ return fNum; }
int NEval() const
       return number of function evaluations in calculating the integral
       This is equivalent to the number of points

{ return fNum; }
void SetOptions(const ROOT::Math::IntegratorOneDimOptions& opt)
 set the options
double DoIntegral(double a, double b, const ROOT::Math::IGenFunction* func)
      Integration surrugate method. Return integral of passed function in  interval [a,b]
      Reimplement method of GaussIntegrator using CalcGaussLegendreSamplingPoints

void CalcGaussLegendreSamplingPoints()
      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