Logo ROOT   6.10/09
Reference Guide
VirtualIntegrator.h
Go to the documentation of this file.
1 // @(#)root/mathcore:$Id$
2 // Author: Magdalena Slawinska 10/2007
3 
4 
5 /**********************************************************************
6  * *
7  * Copyright (c) 2007 LCG ROOT Math Team, CERN/PH-SFT *
8  * *
9  * *
10  **********************************************************************/
11 
12 // Header file for class Minimizer
13 
14 #ifndef ROOT_Math_VirtualIntegrator
15 #define ROOT_Math_VirtualIntegrator
16 
17 #include "Math/IFunctionfwd.h"
18 
19 #include "Math/Error.h"
20 
21 #include "Math/IntegratorOptions.h"
22 
23 
24 #include <vector>
25 
26 
27 namespace ROOT {
28 namespace Math {
29 
30 //___________________________________________________________________
31 /**
32  Abstract class for all numerical integration methods (1D and multi-dim)
33  Interface defining the common methods for the
34  numerical integrator classes of one and multi dimensions
35  The derived class VirtualIntegratorOneDim defines the methods
36  for one-dimensional integration.
37  The derived class VirtualIntegratorMultiDim defines the method for
38  multi-dimensional integration.
39  The concrete classes for one dimension (e.g. GSLIntegrator) or
40  multi-dimension (e.g. GSLMCIntegrator) can be created using the
41  plug-in manager.
42  Users should not use directly this class but the concrete classes ROOT::Math::IntegratorOneDim or
43  ROOT::Math::IntegratorMultiDim
44 
45 
46  @ingroup Integration
47 
48 */
50 
51 public:
52 
53  // destructor: no operation
54  virtual ~VirtualIntegrator() {}
55 
56  /**
57  set the desired relative Error
58  */
59  virtual void SetRelTolerance(double ) = 0;
60 
61  /**
62  set the desired absolute Error
63  */
64  virtual void SetAbsTolerance(double ) = 0;
65 
66  /**
67  return the Result of the last Integral calculation
68  */
69  virtual double Result() const = 0;
70 
71  /**
72  return the estimate of the absolute Error of the last Integral calculation
73  */
74  virtual double Error() const = 0;
75 
76  /**
77  return the Error Status of the last Integral calculation
78  */
79  virtual int Status() const = 0;
80 
81  /**
82  return number of function evaluations in calculating the integral
83  (if integrator do not implement this function returns -1)
84  */
85  virtual int NEval() const { return -1; }
86 
87 
88 
89 
90 };
91 
92 //___________________________________________________________________
93 /**
94  Interface (abstract) class for 1D numerical integration
95  It must be implemented by the concrate Integrator classes like
96  ROOT::Math::GSLIntegrator.
97  Plug-in's exist in ROOT to be able to instantiate the derived classes via the
98  plug-in manager.
99  Users should not use directly this class but the concrete classes ROOT::Math::IntegratorOneDim.
100 
101 
102  @ingroup Integration
103 
104 */
106 
107 public:
108 
109  /// destructor: no operation
111 
112  /// evaluate integral
113  virtual double Integral(double a, double b) = 0;
114 
115  /// set integration function
116  virtual void SetFunction(const IGenFunction &) = 0;
117 
118  /// evaluate un-defined integral (between -inf, + inf)
119  virtual double Integral() = 0;
120 
121  /// evaluate integral over the (a, +inf)
122  virtual double IntegralUp(double a) = 0;
123 
124  /// evaluate integral over the (-inf, b)
125  virtual double IntegralLow(double b) = 0;
126 
127  /// evaluate integral with singular points
128  virtual double Integral( const std::vector<double> & pts) = 0;
129 
130  /// evaluate Cauchy integral
131  virtual double IntegralCauchy(double a, double b, double c) = 0;
132 
133  /// get the option used for the integration
134  /// must be implemented by derived class
135  virtual ROOT::Math::IntegratorOneDimOptions Options() const = 0;
136 
137  // return type of integrator
139  return Options().IntegratorType();
140  }
141 
142  /// set the options
143  /// (should be re-implemented by derived classes -if more options than tolerance exist
147  }
148 
149 
150 
151 };
152 
153 //___________________________________________________________________
154 /**
155  Interface (abstract) class for multi numerical integration
156  It must be implemented by the concrete Integrator classes like
157  ROOT::Math::GSLMCIntegrator.
158  Plug-in's exist in ROOT to be able to instantiate the derived classes via the
159  plug-in manager.
160  Users should not use directly this class but the concrete classes ROOT::Math::IntegratorMultiDim.
161 
162 
163  @ingroup Integration
164 
165 */
167 
168 public:
169 
170  /// destructor: no operation
172 
173  /// evaluate multi-dim integral
174  virtual double Integral(const double*, const double*) = 0;
175 
176  /// setting a multi-dim function
177  virtual void SetFunction(const IMultiGenFunction &) = 0;
178 
179  /// get the option used for the integration
180  /// impelement by derived class otherwise return default ones
181  virtual ROOT::Math::IntegratorMultiDimOptions Options() const = 0;
182 
183  // return type of integrator
185  return Options().IntegratorType();
186  }
187 
188  /// set the options (if needed must be re-implemented by derived classes)
192  }
193 
194 
195 };
196 
197 
198 }//namespace Math
199 }//namespace ROOT
200 
201 
202 #endif /* ROOT_Math_VirtualIntegrator */
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...
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition: IFunction.h:134
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Type
enumeration specifying the integration types.
virtual double Result() const =0
return the Result of the last Integral calculation
virtual ~VirtualIntegratorOneDim()
destructor: no operation
TArc * a
Definition: textangle.C:12
double RelTolerance() const
absolute tolerance
virtual ~VirtualIntegratorMultiDim()
destructor: no operation
virtual double Error() const =0
return the estimate of the absolute Error of the last Integral calculation
Abstract class for all numerical integration methods (1D and multi-dim) Interface defining the common...
virtual void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options (should be re-implemented by derived classes -if more options than tolerance exist ...
Documentation for the abstract class IBaseFunctionMultiDim.
Definition: IFunction.h:62
Numerical multi dimensional integration options.
Interface (abstract) class for multi numerical integration It must be implemented by the concrete Int...
double AbsTolerance() const
non-static methods for retrivieng options
Numerical one dimensional integration options.
virtual int Status() const =0
return the Error Status of the last Integral calculation
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...
virtual ROOT::Math::IntegrationMultiDim::Type Type() const
virtual void SetOptions(const ROOT::Math::IntegratorMultiDimOptions &opt)
set the options (if needed must be re-implemented by derived classes)
Namespace for new Math classes and functions.
virtual ROOT::Math::IntegrationOneDim::Type Type() const
virtual void SetAbsTolerance(double)=0
set the desired absolute Error
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