Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
22
23
24#include <vector>
25
26
27namespace ROOT {
28namespace 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 @ingroup Integration
46
47*/
49
50public:
51
52 /// destructor: no operation
53 virtual ~VirtualIntegrator() {}
54
55 /**
56 set the desired relative Error
57 */
58 virtual void SetRelTolerance(double ) = 0;
59
60 /**
61 set the desired absolute Error
62 */
63 virtual void SetAbsTolerance(double ) = 0;
64
65 /**
66 return the Result of the last Integral calculation
67 */
68 virtual double Result() const = 0;
69
70 /**
71 return the estimate of the absolute Error of the last Integral calculation
72 */
73 virtual double Error() const = 0;
74
75 /**
76 return the Error Status of the last Integral calculation
77 */
78 virtual int Status() const = 0;
79
80 /**
81 return number of function evaluations in calculating the integral
82 (if integrator do not implement this function returns -1)
83 */
84 virtual int NEval() const { return -1; }
85
86};
87
88
89//___________________________________________________________________
90/**
91 Interface (abstract) class for 1D numerical integration
92 It must be implemented by the concrete Integrator classes like
93 ROOT::Math::GSLIntegrator.
94 Plug-in's exist in ROOT to be able to instantiate the derived classes via the
95 plug-in manager.
96 Users should not use directly this class but the concrete classes ROOT::Math::IntegratorOneDim.
97
98 @ingroup Integration
99
100*/
102
103public:
104
105 /// destructor: no operation
107
108 /// evaluate integral
109 virtual double Integral(double a, double b) = 0;
110
111 /// set integration function
112 virtual void SetFunction(const IGenFunction &) = 0;
113
114 /// evaluate un-defined integral (between -inf, + inf)
115 virtual double Integral() = 0;
116
117 /// evaluate integral over the (a, +inf)
118 virtual double IntegralUp(double a) = 0;
119
120 /// evaluate integral over the (-inf, b)
121 virtual double IntegralLow(double b) = 0;
122
123 /// evaluate integral with singular points
124 virtual double Integral( const std::vector<double> & pts) = 0;
125
126 /// evaluate Cauchy integral
127 virtual double IntegralCauchy(double a, double b, double c) = 0;
128
129 /// get the option used for the integration
130 /// must be implemented by derived class
132
133 /// return type of integrator
135 return Options().IntegratorType();
136 }
137
138 /// set the options
139 /// (should be re-implemented by derived classes -if more options than tolerance exist
143 }
144
145};
146
147
148//___________________________________________________________________
149/**
150 Interface (abstract) class for multi numerical integration
151 It must be implemented by the concrete Integrator classes like
152 ROOT::Math::GSLMCIntegrator.
153 Plug-in's exist in ROOT to be able to instantiate the derived classes via the
154 plug-in manager.
155 Users should not use directly this class but the concrete classes ROOT::Math::IntegratorMultiDim.
156
157 @ingroup Integration
158
159*/
161
162public:
163
164 /// destructor: no operation
166
167 /// evaluate multi-dim integral
168 virtual double Integral(const double*, const double*) = 0;
169
170 /// setting a multi-dim function
171 virtual void SetFunction(const IMultiGenFunction &) = 0;
172
173 /// get the option used for the integration
174 /// implement by derived class otherwise return default ones
176
177 /// return type of integrator
179 return Options().IntegratorType();
180 }
181
182 /// set the options (if needed must be re-implemented by derived classes)
186 }
187
188};
189
190
191}//namespace Math
192}//namespace ROOT
193
194
195#endif /* ROOT_Math_VirtualIntegrator */
#define b(i)
Definition RSha256.hxx:100
#define c(i)
Definition RSha256.hxx:101
#define a(i)
Definition RSha256.hxx:99
double RelTolerance() const
absolute tolerance
double AbsTolerance() const
non-static methods for retrieving options
Documentation for the abstract class IBaseFunctionMultiDim.
Definition IFunction.h:61
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
Definition IFunction.h:112
Numerical multi dimensional integration options.
IntegrationMultiDim::Type IntegratorType() const
type of the integrator (return the enumeration type)
Numerical one dimensional integration options.
IntegrationOneDim::Type IntegratorType() const
type of the integrator (return the enumeration type)
Interface (abstract) class for multi numerical integration It must be implemented by the concrete Int...
virtual ROOT::Math::IntegrationMultiDim::Type Type() const
return type of integrator
virtual void SetOptions(const ROOT::Math::IntegratorMultiDimOptions &opt)
set the options (if needed must be re-implemented by derived classes)
virtual double Integral(const double *, const double *)=0
evaluate multi-dim integral
virtual ROOT::Math::IntegratorMultiDimOptions Options() const =0
get the option used for the integration implement by derived class otherwise return default ones
~VirtualIntegratorMultiDim() override
destructor: no operation
virtual void SetFunction(const IMultiGenFunction &)=0
setting a multi-dim function
Interface (abstract) class for 1D numerical integration It must be implemented by the concrete Integr...
~VirtualIntegratorOneDim() override
destructor: no operation
virtual double Integral()=0
evaluate un-defined integral (between -inf, + inf)
virtual ROOT::Math::IntegratorOneDimOptions Options() const =0
get the option used for the integration must be implemented by derived class
virtual ROOT::Math::IntegrationOneDim::Type Type() const
return type of integrator
virtual void SetFunction(const IGenFunction &)=0
set integration function
virtual double IntegralCauchy(double a, double b, double c)=0
evaluate Cauchy integral
virtual double IntegralLow(double b)=0
evaluate integral over the (-inf, b)
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 Integral(double a, double b)=0
evaluate integral
virtual double IntegralUp(double a)=0
evaluate integral over the (a, +inf)
virtual double Integral(const std::vector< double > &pts)=0
evaluate integral with singular points
Abstract class for all numerical integration methods (1D and multi-dim) Interface defining the common...
virtual void SetRelTolerance(double)=0
set the desired relative Error
virtual void SetAbsTolerance(double)=0
set the desired absolute Error
virtual double Error() const =0
return the estimate of the absolute Error of the last Integral calculation
virtual int NEval() const
return number of function evaluations in calculating the integral (if integrator do not implement thi...
virtual double Result() const =0
return the Result of the last Integral calculation
virtual ~VirtualIntegrator()
destructor: no operation
virtual int Status() const =0
return the Error Status of the last Integral calculation
Type
enumeration specifying the integration types.
Type
enumeration specifying the integration types.
Namespace for new Math classes and functions.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...