Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Math::GSLMCIntegrator Class Reference

Definition at line 74 of file GSLMCIntegrator.h.

Public Types

typedef double(* GSLMonteFuncPointer) (double *, size_t, void *)
 
typedef MCIntegration::Type Type
 

Public Member Functions

 GSLMCIntegrator (const char *type, double absTol, double relTol, unsigned int calls)
 constructor of GSL MCIntegrator.
 
 GSLMCIntegrator (MCIntegration::Type type=MCIntegration::kVEGAS, double absTol=-1, double relTol=-1, unsigned int calls=0)
 constructor of GSL MCIntegrator.
 
 ~GSLMCIntegrator () override
 destructor
 
double ChiSqr ()
 returns chi-squared per degree of freedom for the estimate of the integral in the Vegas algorithm
 
double Error () const override
 return the estimate of the absolute Error of the last Integral calculation
 
std::unique_ptr< ROOT::Math::IOptionsExtraOptions () const
 get the specific options (for Vegas or Miser) in term of string- name.
 
MCIntegration::Type GetType () const
 return the type (need to be called GetType to avoid a conflict with typedef)
 
const char * GetTypeName () const
 return the name
 
double Integral (const double *a, const double *b) override
 evaluate the integral using the previously defined function
 
double Integral (const GSLMonteFuncPointer &f, unsigned int dim, double *a, double *b, void *p=nullptr)
 evaluate the Integral of a function f over the defined hypercube (a,b)
 
int NEval () const override
 return number of function evaluations in calculating the integral (This is an fixed by the user)
 
ROOT::Math::IntegratorMultiDimOptions Options () const override
 get the option used for the integration
 
double Result () const override
 return the type of the integration used
 
void SetAbsTolerance (double absTolerance) override
 set the desired absolute Error
 
void SetExtraOptions (const ROOT::Math::IOptions &opt)
 Set the extra options for Vegas and Miser.
 
void SetFunction (const IMultiGenFunction &f) override
 method to set the a generic integration function
 
void SetFunction (GSLMonteFuncPointer f, unsigned int dim, void *p=nullptr)
 
void SetGenerator (GSLRandomEngine &r)
 set random number generator
 
void SetMode (MCIntegration::Mode mode)
 set integration mode for VEGAS method The possible MODE are : MCIntegration::kIMPORTANCE (default) : VEGAS will use importance sampling MCIntegration::kSTRATIFIED : VEGAS will use stratified sampling if certain condition are satisfied MCIntegration::kIMPORTANCE_ONLY : VEGAS will always use importance sampling
 
void SetOptions (const ROOT::Math::IntegratorMultiDimOptions &opt) override
 set the integration options
 
void SetParameters (const MiserParameters &p)
 set default parameters for MISER method
 
void SetParameters (const VegasParameters &p)
 set default parameters for VEGAS method
 
void SetRelTolerance (double relTolerance) override
 set the desired relative Error
 
void SetType (MCIntegration::Type type)
 set integration method
 
void SetTypeName (const char *typeName)
 set integration method using a name instead of an enumeration
 
double Sigma ()
 set parameters for PLAIN method
 
int Status () const override
 return the Error Status of the last Integral calculation
 
- Public Member Functions inherited from ROOT::Math::VirtualIntegratorMultiDim
 ~VirtualIntegratorMultiDim () override
 destructor: no operation
 
virtual ROOT::Math::IntegrationMultiDim::Type Type () const
 return type of integrator
 
- Public Member Functions inherited from ROOT::Math::VirtualIntegrator
virtual ~VirtualIntegrator ()
 destructor: no operation
 

Protected Member Functions

bool CheckFunction ()
 
void DoInitialize ()
 

Private Member Functions

 GSLMCIntegrator (const GSLMCIntegrator &)
 
GSLMCIntegratoroperator= (const GSLMCIntegrator &)
 

Private Attributes

double fAbsTol
 
unsigned int fCalls
 
unsigned int fDim
 
double fError
 
bool fExtGen
 
GSLMonteFunctionWrapperfFunction
 
double fRelTol
 
double fResult
 
GSLRngWrapperfRng
 
int fStatus
 
MCIntegration::Type fType
 
GSLMCIntegrationWorkspacefWorkspace
 

#include <Math/GSLMCIntegrator.h>

Inheritance diagram for ROOT::Math::GSLMCIntegrator:
[legend]

Member Typedef Documentation

◆ GSLMonteFuncPointer

typedef double(* ROOT::Math::GSLMCIntegrator::GSLMonteFuncPointer) (double *, size_t, void *)

Definition at line 141 of file GSLMCIntegrator.h.

◆ Type

Constructor & Destructor Documentation

◆ GSLMCIntegrator() [1/3]

ROOT::Math::GSLMCIntegrator::GSLMCIntegrator ( MCIntegration::Type  type = MCIntegration::kVEGAS,
double  absTol = -1,
double  relTol = -1,
unsigned int  calls = 0 
)
explicit

constructor of GSL MCIntegrator.

VEGAS MC is set as default integration type

Parameters
typetype of integration. The possible types are defined in the MCIntegration::Type enumeration Default is VEGAS
absToldesired absolute Error (this parameter is actually not used and it can be ignored. The tolerance is fixed by the number of given calls)
relToldesired relative Error (this parameter is actually not used and it can be ignored. The tolerance is fixed by the number of given calls)
callsmaximum number of function calls

NOTE: When the default values are used , the options are taken from the static method of ROOT::Math::IntegratorMultiDimOptions

Definition at line 73 of file GSLMCIntegrator.cxx.

◆ GSLMCIntegrator() [2/3]

ROOT::Math::GSLMCIntegrator::GSLMCIntegrator ( const char *  type,
double  absTol,
double  relTol,
unsigned int  calls 
)

constructor of GSL MCIntegrator.

VEGAS MC is set as default integration type

Parameters
typetype of integration using a char * (required by plug-in manager)
absToldesired absolute Error
relToldesired relative Error
callsmaximum number of function calls

Definition at line 102 of file GSLMCIntegrator.cxx.

◆ ~GSLMCIntegrator()

ROOT::Math::GSLMCIntegrator::~GSLMCIntegrator ( )
override

destructor

Definition at line 133 of file GSLMCIntegrator.cxx.

◆ GSLMCIntegrator() [3/3]

ROOT::Math::GSLMCIntegrator::GSLMCIntegrator ( const GSLMCIntegrator )
private

Definition at line 147 of file GSLMCIntegrator.cxx.

Member Function Documentation

◆ CheckFunction()

bool ROOT::Math::GSLMCIntegrator::CheckFunction ( )
protected

Definition at line 457 of file GSLMCIntegrator.cxx.

◆ ChiSqr()

double ROOT::Math::GSLMCIntegrator::ChiSqr ( )

returns chi-squared per degree of freedom for the estimate of the integral in the Vegas algorithm

Definition at line 439 of file GSLMCIntegrator.cxx.

◆ DoInitialize()

void ROOT::Math::GSLMCIntegrator::DoInitialize ( )
protected

Definition at line 401 of file GSLMCIntegrator.cxx.

◆ Error()

double ROOT::Math::GSLMCIntegrator::Error ( ) const
overridevirtual

return the estimate of the absolute Error of the last Integral calculation

Implements ROOT::Math::VirtualIntegrator.

Definition at line 253 of file GSLMCIntegrator.cxx.

◆ ExtraOptions()

std::unique_ptr< ROOT::Math::IOptions > ROOT::Math::GSLMCIntegrator::ExtraOptions ( ) const

get the specific options (for Vegas or Miser) in term of string- name.

return a new option object which is managed by user

This is for querying existing options and return object is managed by the user

Definition at line 484 of file GSLMCIntegrator.cxx.

◆ GetType()

MCIntegration::Type ROOT::Math::GSLMCIntegrator::GetType ( ) const
inline

return the type (need to be called GetType to avoid a conflict with typedef)

Definition at line 273 of file GSLMCIntegrator.h.

◆ GetTypeName()

const char * ROOT::Math::GSLMCIntegrator::GetTypeName ( ) const

return the name

Definition at line 466 of file GSLMCIntegrator.cxx.

◆ Integral() [1/2]

double ROOT::Math::GSLMCIntegrator::Integral ( const double a,
const double b 
)
overridevirtual

evaluate the integral using the previously defined function

Implements ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 182 of file GSLMCIntegrator.cxx.

◆ Integral() [2/2]

double ROOT::Math::GSLMCIntegrator::Integral ( const GSLMonteFuncPointer f,
unsigned int  dim,
double a,
double b,
void *  p = nullptr 
)

evaluate the Integral of a function f over the defined hypercube (a,b)

Parameters
fintegration function. The function type must implement the mathlib::IGenFunction interface
dimthe dimension
alower value of the integration interval
bupper value of the integration interval
ppointer to parameter array

Definition at line 228 of file GSLMCIntegrator.cxx.

◆ NEval()

int ROOT::Math::GSLMCIntegrator::NEval ( ) const
inlineoverridevirtual

return number of function evaluations in calculating the integral (This is an fixed by the user)

Reimplemented from ROOT::Math::VirtualIntegrator.

Definition at line 195 of file GSLMCIntegrator.h.

◆ operator=()

GSLMCIntegrator & ROOT::Math::GSLMCIntegrator::operator= ( const GSLMCIntegrator )
private

Definition at line 151 of file GSLMCIntegrator.cxx.

◆ Options()

ROOT::Math::IntegratorMultiDimOptions ROOT::Math::GSLMCIntegrator::Options ( ) const
overridevirtual

get the option used for the integration

Implements ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 473 of file GSLMCIntegrator.cxx.

◆ Result()

double ROOT::Math::GSLMCIntegrator::Result ( ) const
overridevirtual

return the type of the integration used

return the Result of the last Integral calculation

Implements ROOT::Math::VirtualIntegrator.

Definition at line 248 of file GSLMCIntegrator.cxx.

◆ SetAbsTolerance()

void ROOT::Math::GSLMCIntegrator::SetAbsTolerance ( double  absTolerance)
overridevirtual

set the desired absolute Error

Implements ROOT::Math::VirtualIntegrator.

Definition at line 271 of file GSLMCIntegrator.cxx.

◆ SetExtraOptions()

void ROOT::Math::GSLMCIntegrator::SetExtraOptions ( const ROOT::Math::IOptions opt)

Set the extra options for Vegas and Miser.

Definition at line 489 of file GSLMCIntegrator.cxx.

◆ SetFunction() [1/2]

void ROOT::Math::GSLMCIntegrator::SetFunction ( const IMultiGenFunction f)
overridevirtual

method to set the a generic integration function

Parameters
fintegration function. The function type must implement the assignment operator, double operator() ( double x )

Implements ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 157 of file GSLMCIntegrator.cxx.

◆ SetFunction() [2/2]

void ROOT::Math::GSLMCIntegrator::SetFunction ( GSLMonteFuncPointer  f,
unsigned int  dim,
void *  p = nullptr 
)

Definition at line 168 of file GSLMCIntegrator.cxx.

◆ SetGenerator()

void ROOT::Math::GSLMCIntegrator::SetGenerator ( GSLRandomEngine r)

set random number generator

Definition at line 273 of file GSLMCIntegrator.cxx.

◆ SetMode()

void ROOT::Math::GSLMCIntegrator::SetMode ( MCIntegration::Mode  mode)

set integration mode for VEGAS method The possible MODE are : MCIntegration::kIMPORTANCE (default) : VEGAS will use importance sampling MCIntegration::kSTRATIFIED : VEGAS will use stratified sampling if certain condition are satisfied MCIntegration::kIMPORTANCE_ONLY : VEGAS will always use importance sampling

Definition at line 331 of file GSLMCIntegrator.cxx.

◆ SetOptions()

void ROOT::Math::GSLMCIntegrator::SetOptions ( const ROOT::Math::IntegratorMultiDimOptions opt)
overridevirtual

set the integration options

Reimplemented from ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 347 of file GSLMCIntegrator.cxx.

◆ SetParameters() [1/2]

void ROOT::Math::GSLMCIntegrator::SetParameters ( const MiserParameters p)

set default parameters for MISER method

Definition at line 387 of file GSLMCIntegrator.cxx.

◆ SetParameters() [2/2]

void ROOT::Math::GSLMCIntegrator::SetParameters ( const VegasParameters p)

set default parameters for VEGAS method

Definition at line 374 of file GSLMCIntegrator.cxx.

◆ SetRelTolerance()

void ROOT::Math::GSLMCIntegrator::SetRelTolerance ( double  relTolerance)
overridevirtual

set the desired relative Error

Implements ROOT::Math::VirtualIntegrator.

Definition at line 266 of file GSLMCIntegrator.cxx.

◆ SetType()

void ROOT::Math::GSLMCIntegrator::SetType ( MCIntegration::Type  type)

set integration method

Definition at line 280 of file GSLMCIntegrator.cxx.

◆ SetTypeName()

void ROOT::Math::GSLMCIntegrator::SetTypeName ( const char *  typeName)

set integration method using a name instead of an enumeration

Definition at line 306 of file GSLMCIntegrator.cxx.

◆ Sigma()

double ROOT::Math::GSLMCIntegrator::Sigma ( )

set parameters for PLAIN method

returns the error sigma from the last iteration of the Vegas algorithm

Definition at line 419 of file GSLMCIntegrator.cxx.

◆ Status()

int ROOT::Math::GSLMCIntegrator::Status ( ) const
overridevirtual

return the Error Status of the last Integral calculation

Implements ROOT::Math::VirtualIntegrator.

Definition at line 258 of file GSLMCIntegrator.cxx.

Member Data Documentation

◆ fAbsTol

double ROOT::Math::GSLMCIntegrator::fAbsTol
private

Definition at line 315 of file GSLMCIntegrator.h.

◆ fCalls

unsigned int ROOT::Math::GSLMCIntegrator::fCalls
private

Definition at line 314 of file GSLMCIntegrator.h.

◆ fDim

unsigned int ROOT::Math::GSLMCIntegrator::fDim
private

Definition at line 313 of file GSLMCIntegrator.h.

◆ fError

double ROOT::Math::GSLMCIntegrator::fError
private

Definition at line 321 of file GSLMCIntegrator.h.

◆ fExtGen

bool ROOT::Math::GSLMCIntegrator::fExtGen
private

Definition at line 323 of file GSLMCIntegrator.h.

◆ fFunction

GSLMonteFunctionWrapper* ROOT::Math::GSLMCIntegrator::fFunction
private

Definition at line 327 of file GSLMCIntegrator.h.

◆ fRelTol

double ROOT::Math::GSLMCIntegrator::fRelTol
private

Definition at line 316 of file GSLMCIntegrator.h.

◆ fResult

double ROOT::Math::GSLMCIntegrator::fResult
private

Definition at line 320 of file GSLMCIntegrator.h.

◆ fRng

GSLRngWrapper* ROOT::Math::GSLMCIntegrator::fRng
private

Definition at line 311 of file GSLMCIntegrator.h.

◆ fStatus

int ROOT::Math::GSLMCIntegrator::fStatus
private

Definition at line 322 of file GSLMCIntegrator.h.

◆ fType

MCIntegration::Type ROOT::Math::GSLMCIntegrator::fType
private

Definition at line 309 of file GSLMCIntegrator.h.

◆ fWorkspace

GSLMCIntegrationWorkspace* ROOT::Math::GSLMCIntegrator::fWorkspace
private

Definition at line 326 of file GSLMCIntegrator.h.

Libraries for ROOT::Math::GSLMCIntegrator:

The documentation for this class was generated from the following files: