65 const double a0 = (b +
a)/2;
66 const double b0 = (b -
a)/2;
71 for (
int i=0; i<
fNum; i++)
73 xx[0] = a0 + b0*
fX[i];
74 result +=
fW[i] * (*function)(xx);
90 {
MATH_WARN_MSG(
"ROOT::Math::GaussLegendreIntegrator",
"There is no Absolute Tolerance!"); }
112 const unsigned int m = (
fNum+1)/2;
117 for (
unsigned int i=0; i<
m; i++) {
118 z =
std::cos(3.14159265358979323846*(i+0.75)/(
fNum+0.5));
128 for (
int j=0; j<
fNum; j++)
132 p1 = ((2.0*j+1.0)*z*p2-j*
p3)/(j+1.0);
137 pp = fNum*(z*p1-
p2)/(z*z-1.0);
148 fW[i] = 2.0/((1.0-z*z)*pp*pp);
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...
static double p3(double t, double a, double b, double c, double d)
Namespace for new ROOT classes and functions.
void SetWKSize(unsigned int size)
set workspace size
GaussLegendreIntegrator(int num=10, double eps=1e-12)
Basic contructor of GaussLegendreIntegrator.
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...
void CalcGaussLegendreSamplingPoints()
Type: unsafe but fast interface filling the arrays x and w (static method)
#define MATH_WARN_MSG(loc, str)
virtual double DoIntegral(double a, double b, const IGenFunction *func)
Integration surrugate method.
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...
static double p2(double t, double a, double b, double c)
virtual void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options (should be re-implemented by derived classes -if more options than tolerance exist ...
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
virtual ~GaussLegendreIntegrator()
Default Destructor.
virtual void SetRelTolerance(double)
Set the desired relative Error.
Numerical one dimensional integration options.
User class for performing function integration.
static double p1(double t, double a, double b)
void SetNumberPoints(int num)
Set the number of points used in the calculation of the integral.
double RelTolerance() const
absolute tolerance
#define MATH_WARN_MSGVAL(loc, str, x)
Namespace for new Math classes and functions.
virtual void SetAbsTolerance(double)
This method is not implemented.
unsigned int NPoints() const
maximum number of function calls
void SetIntegrator(const char *name)
set 1D integrator name
void SetRelTolerance(double tol)
set the relative tolerance
void SetAbsTolerance(double tol)
non-static methods for setting options