64 if (
fNum<=0 ||
fX ==
nullptr ||
fW ==
nullptr)
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];
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)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
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.
void SetAbsTolerance(double) override
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 quadratur...
ROOT::Math::IntegratorOneDimOptions Options() const override
get the option used for the integration
GaussLegendreIntegrator(int num=10, double eps=1e-12)
Basic constructor of GaussLegendreIntegrator.
void SetRelTolerance(double) override
Set the desired relative Error.
~GaussLegendreIntegrator() override
Default Destructor.
void CalcGaussLegendreSamplingPoints()
Type: unsafe but fast interface filling the arrays x and w (static method)
double * fX
Abscisa of the points used.
void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt) override
set the options (should be re-implemented by derived classes -if more options than tolerance exist
void SetNumberPoints(int num)
Set the number of points used in the calculation of the integral.
double DoIntegral(double a, double b, const IGenFunction *func) override
Integration surrogate method.
int fNum
Number of points used in the estimation of the integral.
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.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.