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);
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.
virtual double DoIntegral(double a, double b, const IGenFunction *func)
Integration surrugate 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 contructor of GaussLegendreIntegrator.
void CalcGaussLegendreSamplingPoints()
Type: unsafe but fast interface filling the arrays x and w (static method)
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.
virtual ROOT::Math::IntegratorOneDimOptions Options() const
get the option used for the integration
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 rule values of 1,2,3,4,5,6 corresponds to 15,21,31,41,51,61 and they are used in...
unsigned int NPoints() const
maximum number of function calls
Namespace for new Math classes and functions.
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...