herwig
is hosted by
Hepforge
,
IPPP Durham
Herwig
7.3.0
Utilities
GSLIntegrator.h
1
// -*- C++ -*-
2
//
3
// GSLIntegrator.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4
// Copyright (C) 2002-2019 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
40
class
GSLIntegrator
:
public
Pointer::ReferenceCounted
{
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
62
template
<
class
T>
63
using
ValT
=
decltype
(std::declval<typename T::ValType>()
64
* std::declval<typename T::ArgType>());
65
72
template
<
class
T>
73
inline
ValT<T>
74
value
(
const
T & function,
75
const
typename
T::ArgType lower,
76
const
typename
T::ArgType upper)
const
;
77
85
template
<
class
T>
86
inline
ValT<T>
87
value
(
const
T & function,
88
const
typename
T::ArgType lower,
89
const
typename
T::ArgType upper,
90
ValT<T>
& error)
const
;
91
92
private
:
93
98
GSLIntegrator
&
operator=
(
const
GSLIntegrator
&) =
delete
;
99
100
private
:
101
105
double
_abserr
;
106
110
double
_relerr
;
111
115
int
_nbins
;
116
};
117
118
}
119
120
#include "GSLIntegrator.tcc"
121
122
#endif
/* HERWIG_GSLIntegrator_H */
Herwig::GSLIntegrator
This class is designed to integrate a given function between 2 limits using the gsl QAGS integration ...
Definition:
GSLIntegrator.h:40
Herwig::GSLIntegrator::ValT
decltype(std::declval< typename T::ValType >() *std::declval< typename T::ArgType >()) ValT
helper type for the integration result
Definition:
GSLIntegrator.h:64
Herwig::GSLIntegrator::_nbins
int _nbins
The maximum number of intervals to use.
Definition:
GSLIntegrator.h:115
Herwig::GSLIntegrator::value
ValT< T > value(const T &function, const typename T::ArgType lower, const typename T::ArgType upper) const
The value of the integral.
Herwig::GSLIntegrator::_relerr
double _relerr
The parameters controlling the relative error.
Definition:
GSLIntegrator.h:110
Herwig::GSLIntegrator::GSLIntegrator
GSLIntegrator()
Default Constructor uses values in GSL manual as parameters.
Definition:
GSLIntegrator.h:49
Herwig::GSLIntegrator::_abserr
double _abserr
The parameters controlling the absolute error.
Definition:
GSLIntegrator.h:105
Herwig::GSLIntegrator::value
ValT< T > value(const T &function, const typename T::ArgType lower, const typename T::ArgType upper, ValT< T > &error) const
The value of the integral.
Herwig::GSLIntegrator::GSLIntegrator
GSLIntegrator(double abserr, double relerr, int nbins)
Specify all the parameters.
Definition:
GSLIntegrator.h:57
Herwig::GSLIntegrator::operator=
GSLIntegrator & operator=(const GSLIntegrator &)=delete
The assignment operator is private and must never be called.
ThePEG::Pointer::ReferenceCounted
Herwig
-*- C++ -*-
Definition:
BasicConsistency.h:17
ThePEG
Generated on Thu Jun 20 2024 17:50:53 for Herwig by
1.9.6