ROOT  6.06/09
Reference Guide
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ROOT::Math::GSLMCIntegrator Class Reference

Definition at line 92 of file GSLMCIntegrator.h.

Public Types

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

Public Member Functions

 GSLMCIntegrator (MCIntegration::Type type=MCIntegration::kVEGAS, double absTol=-1, double relTol=-1, unsigned int calls=0)
 constructor of GSL MCIntegrator using all the default options More...
 
 GSLMCIntegrator (const char *type, double absTol, double relTol, unsigned int calls)
 constructor of GSL MCIntegrator. More...
 
virtual ~GSLMCIntegrator ()
 destructor More...
 
void SetFunction (const IMultiGenFunction &f)
 method to set the a generic integration function More...
 
void SetFunction (GSLMonteFuncPointer f, unsigned int dim, void *p=0)
 
double Integral (const GSLMonteFuncPointer &f, unsigned int dim, double *a, double *b, void *p=0)
 evaluate the Integral of a function f over the defined hypercube (a,b) More...
 
double Integral (const double *a, const double *b)
 evaluate the integral using the previously defined function More...
 
double Result () const
 return the type of the integration used More...
 
double Error () const
 return the estimate of the absolute Error of the last Integral calculation More...
 
int Status () const
 return the Error Status of the last Integral calculation More...
 
int NEval () const
 return number of function evaluations in calculating the integral (This is an fixed by the user) More...
 
void SetRelTolerance (double relTolerance)
 set the desired relative Error More...
 
void SetAbsTolerance (double absTolerance)
 set the desired absolute Error More...
 
void SetOptions (const ROOT::Math::IntegratorMultiDimOptions &opt)
 set the integration options More...
 
void SetGenerator (GSLRngWrapper *r)
 set random number generator More...
 
void SetType (MCIntegration::Type type)
 set integration method More...
 
void SetTypeName (const char *typeName)
 set integration method using a name instead of an enumeration More...
 
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 smapling More...
 
void SetParameters (const VegasParameters &p)
 set default parameters for VEGAS method More...
 
void SetParameters (const MiserParameters &p)
 set default parameters for MISER method More...
 
double Sigma ()
 set parameters for PLAIN method More...
 
double ChiSqr ()
 returns chi-squared per degree of freedom for the estimate of the integral in the Vegas algorithm More...
 
MCIntegration::Type GetType () const
 return the type (need to be called GetType to avois a conflict with typedef) More...
 
const char * GetTypeName () const
 return the name More...
 
ROOT::Math::IntegratorMultiDimOptions Options () const
 get the option used for the integration More...
 
ROOT::Math::IOptionsExtraOptions () const
 get the specific options (for Vegas or Miser) in term of string- name More...
 
- Public Member Functions inherited from ROOT::Math::VirtualIntegratorMultiDim
virtual ~VirtualIntegratorMultiDim ()
 destructor: no operation More...
 
virtual ROOT::Math::IntegrationMultiDim::Type Type () const
 
- Public Member Functions inherited from ROOT::Math::VirtualIntegrator
virtual ~VirtualIntegrator ()
 

Protected Member Functions

bool CheckFunction ()
 
void DoInitialize ()
 

Private Member Functions

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

Private Attributes

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

#include <Math/GSLMCIntegrator.h>

+ Inheritance diagram for ROOT::Math::GSLMCIntegrator:
+ Collaboration diagram for ROOT::Math::GSLMCIntegrator:

Member Typedef Documentation

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

Definition at line 159 of file GSLMCIntegrator.h.

Definition at line 96 of file GSLMCIntegrator.h.

Constructor & Destructor Documentation

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

constructor of GSL MCIntegrator using all the default options

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 teh static method of ROOT::Math::IntegratorMultiDimOptions

Definition at line 74 of file GSLMCIntegrator.cxx.

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.

ROOT::Math::GSLMCIntegrator::~GSLMCIntegrator ( )
virtual

destructor

Definition at line 131 of file GSLMCIntegrator.cxx.

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

Definition at line 145 of file GSLMCIntegrator.cxx.

Member Function Documentation

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

Definition at line 444 of file GSLMCIntegrator.cxx.

Referenced by Integral().

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 426 of file GSLMCIntegrator.cxx.

Referenced by integral_MC().

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

Definition at line 388 of file GSLMCIntegrator.cxx.

Referenced by Integral().

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

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

Implements ROOT::Math::VirtualIntegrator.

Definition at line 245 of file GSLMCIntegrator.cxx.

Referenced by integral_MC().

ROOT::Math::IOptions * ROOT::Math::GSLMCIntegrator::ExtraOptions ( ) const

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

Definition at line 471 of file GSLMCIntegrator.cxx.

Referenced by Options().

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

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

Definition at line 289 of file GSLMCIntegrator.h.

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

return the name

Definition at line 453 of file GSLMCIntegrator.cxx.

Referenced by Options().

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

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
alower value of the integration interval
bupper value of the integration interval

Definition at line 220 of file GSLMCIntegrator.cxx.

Referenced by integral_MC().

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

evaluate the integral using the previously defined function

Implements ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 174 of file GSLMCIntegrator.cxx.

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

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

Reimplemented from ROOT::Math::VirtualIntegrator.

Definition at line 211 of file GSLMCIntegrator.h.

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

Definition at line 149 of file GSLMCIntegrator.cxx.

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

get the option used for the integration

Implements ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 460 of file GSLMCIntegrator.cxx.

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

return the type of the integration used

return the Result of the last Integral calculation

Implements ROOT::Math::VirtualIntegrator.

Definition at line 240 of file GSLMCIntegrator.cxx.

Referenced by integral_MC().

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

set the desired absolute Error

Implements ROOT::Math::VirtualIntegrator.

Definition at line 263 of file GSLMCIntegrator.cxx.

Referenced by SetOptions().

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

method to set the a generic integration function

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

Implements ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 155 of file GSLMCIntegrator.cxx.

Referenced by Integral(), and integral_MC().

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

Definition at line 163 of file GSLMCIntegrator.cxx.

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

set random number generator

Definition at line 265 of file GSLMCIntegrator.cxx.

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 smapling

Definition at line 317 of file GSLMCIntegrator.cxx.

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

set the integration options

Reimplemented from ROOT::Math::VirtualIntegratorMultiDim.

Definition at line 332 of file GSLMCIntegrator.cxx.

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

set default parameters for VEGAS method

Definition at line 361 of file GSLMCIntegrator.cxx.

Referenced by GSLMCIntegrator(), and SetOptions().

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

set default parameters for MISER method

Definition at line 374 of file GSLMCIntegrator.cxx.

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

set the desired relative Error

Implements ROOT::Math::VirtualIntegrator.

Definition at line 258 of file GSLMCIntegrator.cxx.

Referenced by SetOptions().

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

set integration method

Definition at line 267 of file GSLMCIntegrator.cxx.

Referenced by GSLMCIntegrator(), and SetTypeName().

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

set integration method using a name instead of an enumeration

Definition at line 293 of file GSLMCIntegrator.cxx.

Referenced by GSLMCIntegrator(), and SetOptions().

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 406 of file GSLMCIntegrator.cxx.

Referenced by integral_MC().

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

return the Error Status of the last Integral calculation

Implements ROOT::Math::VirtualIntegrator.

Definition at line 250 of file GSLMCIntegrator.cxx.

Member Data Documentation

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

Definition at line 325 of file GSLMCIntegrator.h.

Referenced by Options(), and SetAbsTolerance().

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

Definition at line 324 of file GSLMCIntegrator.h.

Referenced by Integral(), NEval(), Options(), and SetOptions().

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

Definition at line 323 of file GSLMCIntegrator.h.

Referenced by DoInitialize(), Integral(), SetFunction(), and SetOptions().

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

Definition at line 331 of file GSLMCIntegrator.h.

Referenced by Error(), and Integral().

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

Definition at line 336 of file GSLMCIntegrator.h.

Referenced by CheckFunction(), Integral(), SetFunction(), and ~GSLMCIntegrator().

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

Definition at line 326 of file GSLMCIntegrator.h.

Referenced by Options(), and SetRelTolerance().

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

Definition at line 330 of file GSLMCIntegrator.h.

Referenced by Integral(), and Result().

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

Definition at line 321 of file GSLMCIntegrator.h.

Referenced by GSLMCIntegrator(), Integral(), SetGenerator(), and ~GSLMCIntegrator().

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

Definition at line 332 of file GSLMCIntegrator.h.

Referenced by Integral(), and Status().

MCIntegration::Type ROOT::Math::GSLMCIntegrator::fType
private
GSLMCIntegrationWorkspace* ROOT::Math::GSLMCIntegrator::fWorkspace
private

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