Logo ROOT  
Reference Guide
RooAdaptiveGaussKronrodIntegrator1D.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAdaptiveGaussKronrodIntegrator1D.h,v 1.5 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_ADAPTIVE_GAUSS_KRONROD_INTEGRATOR_1D
17#define ROO_ADAPTIVE_GAUSS_KRONROD_INTEGRATOR_1D
18
19#include "RooAbsIntegrator.h"
20#include "RooNumIntConfig.h"
21
23
25public:
26
27 // Constructors, assignment etc
31 const RooNumIntConfig& config) ;
32 virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
34
35 virtual Bool_t checkLimits() const;
36 virtual Double_t integral(const Double_t *yvec=0) ;
37
41 // If flag is true, intergration limits are taken from definition in input function binding
42 _useIntegrandLimits = flag ; return kTRUE ;
43 }
44
45 virtual Bool_t canIntegrate1D() const {
46 // We can integrate 1-dimensional functions
47 return kTRUE ;
48 }
49 virtual Bool_t canIntegrate2D() const {
50 // We can not integrate 2-dimensional functions
51 return kFALSE ;
52 }
53 virtual Bool_t canIntegrateND() const {
54 // We can not integrate >2-dimensional functions
55 return kFALSE ;
56 }
57 virtual Bool_t canIntegrateOpenEnded() const {
58 // We can integrate over open-ended domains
59 return kTRUE ;
60 }
61
62protected:
63
64 friend class RooNumIntFactory ;
65 static void registerIntegrator(RooNumIntFactory& fact) ;
66
69
70 friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
71
73
75
77 // Return contents of xx in internal array pointer
78 _x[0] = xx ; return _x ;
79 }
80 Double_t *_x ; //! Current coordinate
81
82 Double_t _epsAbs ; // Absolute precision
83 Double_t _epsRel ; // Relative precision
84 Int_t _methodKey ; // GSL method key
85 Int_t _maxSeg ; // Maximum number of segments
86 void* _workspace ; // GSL workspace
87
88 mutable Double_t _xmin; //! Lower integration bound
89 mutable Double_t _xmax; //! Upper integration bound
90
91 ClassDef(RooAdaptiveGaussKronrodIntegrator1D,0) // 1-dimensional adaptive Gauss-Kronrod numerical integration engine
92};
93
94#endif
double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
float xmin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual Bool_t setLimits(Double_t *, Double_t *)
RooAdaptiveGaussKronrodIntegrator1D implements the Gauss-Kronrod integration algorithm.
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Virtual constructor.
virtual Bool_t checkLimits() const
Check that our integration range is finite and otherwise return kFALSE.
Bool_t setLimits(Double_t *xmin, Double_t *xmax)
Change our integration limits.
RooAdaptiveGaussKronrodIntegrator1D()
coverity[UNINIT_CTOR] Default constructor
friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
Bool_t initialize()
Initialize integrator allocate buffers and setup GSL workspace.
virtual Double_t integral(const Double_t *yvec=0)
Calculate and return integral at at given parameter values.
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition.
static void registerIntegrator(RooNumIntFactory &fact)
Register this class with RooNumIntConfig as a possible choice of numeric integrator for one-dimension...
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
RooNumIntFactory is a factory to instantiate numeric integrators from a given function binding and a ...
Double_t x[n]
Definition: legend1.C:17
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151