ROOT logo
ROOT » MATH » MATHMORE » ROOT::Math::GSLMCIntegrator

class ROOT::Math::GSLMCIntegrator: public ROOT::Math::VirtualIntegratorMultiDim



    Class for performing numerical integration of a multidimensional function.
    It uses the numerical integration algorithms of GSL, which reimplements the
    algorithms used in the QUADPACK, a numerical integration package written in Fortran.

    Plain MC, MISER and VEGAS integration algorithms are supported for integration over finite (hypercubic) ranges.

    <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_16.html#SEC248">GSL Manual</A>.

    It implements also the interface ROOT::Math::VirtualIntegratorMultiDim so it can be
    instantiate using the plugin manager (plugin name is "GSLMCIntegrator")

    @ingroup MCIntegration


Function Members (Methods)

public:
virtual~GSLMCIntegrator()
doubleChiSqr()
virtual doubleError() const
virtual doubleROOT::Math::VirtualIntegrator::Error() const
ROOT::Math::GSLMCIntegratorGSLMCIntegrator(ROOT::Math::IntegrationMultiDim::Type type = MCIntegration::kVEGAS, double absTol = 1.E-6, double relTol = 1E-4, unsigned int calls = 500000)
ROOT::Math::GSLMCIntegratorGSLMCIntegrator(const char* type, double absTol, double relTol, unsigned int calls)
virtual doubleIntegral(const double* a, const double* b)
virtual doubleROOT::Math::VirtualIntegratorMultiDim::Integral(const double*, const double*)
doubleIntegral(const ROOT::Math::GSLMCIntegrator::GSLMonteFuncPointer& f, unsigned int dim, double* a, double* b, void* p = 0)
ROOT::Math::VirtualIntegratorMultiDim&ROOT::Math::VirtualIntegratorMultiDim::operator=(const ROOT::Math::VirtualIntegratorMultiDim&)
ROOT::Math::VirtualIntegrator&ROOT::Math::VirtualIntegrator::operator=(const ROOT::Math::VirtualIntegrator&)
virtual doubleResult() const
virtual doubleROOT::Math::VirtualIntegrator::Result() const
virtual voidSetAbsTolerance(double absTolerance)
virtual voidROOT::Math::VirtualIntegrator::SetAbsTolerance(double)
virtual voidSetFunction(const ROOT::Math::IMultiGenFunction& f)
virtual voidROOT::Math::VirtualIntegratorMultiDim::SetFunction(const ROOT::Math::IMultiGenFunction&)
voidSetFunction(ROOT::Math::GSLMCIntegrator::GSLMonteFuncPointer f, unsigned int dim, void* p = 0)
voidSetGenerator(ROOT::Math::GSLRngWrapper* r)
voidSetMode(ROOT::Math::MCIntegration::Mode mode)
voidSetParameters(const ROOT::Math::VegasParameters& p)
voidSetParameters(const ROOT::Math::MiserParameters& p)
virtual voidSetRelTolerance(double relTolerance)
virtual voidROOT::Math::VirtualIntegrator::SetRelTolerance(double)
voidSetType(ROOT::Math::IntegrationMultiDim::Type type)
doubleSigma()
virtual intStatus() const
virtual intROOT::Math::VirtualIntegrator::Status() const
protected:
boolCheckFunction()
voidDoInitialize()

Data Members

private:
doublefAbsTol
unsigned intfCalls
unsigned intfDim
doublefError
ROOT::Math::GSLMonteFunctionWrapper*fFunction
ROOT::Math::MCIntegration::ModefMode
doublefRelTol
doublefResult
ROOT::Math::GSLRngWrapper*fRng
intfStatus
ROOT::Math::IntegrationMultiDim::TypefType
ROOT::Math::GSLMCIntegrationWorkspace*fWorkspace

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

GSLMCIntegrator(MCIntegration::Type type = MCIntegration::kVEGAS, double absTol = 1.E-6, double relTol = 1E-4, unsigned int calls = 500000)
 constructors
 constructor of GSL MCIntegrator. VEGAS MC is set as default integration type

      @param type type of integration. The possible types are defined in the Integration::Type enumeration
      @param absTol desired absolute Error
      @param relTol desired relative Error
      @param calls maximum number of function calls

GSLMCIntegrator(const char * type, double absTol, double relTol, unsigned int calls)
 constructor of GSL MCIntegrator. VEGAS MC is set as default integration type

      @param type type of integration using a char * (required by plug-in manager)
      @param absTol desired absolute Error
      @param relTol desired relative Error
      @param calls maximum number of function calls

virtual ~GSLMCIntegrator()
          destructor

GSLMCIntegrator(const ROOT::Math::GSLMCIntegrator& )
 disable copy ctrs
GSLMCIntegrator & operator=(const ROOT::Math::GSLMCIntegrator& )
void SetFunction(const ROOT::Math::IMultiGenFunction& f)
 template methods for generic functors

         method to set the a generic integration function

          @param f integration function. The function type must implement the assigment operator, <em>  double  operator() (  double  x ) </em>


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

         evaluate the Integral of a function f over the defined hypercube (a,b)
       @param f integration function. The function type must implement the mathlib::IGenFunction interface
       @param a lower value of the integration interval
       @param b upper value of the integration interval

double Integral(const double* a, const double* b)
         evaluate the integral using the previously defined function

double Result() const
 to be added later
double Integral(const GSLMonteFuncPointer & f);
double Integral(GSLMonteFuncPointer f, void * p, double* a, double* b);

         return the type of the integration used

MCIntegration::Type MCType() const;

         return  the Result of the last Integral calculation

double Error() const
         return the estimate of the absolute Error of the last Integral calculation

int Status() const
         return the Error Status of the last Integral calculation

void SetRelTolerance(double relTolerance)
 setter for control Parameters  (getters are not needed so far )

         set the desired relative Error

void SetAbsTolerance(double absTolerance)
         set the desired absolute Error

void SetGenerator(ROOT::Math::GSLRngWrapper* r)
	 to be added later as options for basic MC methods
       The possible rules are defined in the Integration::GKRule enumeration.
       The integration rule can be modified only for ADAPTIVE type integrations

void SetIntegrationRule(Integration::GKRule );

	 set random number generator

void SetType(ROOT::Math::IntegrationMultiDim::Type type)
	 set integration method

void SetMode(ROOT::Math::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

void SetParameters(const VegasParameters &p)
	 set default parameters for VEGAS method

void SetParameters(const MiserParameters &p)
	 set default parameters for MISER method

double Sigma()
	 set parameters for PLAIN method

void SetPParameters(const PlainParameters &p);

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

double ChiSqr()
	 returns chi-squared per degree of freedom for the estimate of the integral in the Vegas algorithm

bool CheckFunction()
 internal method to check validity of GSL function pointer
void DoInitialize()
 set internally the type of integration method