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);
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Namespace for new ROOT classes and functions.
void SetWKSize(unsigned int size)
set workspace size
virtual ROOT::Math::IntegratorOneDimOptions Options() const
get the option used for the integration
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)
double RelTolerance() const
absolute tolerance
virtual double DoIntegral(double a, double b, const IGenFunction *func)
Integration surrugate method.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t Int_t m
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.
unsigned int NPoints() const
maximum number of function calls
void SetNumberPoints(int num)
Set the number of points used in the calculation of the integral.
* x
Deprecated and error prone model selection interface.
#define MATH_WARN_MSGVAL(loc, str, x)
Namespace for new Math classes and functions.
you should not use this method at all Int_t Int_t z
virtual void SetAbsTolerance(double)
This method is not implemented.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
void SetIntegrator(const char *name)
set 1D integrator name
void SetRelTolerance(double tol)
set the relative tolerance
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...
void SetAbsTolerance(double tol)
non-static methods for setting options