Logo ROOT   6.08/07
Reference Guide
Integrator.h
Go to the documentation of this file.
1 // @(#)root/mathmore:$Id$
2 // Authors: L. Moneta, M. Slawinska 10/2007
3 
4  /**********************************************************************
5  * *
6  * Copyright (c) 2007 ROOT Foundation, CERN/PH-SFT *
7  * *
8  * *
9  **********************************************************************/
10 
11 // Header file for class Integrator
12 //
13 //
14 #ifndef ROOT_Math_Integrator
15 #define ROOT_Math_Integrator
16 
17 #ifndef ROOT_Math_AllIntegrationTypes
19 #endif
20 
21 #ifndef ROOT_Math_IntegratorOptions
22 #include "Math/IntegratorOptions.h"
23 #endif
24 
25 #ifndef ROOT_Math_IFunction
26 #include "Math/IFunction.h"
27 #endif
28 
29 #ifndef ROOT_Math_VirtualIntegrator
30 #include "Math/VirtualIntegrator.h"
31 #endif
32 
33 
34 #include <memory>
35 
36 
37 /**
38  @defgroup NumAlgo Numerical Algorithms
39  Numerical Algorithm classes from the \ref MathCorePage and \ref MathMorePage libraries.
40  @ingroup MathCore
41  @ingroup MathMore
42  */
43 
44 
45 /**
46 
47 @defgroup Integration Numerical Integration
48 
49 Classes for numerical integration of functions.
50 These classes provide algorithms for integration of one-dimensional functions, with several adaptive and non-adaptive methods
51 and for integration of multi-dimensional function using an adaptive method or MonteCarlo Integration (GSLMCIntegrator).
52 The basic classes ROOT::Math::IntegratorOneDim provides a common interface for the one-dimensional methods while the class
53 ROOT::Math::IntegratorMultiDim provides the interface for the multi-dimensional ones.
54 The methods can be configured (e.g setting the default method with its defult parameters) using the ROOT::Math::IntegratorOneDimOptions and
55 ROOT::Math::IntegratorMultiDimOptions classes.
56 
57 @ingroup NumAlgo
58 
59 */
60 
61 
62 
63 namespace ROOT {
64 namespace Math {
65 
66 
67 
68 
69 //____________________________________________________________________________________________
70 /**
71 
72 User Class for performing numerical integration of a function in one dimension.
73 It uses the plug-in manager to load advanced numerical integration algorithms from GSL, which reimplements the
74 algorithms used in the QUADPACK, a numerical integration package written in Fortran.
75 
76 Various types of adaptive and non-adaptive integration are supported. These include
77 integration over infinite and semi-infinite ranges and singular integrals.
78 
79 The integration type is selected using the Integration::type enumeration
80 in the class constructor.
81 The default type is adaptive integration with singularity
82 (ADAPTIVESINGULAR or QAGS in the QUADPACK convention) applying a Gauss-Kronrod 21-point integration rule.
83 In the case of ADAPTIVE type, the integration rule can also be specified via the
84 Integration::GKRule. The default rule is 31 points.
85 
86 In the case of integration over infinite and semi-infinite ranges, the type used is always
87 ADAPTIVESINGULAR applying a transformation from the original interval into (0,1).
88 
89 The ADAPTIVESINGULAR type is the most sophicticated type. When performances are
90 important, it is then recommened to use the NONADAPTIVE type in case of smooth functions or
91  ADAPTIVE with a lower Gauss-Kronrod rule.
92 
93 For detailed description on GSL integration algorithms see the
94 <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_16.html#SEC248">GSL Manual</A>.
95 
96 
97  @ingroup Integration
98 
99 */
100 
101 
103 
104 public:
105 
106  typedef IntegrationOneDim::Type Type; // for the enumerations defining the types
107 
108  // constructors
109 
110 
111  /**
112  Constructor of one dimensional Integrator, default type is adaptive
113 
114  @param type integration type (adaptive, non-adaptive, etc..)
115  @param absTol desired absolute Error
116  @param relTol desired relative Error
117  @param size maximum number of sub-intervals
118  @param rule Gauss-Kronrod integration rule (only for GSL kADAPTIVE type)
119 
120  Possible type values are : kGAUSS (simple Gauss method), kADAPTIVE (from GSL), kADAPTIVESINGULAR (from GSL), kNONADAPTIVE (from GSL)
121  Possible rule values are kGAUS15 (rule = 1), kGAUS21( rule = 2), kGAUS31(rule =3), kGAUS41 (rule=4), kGAUS51 (rule =5), kGAUS61(rule =6)
122  lower rules are indicated for singular functions while higher for smooth functions to get better accuracies
123 
124  NOTE: When the default values are passed, the values used are taken from the default defined in ROOT::Math::IntegratorOneDimOptions
125  */
126  explicit
127  IntegratorOneDim(IntegrationOneDim::Type type = IntegrationOneDim::kDEFAULT, double absTol = -1, double relTol = -1, unsigned int size = 0, unsigned int rule = 0) :
128  fIntegrator(0), fFunc(0)
129  {
130  fIntegrator = CreateIntegrator(type, absTol, relTol, size, rule);
131  }
132 
133  /**
134  Constructor of one dimensional Integrator passing a function interface
135 
136  @param f integration function (1D interface). It is copied inside
137  @param type integration type (adaptive, non-adaptive, etc..)
138  @param absTol desired absolute tolerance. The algorithm will stop when either the absolute OR the relative tolerance are satisfied.
139  @param relTol desired relative tolerance
140  @param size maximum number of sub-intervals
141  @param rule Gauss-Kronrod integration rule (only for GSL ADAPTIVE type)
142 
143  NOTE: When no values are passed, the values used are taken from the default defined in ROOT::Math::IntegratorOneDimOptions
144  */
145  explicit
146  IntegratorOneDim(const IGenFunction &f, IntegrationOneDim::Type type = IntegrationOneDim::kDEFAULT, double absTol = -1, double relTol = -1, unsigned int size = 0, int rule = 0) :
147  fIntegrator(0), fFunc(0)
148  {
149  fIntegrator = CreateIntegrator(type, absTol, relTol, size, rule);
150  SetFunction(f,true);
151  }
152 
153  /**
154  Template Constructor of one dimensional Integrator passing a generic function object
155 
156  @param f integration function (any C++ callable object implementing operator()(double x)
157  @param type integration type (adaptive, non-adaptive, etc..)
158  @param absTol desired absolute tolerance. The algorithm will stop when either the absolute OR the relative tolerance are satisfied.
159  @param relTol desired relative tolerance
160  @param size maximum number of sub-intervals
161  @param rule Gauss-Kronrod integration rule (only for GSL ADAPTIVE type)
162 
163  NOTE: When no values are passed, the values used are taken from the default defined in ROOT::Math::IntegratorOneDimOptions
164 
165  */
166 
167  template<class Function>
168  explicit
169  IntegratorOneDim(Function & f, IntegrationOneDim::Type type = IntegrationOneDim::kDEFAULT, double absTol = -1, double relTol = -1, unsigned int size = 0, int rule = 0) :
170  fIntegrator(0), fFunc(0)
171  {
172  fIntegrator = CreateIntegrator(type, absTol, relTol, size, rule);
173  SetFunction(f);
174  }
175 
176  /// destructor (will delete contained pointers)
177  virtual ~IntegratorOneDim() {
178  if (fIntegrator) delete fIntegrator;
179  if (fFunc) delete fFunc;
180  }
181 
182  // disable copy constructur and assignment operator
183 
184 private:
186  IntegratorOneDim & operator=(const IntegratorOneDim &) { return *this; }
187 
188 public:
189 
190 
191  // template methods for generic functors
192 
193  /**
194  method to set the a generic integration function
195  @param f integration function. The function type must implement the assigment operator, <em> double operator() ( double x ) </em>
196 
197  */
198 
199 
200  template<class Function>
201  inline void SetFunction(Function & f);
202 
203  /**
204  set one dimensional function for 1D integration
205  */
206  void SetFunction (const IGenFunction &f, bool copy = false) {
207  if (!fIntegrator) return;
208  if (copy) {
209  if (fFunc) delete fFunc;
210  fFunc = f.Clone();
212  return;
213  }
215  }
216 
217 
218  /**
219  Set integration function from a multi-dim function type.
220  Can be used in case of having 1D function implementing the generic interface
221  @param f integration function
222  @param icoord index of coordinate on which the integration is performed
223  @param x array of the passed variables values. In case of dim=1 a 0 can be passed
224  */
225  void SetFunction(const IMultiGenFunction &f, unsigned int icoord , const double * x );
226 
227  // integration methods using a function
228 
229  /**
230  evaluate the Integral of a function f over the defined interval (a,b)
231  @param f integration function. The function type must be a C++ callable object implementing operator()(double x)
232  @param a lower value of the integration interval
233  @param b upper value of the integration interval
234  */
235  template<class Function>
236  double Integral(Function & f, double a, double b);
237 
238 
239  /**
240  evaluate the Integral of a function f over the defined interval (a,b)
241  @param f integration function. The function type must implement the mathlib::IGenFunction interface
242  @param a lower value of the integration interval
243  @param b upper value of the integration interval
244  */
245  double Integral(const IGenFunction & f, double a, double b) {
246  SetFunction(f,false);
247  return Integral(a,b);
248  }
249 
250 
251  /**
252  evaluate the Integral of a function f over the infinite interval (-inf,+inf)
253  @param f integration function. The function type must be a C++ callable object implementing operator()(double x)
254  */
255 // template<class Function>
256 // double Integral(const Function & f);
257 
258  /**
259  evaluate the Integral of a function f over the infinite interval (-inf,+inf)
260  @param f integration function. The function type must implement the mathlib::IGenFunction interface
261  */
262  double Integral(const IGenFunction & f) {
263  SetFunction(f,false);
264  return Integral();
265  }
266 
267 
268  /**
269  evaluate the Integral of a function f over the semi-infinite interval (a,+inf)
270  @param f integration function. The function type must be a C++ callable object implementing operator()(double x)
271  @param a lower value of the integration interval
272  */
273 // template<class Function>
274 // double IntegralUp(Function & f, double a);
275 
276  /**
277  evaluate the Integral of a function f over the semi-infinite interval (a,+inf)
278  @param f integration function. The function type must implement the mathlib::IGenFunction interface
279  @param a lower value of the integration interval
280 
281  */
282  double IntegralUp(const IGenFunction & f, double a ) {
283  SetFunction(f,false);
284  return IntegralUp(a);
285  }
286 
287  /**
288  evaluate the Integral of a function f over the over the semi-infinite interval (-inf,b)
289  @param f integration function. The function type must be a C++ callable object implementing operator()(double x)
290  @param b upper value of the integration interval
291  */
292 // template<class Function>
293 // double IntegralLow(Function & f, double b);
294 
295  /**
296  evaluate the Integral of a function f over the over the semi-infinite interval (-inf,b)
297  @param f integration function. The function type must implement the mathlib::IGenFunction interface
298  @param b upper value of the integration interval
299  */
300  double IntegralLow(const IGenFunction & f, double b ) {
301  SetFunction(f,false);
302  return IntegralLow(b);
303  }
304 
305  /**
306  evaluate the Integral of a function f with known singular points over the defined Integral (a,b)
307  @param f integration function. The function type must be a C++ callable object implementing operator()(double x)
308  @param pts vector containing both the function singular points and the lower/upper edges of the interval. The vector must have as first element the lower edge of the integration Integral ( \a a) and last element the upper value.
309 
310  */
311  template<class Function>
312  double Integral(Function & f, const std::vector<double> & pts );
313 
314  /**
315  evaluate the Integral of a function f with known singular points over the defined Integral (a,b)
316  @param f integration function. The function type must implement the mathlib::IGenFunction interface
317  @param pts vector containing both the function singular points and the lower/upper edges of the interval. The vector must have as first element the lower edge of the integration Integral ( \a a) and last element the upper value.
318 
319  */
320  double Integral(const IGenFunction & f, const std::vector<double> & pts ) {
321  SetFunction(f,false);
322  return Integral(pts);
323  }
324 
325  /**
326  evaluate the Cauchy principal value of the integral of a function f over the defined interval (a,b) with a singularity at c
327  @param f integration function. The function type must be a C++ callable object implementing operator()(double x)
328  @param a lower value of the integration interval
329  @param b upper value of the integration interval
330  @param c position of singularity
331 
332  */
333  template<class Function>
334  double IntegralCauchy(Function & f, double a, double b, double c);
335 
336  /**
337  evaluate the Cauchy principal value of the integral of a function f over the defined interval (a,b) with a singularity at c
338  @param f integration function. The function type must implement the mathlib::IGenFunction interface
339  @param a lower value of the integration interval
340  @param b upper value of the integration interval
341  @param c position of singularity
342 
343  */
344  double IntegralCauchy(const IGenFunction & f, double a, double b, double c) {
345  SetFunction(f,false);
346  return IntegralCauchy(a,b,c);
347  }
348 
349 
350 
351  // integration method using cached function
352 
353  /**
354  evaluate the Integral over the defined interval (a,b) using the function previously set with Integrator::SetFunction method
355  @param a lower value of the integration interval
356  @param b upper value of the integration interval
357  */
358 
359  double Integral(double a, double b) {
360  return fIntegrator == 0 ? 0 : fIntegrator->Integral(a,b);
361  }
362 
363 
364  /**
365  evaluate the Integral over the infinite interval (-inf,+inf) using the function previously set with Integrator::SetFunction method.
366  */
367 
368  double Integral( ) {
369  return fIntegrator == 0 ? 0 : fIntegrator->Integral();
370  }
371 
372  /**
373  evaluate the Integral of a function f over the semi-infinite interval (a,+inf) using the function previously set with Integrator::SetFunction method.
374  @param a lower value of the integration interval
375  */
376  double IntegralUp(double a ) {
377  return fIntegrator == 0 ? 0 : fIntegrator->IntegralUp(a);
378  }
379 
380  /**
381  evaluate the Integral of a function f over the over the semi-infinite interval (-inf,b) using the function previously set with Integrator::SetFunction method.
382  @param b upper value of the integration interval
383  */
384  double IntegralLow( double b ) {
385  return fIntegrator == 0 ? 0 : fIntegrator->IntegralLow(b);
386  }
387  /**
388  define operator() for IntegralLow
389  */
390  double operator() (double x) {
391  return IntegralLow(x);
392  }
393 
394 
395  /**
396  evaluate the Integral over the defined interval (a,b) using the function previously set with Integrator::SetFunction method. The function has known singular points.
397  @param pts vector containing both the function singular points and the lower/upper edges of the interval. The vector must have as first element the lower edge of the integration Integral ( \a a) and last element the upper value.
398 
399  */
400  double Integral( const std::vector<double> & pts) {
401  return fIntegrator == 0 ? 0 : fIntegrator->Integral(pts);
402  }
403 
404  /**
405  evaluate the Cauchy principal value of the integral of a function f over the defined interval (a,b) with a singularity at c
406 
407  */
408  double IntegralCauchy(double a, double b, double c) {
409  return fIntegrator == 0 ? 0 : fIntegrator->IntegralCauchy(a,b,c);
410  }
411 
412  /**
413  return the Result of the last Integral calculation
414  */
415  double Result() const { return fIntegrator == 0 ? 0 : fIntegrator->Result(); }
416 
417  /**
418  return the estimate of the absolute Error of the last Integral calculation
419  */
420  double Error() const { return fIntegrator == 0 ? 0 : fIntegrator->Error(); }
421 
422  /**
423  return the Error Status of the last Integral calculation
424  */
425  int Status() const { return fIntegrator == 0 ? -1 : fIntegrator->Status(); }
426 
427  /**
428  return number of function evaluations in calculating the integral
429  (if integrator do not implement this function returns -1)
430  */
431  int NEval() const { return fIntegrator == 0 ? -1 : fIntegrator->NEval(); }
432 
433 
434  // setter for control Parameters (getters are not needed so far )
435 
436  /**
437  set the desired relative Error
438  */
439  void SetRelTolerance(double relTolerance) { if (fIntegrator) fIntegrator->SetRelTolerance(relTolerance); }
440 
441 
442  /**
443  set the desired absolute Error
444  */
445  void SetAbsTolerance(double absTolerance) { if (fIntegrator) fIntegrator->SetAbsTolerance(absTolerance); }
446 
447  /**
448  return a pointer to integrator object
449  */
451 
452  /**
453  set the options
454  */
456 
457  /**
458  retrieve the options
459  */
461 
462  /// return name of integrator
463  std::string Name() const { return (fIntegrator) ? Options().Integrator() : std::string(""); }
464 
465  /// static function to get the enumeration from a string
466  static IntegrationOneDim::Type GetType(const char * name);
467 
468  /// static function to get a string from the enumeration
469  static std::string GetName(IntegrationOneDim::Type);
470 
471 
472 protected:
473 
474  VirtualIntegratorOneDim * CreateIntegrator(IntegrationOneDim::Type type , double absTol, double relTol, unsigned int size, int rule);
475 
476 private:
477 
478  VirtualIntegratorOneDim * fIntegrator; // pointer to integrator interface class
479  IGenFunction * fFunc; // pointer to owned function
480 
481 };
482 
483 
485 
486 
487 } // namespace Math
488 } // namespace ROOT
489 
490 
491 #ifndef __CINT__
492 
493 
494 #ifndef ROOT_Math_WrappedFunction
495 #include "Math/WrappedFunction.h"
496 #endif
497 
498 template<class Function>
501  // need to copy the wrapper function, the instance created here will be deleted after SetFunction()
502  SetFunction(wf, true);
503 }
504 
505 template<class Function>
506 double ROOT::Math::IntegratorOneDim::Integral(Function & f, double a, double b) {
508  SetFunction(wf,false); // no copy is needed in this case
509  return Integral(a,b);
510 }
511 
512 // remove because can create ambiguities
513 
514 // template<class Function>
515 // double ROOT::Math::IntegratorOneDim::Integral(const Function & f) {
516 // ROOT::Math::WrappedFunction<const Function &> wf(f);
517 // SetFunction(wf,false); // no copy is needed in this case
518 // return Integral();
519 // }
520 
521 // template<class Function>
522 // double ROOT::Math::IntegratorOneDim::IntegralLow(Function & f, double x) {
523 // ROOT::Math::WrappedFunction< Function &> wf(f);
524 // SetFunction(wf,false); // no copy is needed in this case
525 // return IntegralLow(x);
526 // }
527 
528 // template<class Function>
529 // double ROOT::Math::IntegratorOneDim::IntegralUp(Function & f, double x) {
530 // ROOT::Math::WrappedFunction<Function &> wf(f);
531 // SetFunction(wf,false); // no copy is needed in this case
532 // return IntegralUp(x);
533 // }
534 
535 template<class Function>
536 double ROOT::Math::IntegratorOneDim::Integral(Function & f, const std::vector<double> & pts) {
538  SetFunction(wf,false); // no copy is needed in this case
539  return Integral(pts);
540 }
541 
542 template<class Function>
543 double ROOT::Math::IntegratorOneDim::IntegralCauchy(Function & f, double a, double b, double c) {
545  SetFunction(wf,false); // no copy is needed in this case
546  return IntegralCauchy(a,b,c);
547 }
548 
549 
550 #endif
551 
552 
553 
554 #endif /* ROOT_Math_Integrator */
IntegratorOneDim & operator=(const IntegratorOneDim &)
Definition: Integrator.h:186
virtual void SetRelTolerance(double)=0
set the desired relative Error
Interface (abstract) class for 1D numerical integration It must be implemented by the concrate Integr...
void SetRelTolerance(double relTolerance)
set the desired relative Error
Definition: Integrator.h:439
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition: IFunction.h:133
const double absTol
double Integral()
evaluate the Integral over the infinite interval (-inf,+inf) using the function previously set with I...
Definition: Integrator.h:368
void SetFunction(const IGenFunction &f, bool copy=false)
set one dimensional function for 1D integration
Definition: Integrator.h:206
double operator()(double x)
define operator() for IntegralLow
Definition: Integrator.h:390
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
int Status() const
return the Error Status of the last Integral calculation
Definition: Integrator.h:425
return c
virtual double Result() const =0
return the Result of the last Integral calculation
TArc * a
Definition: textangle.C:12
virtual void SetFunction(const IGenFunction &)=0
set integration function
IntegratorOneDim(const IGenFunction &f, IntegrationOneDim::Type type=IntegrationOneDim::kDEFAULT, double absTol=-1, double relTol=-1, unsigned int size=0, int rule=0)
Constructor of one dimensional Integrator passing a function interface.
Definition: Integrator.h:146
double Integral(const std::vector< double > &pts)
evaluate the Integral over the defined interval (a,b) using the function previously set with Integrat...
Definition: Integrator.h:400
virtual ROOT::Math::IntegratorOneDimOptions Options() const =0
get the option used for the integration must be implemented by derived class
virtual double Error() const =0
return the estimate of the absolute Error of the last Integral calculation
void SetAbsTolerance(double absTolerance)
set the desired absolute Error
Definition: Integrator.h:445
IntegratorOneDim(Function &f, IntegrationOneDim::Type type=IntegrationOneDim::kDEFAULT, double absTol=-1, double relTol=-1, unsigned int size=0, int rule=0)
Template Constructor of one dimensional Integrator passing a generic function object.
Definition: Integrator.h:169
Template class to wrap any C++ callable object which takes one argument i.e.
virtual double IntegralLow(double b)=0
evaluate integral over the (-inf, b)
double IntegralUp(double a)
evaluate the Integral of a function f over the semi-infinite interval (a,+inf) using the function pre...
Definition: Integrator.h:376
Double_t x[n]
Definition: legend1.C:17
IntegratorOneDim(const IntegratorOneDim &)
Definition: Integrator.h:185
double Integral(const IGenFunction &f, double a, double b)
evaluate the Integral of a function f over the defined interval (a,b)
Definition: Integrator.h:245
virtual void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options (should be re-implemented by derived classes -if more options than tolerance exist ...
virtual double IntegralCauchy(double a, double b, double c)=0
evaluate Cauchy integral
double Error() const
return the estimate of the absolute Error of the last Integral calculation
Definition: Integrator.h:420
virtual double Integral(double a, double b)=0
evaluate integral
double IntegralLow(double b)
evaluate the Integral of a function f over the over the semi-infinite interval (-inf,b) using the function previously set with Integrator::SetFunction method.
Definition: Integrator.h:384
double IntegralLow(const IGenFunction &f, double b)
evaluate the Integral of a function f over the over the semi-infinite interval (-inf,b)
Definition: Integrator.h:300
double IntegralUp(const IGenFunction &f, double a)
evaluate the Integral of a function f over the semi-infinite interval (a,+inf)
Definition: Integrator.h:282
IntegrationOneDim::Type Type
Definition: Integrator.h:106
double IntegralCauchy(double a, double b, double c)
evaluate the Cauchy principal value of the integral of a function f over the defined interval (a...
Definition: Integrator.h:408
double IntegralCauchy(Function &f, double a, double b, double c)
evaluate the Cauchy principal value of the integral of a function f over the defined interval (a...
Definition: Integrator.h:543
Numerical one dimensional integration options.
static IntegrationOneDim::Type GetType(const char *name)
static function to get the enumeration from a string
Definition: Integrator.cxx:54
User Class for performing numerical integration of a function in one dimension.
Definition: Integrator.h:102
VirtualIntegratorOneDim * GetIntegrator()
return a pointer to integrator object
Definition: Integrator.h:450
VirtualIntegratorOneDim * fIntegrator
Definition: Integrator.h:478
double Integral(const IGenFunction &f, const std::vector< double > &pts)
evaluate the Integral of a function f with known singular points over the defined Integral (a...
Definition: Integrator.h:320
double Integral(const IGenFunction &f)
evaluate the Integral of a function f over the infinite interval (-inf,+inf)
Definition: Integrator.h:262
virtual int Status() const =0
return the Error Status of the last Integral calculation
void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options
Definition: Integrator.h:455
Type
enumeration specifying the integration types.
virtual int NEval() const
return number of function evaluations in calculating the integral (if integrator do not implement thi...
ROOT::Math::IntegratorOneDimOptions Options() const
retrieve the options
Definition: Integrator.h:460
double f(double x)
std::string Name() const
return name of integrator
Definition: Integrator.h:463
virtual ~IntegratorOneDim()
destructor (will delete contained pointers)
Definition: Integrator.h:177
int type
Definition: TGX11.cxx:120
static std::string GetName(IntegrationOneDim::Type)
static function to get a string from the enumeration
Definition: Integrator.cxx:67
std::string Integrator() const
name of 1D integrator
Namespace for new Math classes and functions.
virtual double IntegralUp(double a)=0
evaluate integral over the (a, +inf)
double Integral(double a, double b)
evaluate the Integral over the defined interval (a,b) using the function previously set with Integrat...
Definition: Integrator.h:359
virtual void SetAbsTolerance(double)=0
set the desired absolute Error
void SetFunction(Function &f)
method to set the a generic integration function
Definition: Integrator.h:499
int NEval() const
return number of function evaluations in calculating the integral (if integrator do not implement thi...
Definition: Integrator.h:431
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
Definition: TRolke.cxx:630
IntegratorOneDim Integrator
Definition: Integrator.h:484
virtual IBaseFunctionOneDim * Clone() const =0
Clone a function.
double IntegralCauchy(const IGenFunction &f, double a, double b, double c)
evaluate the Cauchy principal value of the integral of a function f over the defined interval (a...
Definition: Integrator.h:344
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:63
double Result() const
return the Result of the last Integral calculation
Definition: Integrator.h:415
VirtualIntegratorOneDim * CreateIntegrator(IntegrationOneDim::Type type, double absTol, double relTol, unsigned int size, int rule)
Definition: Integrator.cxx:115
char name[80]
Definition: TGX11.cxx:109
IntegratorOneDim(IntegrationOneDim::Type type=IntegrationOneDim::kDEFAULT, double absTol=-1, double relTol=-1, unsigned int size=0, unsigned int rule=0)
Constructor of one dimensional Integrator, default type is adaptive.
Definition: Integrator.h:127