herwig is hosted by Hepforge, IPPP Durham
Herwig  7.1.5
GSLIntegrator.h
1 // -*- C++ -*-
2 //
3 // GSLIntegrator.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2017 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef HERWIG_GSLIntegrator_H
10 #define HERWIG_GSLIntegrator_H
11 //
12 // This is the declaration of the GSLIntegrator class.
13 //
14 
15 #include "ThePEG/Pointer/ReferenceCounted.h"
16 #include "ThePEG/Repository/CurrentGenerator.h"
17 #include "gsl/gsl_integration.h"
18 #include "gsl/gsl_errno.h"
19 
20 namespace Herwig {
21 
22 using namespace ThePEG;
23 
41 
42 public:
43 
49  GSLIntegrator() : _abserr(1.0E-35), _relerr(1.0E-3), _nbins(1000) {}
50 
57  GSLIntegrator(double abserr, double relerr, int nbins) :
58  _abserr(abserr), _relerr(relerr), _nbins(nbins) {}
60 
67  template <class T>
68  inline typename BinaryOpTraits<typename T::ValType,
69  typename T::ArgType>::MulT
70  value(const T & function,
71  const typename T::ArgType lower,
72  const typename T::ArgType upper) const;
73 
81  template <class T>
82  inline typename BinaryOpTraits<typename T::ValType,
83  typename T::ArgType>::MulT
84  value(const T & function,
85  const typename T::ArgType lower,
86  const typename T::ArgType upper,
87  typename BinaryOpTraits<typename T::ValType,
88  typename T::ArgType>::MulT & error) const;
89 
90 private:
91 
96  GSLIntegrator & operator=(const GSLIntegrator &) = delete;
97 
98 private:
99 
103  double _abserr;
104 
108  double _relerr;
109 
113  int _nbins;
114 };
115 
116 }
117 
118 #include "GSLIntegrator.tcc"
119 
120 #endif /* HERWIG_GSLIntegrator_H */
int _nbins
The maximum number of intervals to use.
double _abserr
The parameters controlling the absolute error.
double _relerr
The parameters controlling the relative error.
-*- C++ -*-
This class is designed to integrate a given function between 2 limits using the gsl QAGS integration ...
Definition: GSLIntegrator.h:40
GSLIntegrator()
Default Constructor uses values in GSL manual as parameters.
Definition: GSLIntegrator.h:49
GSLIntegrator(double abserr, double relerr, int nbins)
Specify all the parameters.
Definition: GSLIntegrator.h:57