Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
29 RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
30 RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, double xmin, double xmax,
31 const RooNumIntConfig& config) ;
32 RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const override ;
34
35 bool checkLimits() const override;
36 double integral(const double *yvec=nullptr) override ;
37
39 bool setLimits(double* xmin, double* xmax) override;
40 bool setUseIntegrandLimits(bool flag) override {
41 // If flag is true, intergration limits are taken from definition in input function binding
42 _useIntegrandLimits = flag ; return true ;
43 }
44
45 bool canIntegrate1D() const override {
46 // We can integrate 1-dimensional functions
47 return true ;
48 }
49 bool canIntegrate2D() const override {
50 // We can not integrate 2-dimensional functions
51 return false ;
52 }
53 bool canIntegrateND() const override {
54 // We can not integrate >2-dimensional functions
55 return false ;
56 }
57 bool canIntegrateOpenEnded() const override {
58 // We can integrate over open-ended domains
59 return true ;
60 }
61
62protected:
63
64 friend class RooNumIntFactory ;
65 static void registerIntegrator(RooNumIntFactory& fact) ;
66
69
71
72 bool initialize();
73
75
76 double* xvec(double& xx) {
77 // Return contents of xx in internal array pointer
78 _x[0] = xx ; return _x.data();
79 }
80 std::vector<double> _x ; //! Current coordinate
81
82 double _epsAbs ; // Absolute precision
83 double _epsRel ; // Relative precision
84 Int_t _methodKey ; // GSL method key
85 Int_t _maxSeg ; // Maximum number of segments
86 void* _workspace = nullptr; // GSL workspace
87
88 mutable double _xmin; //! Lower integration bound
89 mutable double _xmax; //! Upper integration bound
90
91 ClassDefOverride(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.
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
float xmin
float xmax
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual bool setLimits(double *, double *)
RooAdaptiveGaussKronrodIntegrator1D implements the Gauss-Kronrod integration algorithm.
double integral(const double *yvec=nullptr) override
Calculate and return integral at at given parameter values.
RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const override
Virtual constructor.
bool initialize()
Initialize integrator allocate buffers and setup GSL workspace.
bool setUseIntegrandLimits(bool flag) override
Interface function that allows to defer limit definition to integrand definition.
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
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