35 MATH_WARN_MSG(
"ROOT::Math::GausIntegrator",
"Invalid tolerance given, use values of 1.E-9");
78 MATH_INFO_MSG(
"ROOT::Math::GausIntegratorOneDim",
"Invalid tolerance given - use default values");
84 const double kHF = 0.5;
85 const double kCST = 5./1000;
87 double x[12] = { 0.96028985649753623, 0.79666647741362674,
88 0.52553240991632899, 0.18343464249564980,
89 0.98940093499164993, 0.94457502307323258,
90 0.86563120238783174, 0.75540440835500303,
91 0.61787624440264375, 0.45801677765722739,
92 0.28160355077925891, 0.09501250983763744};
94 double w[12] = { 0.10122853629037626, 0.22238103445337447,
95 0.31370664587788729, 0.36268378337836198,
96 0.02715245941175409, 0.06225352393864789,
97 0.09515851168249278, 0.12462897125553387,
98 0.14959598881657673, 0.16915651939500254,
99 0.18260341504492359, 0.18945061045506850};
101 double h, aconst, bb, aa,
c1,
c2, u, s8, s16,
f1,
f2;
107 MATH_ERROR_MSG(
"ROOT::Math::GausIntegratorOneDim",
"A function must be set first!");
113 if (b == a)
return h;
114 aconst = kCST/std::abs(b-a);
126 f1 = (*function)(xx);
129 f2 = (*function) (xx);
131 s8 += w[i]*(f1 +
f2);
137 f1 = (*function) (xx);
140 f2 = (*function) (xx);
142 s16 += w[i]*(f1 +
f2);
146 double error = std::abs(s16-c2*s8);
149 if(bb != b)
goto CASE1;
152 if(1. + aconst*std::abs(c2) != 1)
goto CASE2;
154 MATH_WARN_MSGVAL(
"ROOT::Math::GausIntegrator",
"Failed to reach the desired tolerance ",maxtol);
170 MATH_ERROR_MSG(
"ROOT::Math::GaussIntegrator",
"You must calculate the result at least once!");
192 MATH_WARN_MSG(
"ROOT::Math::GaussIntegrator",
"This method is not implemented in this class !");
199 MATH_WARN_MSG(
"ROOT::Math::GaussIntegrator",
"This method is not implemented in this class !");
225 : fSign(
kPlus), fIntegrand(integrand), fBoundary(0.), fInfiniteInterval(true) {
238 double mappedX = 1. / x - 1.;
double Error() const
Return the estimate of the absolute Error of the last Integral calculation.
virtual void SetAbsTolerance(double eps)
This method is not implemented.
double IntegralUp(double a)
Returns Integral of function on an upper semi-infinite interval.
#define MATH_WARN_MSGVAL(loc, str, x)
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
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.
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_INFO_MSG(loc, str)
void AbsValue(bool flag)
Static function: set the fgAbsValue flag.
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 ...
#define MATH_WARN_MSG(loc, str)
void SetFunction(const IGenFunction &)
Set integration function (flag control if function must be copied inside).
static double DefaultAbsTolerance()
double RelTolerance() const
absolute tolerance
Namespace for new Math classes and functions.
virtual ROOT::Math::IntegratorOneDimOptions Options() const
get the option used for the integration
double f2(const double *x)
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
double AbsTolerance() const
non-static methods for retrivieng options
int Status() const
return the status of the last integration - 0 in case of success
double Result() const
Returns the result of the last Integral calculation.
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
#define MATH_ERROR_MSG(loc, str)