14#ifndef ROOT_Math_Integrator
15#define ROOT_Math_Integrator
163 template<
class Function>
196 template<
class Function>
231 template<
class Function>
307 template<
class Function>
329 template<
class Function>
396 double Integral(
const std::vector<double> & pts) {
492template<
class Function>
499template<
class Function>
502 SetFunction(wf,
false);
503 return Integral(
a,
b);
529template<
class Function>
532 SetFunction(wf,
false);
533 return Integral(pts);
536template<
class Function>
539 SetFunction(wf,
false);
540 return IntegralCauchy(
a,
b,
c);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Double_t(* Function)(Double_t)
Documentation for the abstract class IBaseFunctionMultiDim.
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
virtual IBaseFunctionOneDim * Clone() const =0
Clone a function.
Numerical one dimensional integration options.
std::string Integrator() const override
name of 1D integrator
User Class for performing numerical integration of a function in one dimension.
void SetAbsTolerance(double absTolerance)
set the desired absolute Error
static std::string GetName(IntegrationOneDim::Type)
static function to get a string from the enumeration
void SetFunction(const IGenFunction &f, bool copy=false)
set one dimensional function for 1D integration
double Integral(const IGenFunction &f)
evaluate the Integral of a function f over the infinite interval (-inf,+inf)
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.
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,...
double operator()(double x)
define operator() for IntegralLow
void SetRelTolerance(double relTolerance)
set the desired relative Error
VirtualIntegratorOneDim * fIntegrator
pointer to integrator interface class
std::string Name() const
return name of integrator
VirtualIntegratorOneDim * GetIntegrator()
return a pointer to integrator object
IntegratorOneDim & operator=(const IntegratorOneDim &)
double IntegralLow(double b)
evaluate the Integral of a function f over the over the semi-infinite interval (-inf,...
double IntegralUp(double a)
evaluate the Integral of a function f over the semi-infinite interval (a,+inf) using the function pre...
int Status() const
return the Error Status of the last Integral calculation
double Result() const
return the Result of the last Integral calculation
virtual ~IntegratorOneDim()
destructor (will delete contained pointers)
VirtualIntegratorOneDim * CreateIntegrator(IntegrationOneDim::Type type, double absTol, double relTol, unsigned int size, int rule)
void SetOptions(const ROOT::Math::IntegratorOneDimOptions &opt)
set the options
IGenFunction * fFunc
pointer to owned function
ROOT::Math::IntegratorOneDimOptions Options() const
retrieve the options
double IntegralUp(const IGenFunction &f, double a)
evaluate the Integral of a function f over the semi-infinite interval (a,+inf)
void SetFunction(Function &f)
method to set the a generic integration function
double Integral(const IGenFunction &f, double a, double b)
evaluate the Integral of a function f over the defined interval (a,b)
int NEval() const
return number of function evaluations in calculating the integral (if integrator do not implement thi...
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,...
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,...
IntegrationOneDim::Type Type
double Error() const
return the estimate of the absolute Error of the last Integral calculation
double Integral(double a, double b)
evaluate the Integral over the defined interval (a,b) using the function previously set with Integrat...
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.
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.
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,...
IntegratorOneDim(const IntegratorOneDim &)
double Integral(const std::vector< double > &pts)
evaluate the Integral over the defined interval (a,b) using the function previously set with Integrat...
double IntegralLow(const IGenFunction &f, double b)
evaluate the Integral of a function f over the over the semi-infinite interval (-inf,...
double Integral()
evaluate the Integral over the infinite interval (-inf,+inf) using the function previously set with I...
static IntegrationOneDim::Type GetType(const char *name)
static function to get the enumeration from a string
Interface (abstract) class for 1D numerical integration It must be implemented by the concrete Integr...
virtual ROOT::Math::IntegratorOneDimOptions Options() const =0
get the option used for the integration must be implemented by derived class
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 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 int Status() const =0
return the Error Status of the last Integral calculation
Template class to wrap any C++ callable object which takes one argument i.e.
Type
enumeration specifying the integration types.
@ kDEFAULT
default type specified in the static options
Namespace for new Math classes and functions.
IntegratorOneDim Integrator
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.