36 MATH_WARN_MSG(
"ROOT::Math::GausIntegrator",
"Invalid tolerance given, use values of 1.E-9");
79 MATH_INFO_MSG(
"ROOT::Math::GausIntegratorOneDim",
"Invalid tolerance given - use default values");
85 const double kHF = 0.5;
86 const double kCST = 5./1000;
88 double x[12] = { 0.96028985649753623, 0.79666647741362674,
89 0.52553240991632899, 0.18343464249564980,
90 0.98940093499164993, 0.94457502307323258,
91 0.86563120238783174, 0.75540440835500303,
92 0.61787624440264375, 0.45801677765722739,
93 0.28160355077925891, 0.09501250983763744};
95 double w[12] = { 0.10122853629037626, 0.22238103445337447,
96 0.31370664587788729, 0.36268378337836198,
97 0.02715245941175409, 0.06225352393864789,
98 0.09515851168249278, 0.12462897125553387,
99 0.14959598881657673, 0.16915651939500254,
100 0.18260341504492359, 0.18945061045506850};
102 double h, aconst, bb, aa,
c1,
c2, u, s8, s16,
f1, f2;
108 MATH_ERROR_MSG(
"ROOT::Math::GausIntegratorOneDim",
"A function must be set first!");
114 if (b == a)
return h;
115 aconst = kCST/std::abs(b-a);
127 f1 = (*function)(xx);
130 f2 = (*function) (xx);
132 s8 += w[i]*(f1 + f2);
138 f1 = (*function) (xx);
141 f2 = (*function) (xx);
143 s16 += w[i]*(f1 + f2);
147 double error = std::abs(s16-c2*s8);
150 if(bb != b)
goto CASE1;
153 if(1. + aconst*std::abs(c2) != 1)
goto CASE2;
155 MATH_WARN_MSGVAL(
"ROOT::Math::GausIntegrator",
"Failed to reach the desired tolerance ",maxtol);
171 MATH_ERROR_MSG(
"ROOT::Math::GaussIntegrator",
"You must calculate the result at least once!");
193 MATH_WARN_MSG(
"ROOT::Math::GaussIntegrator",
"This method is not implemented in this class !");
200 MATH_WARN_MSG(
"ROOT::Math::GaussIntegrator",
"This method is not implemented in this class !");
226 : fSign(
kPlus), fIntegrand(integrand), fBoundary(0.), fInfiniteInterval(true) {
239 double mappedX = 1. / x - 1.;
virtual void SetAbsTolerance(double eps)
This method is not implemented.
double IntegralUp(double a)
Returns Integral of function on an upper semi-infinite interval.
double Error() const
Return the estimate of the absolute Error of the last Integral calculation.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Namespace for new ROOT classes and functions.
double Integral()
Returns Integral of function on an infinite interval.
void SetWKSize(unsigned int size)
set workspace size
GaussIntegrator(double absTol=-1, double relTol=-1)
Default Constructor.
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...
virtual double DoIntegral(double a, double b, const IGenFunction *func)
Integration surrogate method.
#define MATH_WARN_MSG(loc, str)
double RelTolerance() const
absolute tolerance
double IntegralLow(double b)
Returns Integral of function on a lower semi-infinite interval.
virtual void SetRelTolerance(double eps)
Set the desired relative Error.
double IntegralCauchy(double a, double b, double c)
This method is not implemented.
static double DefaultRelTolerance()
double pow(double, double)
#define MATH_ERROR_MSG(loc, str)
int Status() const
return the status of the last integration - 0 in case of success
void AbsValue(bool flag)
Static function: set the fgAbsValue flag.
#define MATH_INFO_MSG(loc, str)
double AbsTolerance() const
non-static methods for retrivieng options
virtual ~GaussIntegrator()
Destructor.
Numerical one dimensional integration options.
virtual void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options (should be re-implemented by derived classes -if more options than tolerance exist ...
double Result() const
Returns the result of the last Integral calculation.
void SetFunction(const IGenFunction &)
Set integration function (flag control if function must be copied inside).
static double DefaultAbsTolerance()
virtual ROOT::Math::IntegratorOneDimOptions Options() const
get the option used for the integration
#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 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
const IGenFunction * fFunction
void SetAbsTolerance(double tol)
non-static methods for setting options