69 const double a0 = (
b +
a)/2;
70 const double b0 = (
b -
a)/2;
75 for (
int i=0; i<
fNum; i++)
77 xx[0] = a0 + b0*
fX[i];
78 result +=
fW[i] * (*function)(xx);
94{
MATH_WARN_MSG(
"ROOT::Math::GaussLegendreIntegrator",
"There is no Absolute Tolerance!"); }
116 const unsigned int m = (
fNum+1)/2;
118 double z, pp, p1,p2, p3;
121 for (
unsigned int i=0; i<
m; i++) {
122 z = std::cos(3.14159265358979323846*(i+0.75)/(
fNum+0.5));
132 for (
int j=0; j<
fNum; j++)
136 p1 = ((2.0*j+1.0)*z*p2-j*p3)/(j+1.0);
141 pp =
fNum*(z*p1-p2)/(z*z-1.0);
145 }
while (std::fabs(p1/pp) >
fEpsRel);
152 fW[i] = 2.0/((1.0-z*z)*pp*pp);
#define MATH_WARN_MSG(loc, str)
#define MATH_WARN_MSGVAL(loc, txt, x)
void SetAbsTolerance(double tol)
non-static methods for setting options
double RelTolerance() const
absolute tolerance
void SetRelTolerance(double tol)
set the relative tolerance
void SetWKSize(unsigned int size)
set workspace size
User class for performing function integration.
bool fUsedOnce
Bool value to check if the function was at least called once.
double fLastResult
Result from the last estimation.
double fEpsRel
Relative error.
virtual double DoIntegral(double a, double b, const IGenFunction *func)
Integration surrogate method.
virtual void SetAbsTolerance(double)
This method is not implemented.
virtual ~GaussLegendreIntegrator()
Default Destructor.
virtual void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options (should be re-implemented by derived classes -if more options than tolerance exist
void GetWeightVectors(double *x, double *w) const
Returns the arrays x and w containing the abscissa and weight of the Gauss-Legendre n-point quadratur...
GaussLegendreIntegrator(int num=10, double eps=1e-12)
Basic constructor of GaussLegendreIntegrator.
void CalcGaussLegendreSamplingPoints()
Type: unsafe but fast interface filling the arrays x and w (static method)
double * fX
Abscisa of the points used.
virtual void SetRelTolerance(double)
Set the desired relative Error.
void SetNumberPoints(int num)
Set the number of points used in the calculation of the integral.
int fNum
Number of points used in the estimation of the integral.
virtual ROOT::Math::IntegratorOneDimOptions Options() const
get the option used for the integration
double * fW
Weights of the points used.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Numerical one dimensional integration options.
void SetIntegrator(const char *name)
set 1D integrator name
void SetNPoints(unsigned int n)
Set number of points for active integration rule.
unsigned int NPoints() const
Number of points used by current integration rule.
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...